brakeman 5.2.2 → 7.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGES.md +153 -0
- data/README.md +9 -6
- data/bundle/load.rb +16 -15
- data/bundle/ruby/3.1.0/gems/csv-3.3.5/LICENSE.txt +33 -0
- data/bundle/ruby/3.1.0/gems/csv-3.3.5/NEWS.md +1009 -0
- data/bundle/ruby/3.1.0/gems/csv-3.3.5/README.md +55 -0
- data/bundle/ruby/3.1.0/gems/csv-3.3.5/lib/csv/core_ext/array.rb +9 -0
- data/bundle/ruby/3.1.0/gems/csv-3.3.5/lib/csv/core_ext/string.rb +9 -0
- data/bundle/ruby/3.1.0/gems/csv-3.3.5/lib/csv/fields_converter.rb +96 -0
- data/bundle/ruby/3.1.0/gems/csv-3.3.5/lib/csv/input_record_separator.rb +18 -0
- data/bundle/ruby/3.1.0/gems/csv-3.3.5/lib/csv/parser.rb +1302 -0
- data/bundle/ruby/3.1.0/gems/csv-3.3.5/lib/csv/row.rb +757 -0
- data/bundle/ruby/3.1.0/gems/csv-3.3.5/lib/csv/table.rb +1055 -0
- data/bundle/ruby/3.1.0/gems/csv-3.3.5/lib/csv/version.rb +6 -0
- data/bundle/ruby/3.1.0/gems/csv-3.3.5/lib/csv/writer.rb +209 -0
- data/bundle/ruby/3.1.0/gems/csv-3.3.5/lib/csv.rb +3017 -0
- data/bundle/ruby/3.1.0/gems/haml-6.4.0/CHANGELOG.md +1681 -0
- data/bundle/ruby/3.1.0/gems/haml-6.4.0/FAQ.md +147 -0
- data/bundle/ruby/3.1.0/gems/haml-6.4.0/Gemfile +34 -0
- data/bundle/ruby/3.1.0/gems/haml-6.4.0/MIT-LICENSE +20 -0
- data/bundle/ruby/3.1.0/gems/haml-6.4.0/README.md +205 -0
- data/bundle/ruby/3.1.0/gems/haml-6.4.0/REFERENCE.md +1309 -0
- data/bundle/ruby/3.1.0/gems/haml-6.4.0/exe/haml +6 -0
- data/bundle/ruby/3.1.0/gems/haml-6.4.0/haml.gemspec +45 -0
- data/bundle/ruby/3.1.0/gems/haml-6.4.0/lib/haml/ambles.rb +20 -0
- data/bundle/ruby/3.1.0/gems/haml-6.4.0/lib/haml/attribute_builder.rb +162 -0
- data/bundle/ruby/3.1.0/gems/haml-6.4.0/lib/haml/attribute_compiler.rb +133 -0
- data/bundle/ruby/3.1.0/gems/haml-6.4.0/lib/haml/attribute_parser.rb +116 -0
- data/bundle/ruby/3.1.0/gems/haml-6.4.0/lib/haml/cli.rb +154 -0
- data/bundle/ruby/3.1.0/gems/haml-6.4.0/lib/haml/compiler/children_compiler.rb +155 -0
- data/bundle/ruby/3.1.0/gems/haml-6.4.0/lib/haml/compiler/comment_compiler.rb +51 -0
- data/bundle/ruby/3.1.0/gems/haml-6.4.0/lib/haml/compiler/doctype_compiler.rb +52 -0
- data/bundle/ruby/3.1.0/gems/haml-6.4.0/lib/haml/compiler/script_compiler.rb +114 -0
- data/bundle/ruby/3.1.0/gems/haml-6.4.0/lib/haml/compiler/silent_script_compiler.rb +24 -0
- data/bundle/ruby/3.1.0/gems/haml-6.4.0/lib/haml/compiler/tag_compiler.rb +76 -0
- data/bundle/ruby/3.1.0/gems/haml-6.4.0/lib/haml/compiler.rb +97 -0
- data/bundle/ruby/3.1.0/gems/haml-6.4.0/lib/haml/dynamic_merger.rb +67 -0
- data/bundle/ruby/3.1.0/gems/haml-6.4.0/lib/haml/engine.rb +59 -0
- data/bundle/ruby/3.1.0/gems/haml-6.4.0/lib/haml/error.rb +66 -0
- data/bundle/ruby/3.1.0/gems/haml-6.4.0/lib/haml/escape.rb +13 -0
- data/bundle/ruby/3.1.0/gems/haml-6.4.0/lib/haml/escape_any.rb +21 -0
- data/bundle/ruby/3.1.0/gems/haml-6.4.0/lib/haml/filters/base.rb +12 -0
- data/bundle/ruby/3.1.0/gems/haml-6.4.0/lib/haml/filters/cdata.rb +20 -0
- data/bundle/ruby/3.1.0/gems/haml-6.4.0/lib/haml/filters/coffee.rb +17 -0
- data/bundle/ruby/3.1.0/gems/haml-6.4.0/lib/haml/filters/css.rb +33 -0
- data/bundle/ruby/3.1.0/gems/haml-6.4.0/lib/haml/filters/erb.rb +10 -0
- data/bundle/ruby/3.1.0/gems/haml-6.4.0/lib/haml/filters/escaped.rb +22 -0
- data/bundle/ruby/3.1.0/gems/haml-6.4.0/lib/haml/filters/javascript.rb +33 -0
- data/bundle/ruby/3.1.0/gems/haml-6.4.0/lib/haml/filters/less.rb +20 -0
- data/bundle/ruby/3.1.0/gems/haml-6.4.0/lib/haml/filters/markdown.rb +11 -0
- data/bundle/ruby/3.1.0/gems/haml-6.4.0/lib/haml/filters/plain.rb +29 -0
- data/bundle/ruby/3.1.0/gems/haml-6.4.0/lib/haml/filters/preserve.rb +22 -0
- data/bundle/ruby/3.1.0/gems/haml-6.4.0/lib/haml/filters/ruby.rb +10 -0
- data/bundle/ruby/3.1.0/gems/haml-6.4.0/lib/haml/filters/sass.rb +15 -0
- data/bundle/ruby/3.1.0/gems/haml-6.4.0/lib/haml/filters/scss.rb +15 -0
- data/bundle/ruby/3.1.0/gems/haml-6.4.0/lib/haml/filters/text_base.rb +25 -0
- data/bundle/ruby/3.1.0/gems/haml-6.4.0/lib/haml/filters/tilt_base.rb +59 -0
- data/bundle/ruby/3.1.0/gems/haml-6.4.0/lib/haml/filters.rb +75 -0
- data/bundle/ruby/3.1.0/gems/haml-6.4.0/lib/haml/force_escape.rb +29 -0
- data/bundle/ruby/3.1.0/gems/haml-6.4.0/lib/haml/helpers.rb +15 -0
- data/bundle/ruby/3.1.0/gems/haml-6.4.0/lib/haml/html.rb +22 -0
- data/bundle/ruby/3.1.0/gems/haml-6.4.0/lib/haml/identity.rb +13 -0
- data/bundle/ruby/3.1.0/gems/haml-6.4.0/lib/haml/object_ref.rb +35 -0
- data/bundle/ruby/3.1.0/gems/haml-6.4.0/lib/haml/parser.rb +991 -0
- data/bundle/ruby/3.1.0/gems/haml-6.4.0/lib/haml/rails_helpers.rb +53 -0
- data/bundle/ruby/3.1.0/gems/haml-6.4.0/lib/haml/rails_template.rb +62 -0
- data/bundle/ruby/3.1.0/gems/haml-6.4.0/lib/haml/railtie.rb +10 -0
- data/bundle/ruby/3.1.0/gems/haml-6.4.0/lib/haml/ruby_expression.rb +32 -0
- data/bundle/ruby/3.1.0/gems/haml-6.4.0/lib/haml/string_splitter.rb +140 -0
- data/bundle/ruby/3.1.0/gems/haml-6.4.0/lib/haml/template.rb +20 -0
- data/bundle/ruby/3.1.0/gems/haml-6.4.0/lib/haml/temple_line_counter.rb +31 -0
- data/bundle/ruby/3.1.0/gems/haml-6.4.0/lib/haml/util.rb +262 -0
- data/bundle/ruby/3.1.0/gems/haml-6.4.0/lib/haml/version.rb +4 -0
- data/bundle/ruby/3.1.0/gems/haml-6.4.0/lib/haml/whitespace.rb +8 -0
- data/bundle/ruby/3.1.0/gems/haml-6.4.0/lib/haml.rb +13 -0
- data/bundle/ruby/3.1.0/gems/highline-3.1.2/Changelog.md +658 -0
- data/bundle/ruby/3.1.0/gems/highline-3.1.2/Gemfile +21 -0
- data/bundle/ruby/3.1.0/gems/highline-3.1.2/README.md +240 -0
- data/bundle/ruby/3.1.0/gems/highline-3.1.2/highline.gemspec +40 -0
- data/bundle/ruby/3.1.0/gems/highline-3.1.2/lib/highline/io_console_compatible.rb +37 -0
- data/bundle/ruby/3.1.0/gems/highline-3.1.2/lib/highline/list_renderer.rb +261 -0
- data/bundle/ruby/3.1.0/gems/highline-3.1.2/lib/highline/menu.rb +578 -0
- data/bundle/ruby/3.1.0/gems/highline-3.1.2/lib/highline/question/answer_converter.rb +100 -0
- data/bundle/ruby/3.1.0/gems/highline-3.1.2/lib/highline/question.rb +640 -0
- data/bundle/ruby/3.1.0/gems/highline-3.1.2/lib/highline/question_asker.rb +152 -0
- data/bundle/ruby/{2.7.0/gems/highline-2.0.3 → 3.1.0/gems/highline-3.1.2}/lib/highline/style.rb +0 -0
- data/bundle/ruby/3.1.0/gems/highline-3.1.2/lib/highline/terminal/io_console.rb +36 -0
- data/bundle/ruby/3.1.0/gems/highline-3.1.2/lib/highline/terminal/unix_stty.rb +53 -0
- data/bundle/ruby/3.1.0/gems/highline-3.1.2/lib/highline/terminal.rb +192 -0
- data/bundle/ruby/3.1.0/gems/highline-3.1.2/lib/highline/version.rb +6 -0
- data/bundle/ruby/3.1.0/gems/highline-3.1.2/lib/highline.rb +676 -0
- data/bundle/ruby/3.1.0/gems/parallel-1.27.0/lib/parallel/version.rb +4 -0
- data/bundle/ruby/3.1.0/gems/parallel-1.27.0/lib/parallel.rb +708 -0
- data/bundle/ruby/3.1.0/gems/reline-0.6.2/COPYING +56 -0
- data/bundle/ruby/3.1.0/gems/reline-0.6.2/README.md +94 -0
- data/bundle/ruby/3.1.0/gems/reline-0.6.2/lib/reline/config.rb +378 -0
- data/bundle/ruby/3.1.0/gems/reline-0.6.2/lib/reline/face.rb +199 -0
- data/bundle/ruby/3.1.0/gems/reline-0.6.2/lib/reline/history.rb +76 -0
- data/bundle/ruby/3.1.0/gems/reline-0.6.2/lib/reline/io/ansi.rb +322 -0
- data/bundle/ruby/3.1.0/gems/reline-0.6.2/lib/reline/io/dumb.rb +120 -0
- data/bundle/ruby/3.1.0/gems/reline-0.6.2/lib/reline/io/windows.rb +530 -0
- data/bundle/ruby/3.1.0/gems/reline-0.6.2/lib/reline/io.rb +55 -0
- data/bundle/ruby/3.1.0/gems/reline-0.6.2/lib/reline/key_actor/base.rb +37 -0
- data/bundle/ruby/3.1.0/gems/reline-0.6.2/lib/reline/key_actor/composite.rb +17 -0
- data/bundle/ruby/3.1.0/gems/reline-0.6.2/lib/reline/key_actor/emacs.rb +517 -0
- data/bundle/ruby/3.1.0/gems/reline-0.6.2/lib/reline/key_actor/vi_command.rb +518 -0
- data/bundle/ruby/3.1.0/gems/reline-0.6.2/lib/reline/key_actor/vi_insert.rb +517 -0
- data/bundle/ruby/3.1.0/gems/reline-0.6.2/lib/reline/key_actor.rb +8 -0
- data/bundle/ruby/3.1.0/gems/reline-0.6.2/lib/reline/key_stroke.rb +119 -0
- data/bundle/ruby/3.1.0/gems/reline-0.6.2/lib/reline/kill_ring.rb +125 -0
- data/bundle/ruby/3.1.0/gems/reline-0.6.2/lib/reline/line_editor.rb +2356 -0
- data/bundle/ruby/3.1.0/gems/reline-0.6.2/lib/reline/unicode/east_asian_width.rb +1292 -0
- data/bundle/ruby/3.1.0/gems/reline-0.6.2/lib/reline/unicode.rb +421 -0
- data/bundle/ruby/3.1.0/gems/reline-0.6.2/lib/reline/version.rb +3 -0
- data/bundle/ruby/3.1.0/gems/reline-0.6.2/lib/reline.rb +527 -0
- data/bundle/ruby/3.1.0/gems/reline-0.6.2/license_of_rb-readline +25 -0
- data/bundle/ruby/3.1.0/gems/rexml-3.4.4/LICENSE.txt +22 -0
- data/bundle/ruby/3.1.0/gems/rexml-3.4.4/NEWS.md +843 -0
- data/bundle/ruby/3.1.0/gems/rexml-3.4.4/README.md +57 -0
- data/bundle/ruby/3.1.0/gems/rexml-3.4.4/lib/rexml/attribute.rb +210 -0
- data/bundle/ruby/3.1.0/gems/rexml-3.4.4/lib/rexml/cdata.rb +68 -0
- data/bundle/ruby/3.1.0/gems/rexml-3.4.4/lib/rexml/child.rb +96 -0
- data/bundle/ruby/3.1.0/gems/rexml-3.4.4/lib/rexml/comment.rb +80 -0
- data/bundle/ruby/3.1.0/gems/rexml-3.4.4/lib/rexml/doctype.rb +306 -0
- data/bundle/ruby/3.1.0/gems/rexml-3.4.4/lib/rexml/document.rb +471 -0
- data/bundle/ruby/3.1.0/gems/rexml-3.4.4/lib/rexml/element.rb +2578 -0
- data/bundle/ruby/3.1.0/gems/rexml-3.4.4/lib/rexml/encoding.rb +48 -0
- data/bundle/ruby/3.1.0/gems/rexml-3.4.4/lib/rexml/entity.rb +142 -0
- data/bundle/ruby/3.1.0/gems/rexml-3.4.4/lib/rexml/formatters/pretty.rb +142 -0
- data/bundle/ruby/3.1.0/gems/rexml-3.4.4/lib/rexml/functions.rb +446 -0
- data/bundle/ruby/3.1.0/gems/rexml-3.4.4/lib/rexml/instruction.rb +79 -0
- data/bundle/ruby/3.1.0/gems/rexml-3.4.4/lib/rexml/namespace.rb +63 -0
- data/bundle/ruby/3.1.0/gems/rexml-3.4.4/lib/rexml/node.rb +80 -0
- data/bundle/ruby/3.1.0/gems/rexml-3.4.4/lib/rexml/parseexception.rb +53 -0
- data/bundle/ruby/3.1.0/gems/rexml-3.4.4/lib/rexml/parsers/baseparser.rb +949 -0
- data/bundle/ruby/3.1.0/gems/rexml-3.4.4/lib/rexml/parsers/pullparser.rb +213 -0
- data/bundle/ruby/3.1.0/gems/rexml-3.4.4/lib/rexml/parsers/sax2parser.rb +270 -0
- data/bundle/ruby/3.1.0/gems/rexml-3.4.4/lib/rexml/parsers/streamparser.rb +67 -0
- data/bundle/ruby/3.1.0/gems/rexml-3.4.4/lib/rexml/parsers/treeparser.rb +89 -0
- data/bundle/ruby/3.1.0/gems/rexml-3.4.4/lib/rexml/parsers/xpathparser.rb +739 -0
- data/bundle/ruby/3.1.0/gems/rexml-3.4.4/lib/rexml/quickpath.rb +267 -0
- data/bundle/ruby/3.1.0/gems/rexml-3.4.4/lib/rexml/rexml.rb +39 -0
- data/bundle/ruby/3.1.0/gems/rexml-3.4.4/lib/rexml/security.rb +28 -0
- data/bundle/ruby/3.1.0/gems/rexml-3.4.4/lib/rexml/source.rb +388 -0
- data/bundle/ruby/3.1.0/gems/rexml-3.4.4/lib/rexml/text.rb +420 -0
- data/bundle/ruby/3.1.0/gems/rexml-3.4.4/lib/rexml/validation/relaxng.rb +540 -0
- data/bundle/ruby/3.1.0/gems/rexml-3.4.4/lib/rexml/validation/validation.rb +144 -0
- data/bundle/ruby/3.1.0/gems/rexml-3.4.4/lib/rexml/xpath.rb +70 -0
- data/bundle/ruby/3.1.0/gems/rexml-3.4.4/lib/rexml/xpath_parser.rb +980 -0
- data/bundle/ruby/3.1.0/gems/ruby2ruby-2.5.2/History.rdoc +463 -0
- data/bundle/ruby/3.1.0/gems/ruby2ruby-2.5.2/lib/ruby2ruby.rb +1448 -0
- data/bundle/ruby/3.1.0/gems/ruby_parser-3.20.3/History.rdoc +1345 -0
- data/bundle/ruby/3.1.0/gems/ruby_parser-3.20.3/Manifest.txt +48 -0
- data/bundle/ruby/3.1.0/gems/ruby_parser-3.20.3/README.rdoc +113 -0
- data/bundle/ruby/3.1.0/gems/ruby_parser-3.20.3/compare/normalize.rb +219 -0
- data/bundle/ruby/3.1.0/gems/ruby_parser-3.20.3/lib/ruby20_parser.rb +10956 -0
- data/bundle/ruby/3.1.0/gems/ruby_parser-3.20.3/lib/ruby20_parser.y +2707 -0
- data/bundle/ruby/3.1.0/gems/ruby_parser-3.20.3/lib/ruby21_parser.rb +10981 -0
- data/bundle/ruby/3.1.0/gems/ruby_parser-3.20.3/lib/ruby21_parser.y +2724 -0
- data/bundle/ruby/3.1.0/gems/ruby_parser-3.20.3/lib/ruby22_parser.rb +11122 -0
- data/bundle/ruby/3.1.0/gems/ruby_parser-3.20.3/lib/ruby22_parser.y +2735 -0
- data/bundle/ruby/3.1.0/gems/ruby_parser-3.20.3/lib/ruby23_parser.rb +11163 -0
- data/bundle/ruby/3.1.0/gems/ruby_parser-3.20.3/lib/ruby23_parser.y +2737 -0
- data/bundle/ruby/3.1.0/gems/ruby_parser-3.20.3/lib/ruby24_parser.rb +11212 -0
- data/bundle/ruby/3.1.0/gems/ruby_parser-3.20.3/lib/ruby24_parser.y +2745 -0
- data/bundle/ruby/3.1.0/gems/ruby_parser-3.20.3/lib/ruby25_parser.rb +11212 -0
- data/bundle/ruby/3.1.0/gems/ruby_parser-3.20.3/lib/ruby25_parser.y +2745 -0
- data/bundle/ruby/3.1.0/gems/ruby_parser-3.20.3/lib/ruby26_parser.rb +11234 -0
- data/bundle/ruby/3.1.0/gems/ruby_parser-3.20.3/lib/ruby26_parser.y +2760 -0
- data/bundle/ruby/3.1.0/gems/ruby_parser-3.20.3/lib/ruby27_parser.rb +12963 -0
- data/bundle/ruby/3.1.0/gems/ruby_parser-3.20.3/lib/ruby27_parser.y +3360 -0
- data/bundle/ruby/3.1.0/gems/ruby_parser-3.20.3/lib/ruby30_parser.rb +13316 -0
- data/bundle/ruby/3.1.0/gems/ruby_parser-3.20.3/lib/ruby30_parser.y +3508 -0
- data/bundle/ruby/3.1.0/gems/ruby_parser-3.20.3/lib/ruby31_parser.rb +13649 -0
- data/bundle/ruby/3.1.0/gems/ruby_parser-3.20.3/lib/ruby31_parser.y +3542 -0
- data/bundle/ruby/3.1.0/gems/ruby_parser-3.20.3/lib/ruby32_parser.rb +13601 -0
- data/bundle/ruby/3.1.0/gems/ruby_parser-3.20.3/lib/ruby32_parser.y +3543 -0
- data/bundle/ruby/3.1.0/gems/ruby_parser-3.20.3/lib/ruby3_parser.yy +3635 -0
- data/bundle/ruby/3.1.0/gems/ruby_parser-3.20.3/lib/ruby_lexer.rb +1159 -0
- data/bundle/ruby/3.1.0/gems/ruby_parser-3.20.3/lib/ruby_lexer.rex.rb +399 -0
- data/bundle/ruby/3.1.0/gems/ruby_parser-3.20.3/lib/ruby_lexer_strings.rb +638 -0
- data/bundle/ruby/3.1.0/gems/ruby_parser-3.20.3/lib/ruby_parser.rb +100 -0
- data/bundle/ruby/3.1.0/gems/ruby_parser-3.20.3/lib/ruby_parser.yy +3501 -0
- data/bundle/ruby/3.1.0/gems/ruby_parser-3.20.3/lib/ruby_parser_extras.rb +1878 -0
- data/bundle/ruby/3.1.0/gems/ruby_parser-3.20.3/tools/munge.rb +256 -0
- data/bundle/ruby/3.1.0/gems/ruby_parser-3.20.3/tools/ripper.rb +46 -0
- data/bundle/ruby/3.1.0/gems/sexp_processor-4.17.4/History.rdoc +493 -0
- data/bundle/ruby/3.1.0/gems/sexp_processor-4.17.4/lib/pt_testcase.rb +3137 -0
- data/bundle/ruby/3.1.0/gems/sexp_processor-4.17.4/lib/sexp.rb +397 -0
- data/bundle/ruby/3.1.0/gems/sexp_processor-4.17.4/lib/sexp_matcher.rb +1100 -0
- data/bundle/ruby/3.1.0/gems/sexp_processor-4.17.4/lib/sexp_processor.rb +754 -0
- data/bundle/ruby/3.1.0/gems/sexp_processor-4.17.4/lib/strict_sexp.rb +149 -0
- data/bundle/ruby/3.1.0/gems/slim-5.2.1/CHANGES +496 -0
- data/bundle/ruby/3.1.0/gems/slim-5.2.1/Gemfile +43 -0
- data/bundle/ruby/3.1.0/gems/slim-5.2.1/LICENSE +21 -0
- data/bundle/ruby/3.1.0/gems/slim-5.2.1/README.jp.md +1276 -0
- data/bundle/ruby/3.1.0/gems/slim-5.2.1/README.md +1313 -0
- data/bundle/ruby/3.1.0/gems/slim-5.2.1/lib/slim/code_attributes.rb +68 -0
- data/bundle/ruby/3.1.0/gems/slim-5.2.1/lib/slim/command.rb +122 -0
- data/bundle/ruby/3.1.0/gems/slim-5.2.1/lib/slim/controls.rb +61 -0
- data/bundle/ruby/3.1.0/gems/slim-5.2.1/lib/slim/do_inserter.rb +34 -0
- data/bundle/ruby/3.1.0/gems/slim-5.2.1/lib/slim/embedded.rb +248 -0
- data/bundle/ruby/3.1.0/gems/slim-5.2.1/lib/slim/end_inserter.rb +63 -0
- data/bundle/ruby/3.1.0/gems/slim-5.2.1/lib/slim/engine.rb +42 -0
- data/bundle/ruby/3.1.0/gems/slim-5.2.1/lib/slim/erb_converter.rb +15 -0
- data/bundle/ruby/3.1.0/gems/slim-5.2.1/lib/slim/filter.rb +31 -0
- data/bundle/ruby/3.1.0/gems/slim-5.2.1/lib/slim/grammar.rb +24 -0
- data/bundle/ruby/3.1.0/gems/slim-5.2.1/lib/slim/include.rb +58 -0
- data/bundle/ruby/3.1.0/gems/slim-5.2.1/lib/slim/interpolation.rb +36 -0
- data/bundle/ruby/3.1.0/gems/slim-5.2.1/lib/slim/logic_less/context.rb +126 -0
- data/bundle/ruby/3.1.0/gems/slim-5.2.1/lib/slim/logic_less/filter.rb +81 -0
- data/bundle/ruby/3.1.0/gems/slim-5.2.1/lib/slim/logic_less.rb +6 -0
- data/bundle/ruby/3.1.0/gems/slim-5.2.1/lib/slim/parser.rb +535 -0
- data/bundle/ruby/3.1.0/gems/slim-5.2.1/lib/slim/railtie.rb +19 -0
- data/bundle/ruby/3.1.0/gems/slim-5.2.1/lib/slim/smart/escaper.rb +42 -0
- data/bundle/ruby/3.1.0/gems/slim-5.2.1/lib/slim/smart/filter.rb +97 -0
- data/bundle/ruby/3.1.0/gems/slim-5.2.1/lib/slim/smart/parser.rb +35 -0
- data/bundle/ruby/3.1.0/gems/slim-5.2.1/lib/slim/smart.rb +9 -0
- data/bundle/ruby/3.1.0/gems/slim-5.2.1/lib/slim/splat/builder.rb +115 -0
- data/bundle/ruby/3.1.0/gems/slim-5.2.1/lib/slim/splat/filter.rb +93 -0
- data/bundle/ruby/3.1.0/gems/slim-5.2.1/lib/slim/template.rb +6 -0
- data/bundle/ruby/3.1.0/gems/slim-5.2.1/lib/slim/translator.rb +119 -0
- data/bundle/ruby/3.1.0/gems/slim-5.2.1/lib/slim/version.rb +6 -0
- data/bundle/ruby/3.1.0/gems/slim-5.2.1/lib/slim.rb +16 -0
- data/bundle/ruby/3.1.0/gems/slim-5.2.1/slim.gemspec +33 -0
- data/bundle/ruby/3.1.0/gems/temple-0.10.4/CHANGES +302 -0
- data/bundle/ruby/3.1.0/gems/temple-0.10.4/Gemfile +2 -0
- data/bundle/ruby/3.1.0/gems/temple-0.10.4/README.md +267 -0
- data/bundle/ruby/3.1.0/gems/temple-0.10.4/lib/temple/engine.rb +68 -0
- data/bundle/ruby/3.1.0/gems/temple-0.10.4/lib/temple/erb/engine.rb +18 -0
- data/bundle/ruby/3.1.0/gems/temple-0.10.4/lib/temple/erb/parser.rb +41 -0
- data/bundle/ruby/3.1.0/gems/temple-0.10.4/lib/temple/erb/template.rb +12 -0
- data/bundle/ruby/3.1.0/gems/temple-0.10.4/lib/temple/erb/trimming.rb +24 -0
- data/bundle/ruby/3.1.0/gems/temple-0.10.4/lib/temple/exceptions.rb +14 -0
- data/bundle/ruby/3.1.0/gems/temple-0.10.4/lib/temple/filter.rb +10 -0
- data/bundle/ruby/3.1.0/gems/temple-0.10.4/lib/temple/filters/ambles.rb +22 -0
- data/bundle/ruby/3.1.0/gems/temple-0.10.4/lib/temple/filters/code_merger.rb +31 -0
- data/bundle/ruby/3.1.0/gems/temple-0.10.4/lib/temple/filters/control_flow.rb +43 -0
- data/bundle/ruby/3.1.0/gems/temple-0.10.4/lib/temple/filters/dynamic_inliner.rb +72 -0
- data/bundle/ruby/3.1.0/gems/temple-0.10.4/lib/temple/filters/dynamic_merger.rb +69 -0
- data/bundle/ruby/3.1.0/gems/temple-0.10.4/lib/temple/filters/encoding.rb +25 -0
- data/bundle/ruby/3.1.0/gems/temple-0.10.4/lib/temple/filters/eraser.rb +23 -0
- data/bundle/ruby/3.1.0/gems/temple-0.10.4/lib/temple/filters/escapable.rb +41 -0
- data/bundle/ruby/3.1.0/gems/temple-0.10.4/lib/temple/filters/multi_flattener.rb +26 -0
- data/bundle/ruby/3.1.0/gems/temple-0.10.4/lib/temple/filters/remove_bom.rb +14 -0
- data/bundle/ruby/3.1.0/gems/temple-0.10.4/lib/temple/filters/static_analyzer.rb +31 -0
- data/bundle/ruby/3.1.0/gems/temple-0.10.4/lib/temple/filters/static_merger.rb +38 -0
- data/bundle/ruby/3.1.0/gems/temple-0.10.4/lib/temple/filters/string_splitter.rb +142 -0
- data/bundle/ruby/3.1.0/gems/temple-0.10.4/lib/temple/filters/validator.rb +16 -0
- data/bundle/ruby/3.1.0/gems/temple-0.10.4/lib/temple/generator.rb +91 -0
- data/bundle/ruby/3.1.0/gems/temple-0.10.4/lib/temple/generators/array.rb +22 -0
- data/bundle/ruby/3.1.0/gems/temple-0.10.4/lib/temple/generators/array_buffer.rb +30 -0
- data/bundle/ruby/3.1.0/gems/temple-0.10.4/lib/temple/generators/erb.rb +33 -0
- data/bundle/ruby/3.1.0/gems/temple-0.10.4/lib/temple/generators/rails_output_buffer.rb +35 -0
- data/bundle/ruby/3.1.0/gems/temple-0.10.4/lib/temple/generators/string_buffer.rb +26 -0
- data/bundle/ruby/3.1.0/gems/temple-0.10.4/lib/temple/grammar.rb +58 -0
- data/bundle/ruby/3.1.0/gems/temple-0.10.4/lib/temple/html/attribute_merger.rb +43 -0
- data/bundle/ruby/3.1.0/gems/temple-0.10.4/lib/temple/html/attribute_remover.rb +36 -0
- data/bundle/ruby/3.1.0/gems/temple-0.10.4/lib/temple/html/attribute_sorter.rb +22 -0
- data/bundle/ruby/3.1.0/gems/temple-0.10.4/lib/temple/html/dispatcher.rb +32 -0
- data/bundle/ruby/3.1.0/gems/temple-0.10.4/lib/temple/html/fast.rb +131 -0
- data/bundle/ruby/3.1.0/gems/temple-0.10.4/lib/temple/html/filter.rb +22 -0
- data/bundle/ruby/3.1.0/gems/temple-0.10.4/lib/temple/html/pretty.rb +104 -0
- data/bundle/ruby/3.1.0/gems/temple-0.10.4/lib/temple/html/safe.rb +24 -0
- data/bundle/ruby/3.1.0/gems/temple-0.10.4/lib/temple/map.rb +106 -0
- data/bundle/ruby/3.1.0/gems/temple-0.10.4/lib/temple/mixins/dispatcher.rb +162 -0
- data/bundle/ruby/3.1.0/gems/temple-0.10.4/lib/temple/mixins/engine_dsl.rb +146 -0
- data/bundle/ruby/3.1.0/gems/temple-0.10.4/lib/temple/mixins/grammar_dsl.rb +172 -0
- data/bundle/ruby/3.1.0/gems/temple-0.10.4/lib/temple/mixins/options.rb +88 -0
- data/bundle/ruby/3.1.0/gems/temple-0.10.4/lib/temple/mixins/template.rb +29 -0
- data/bundle/ruby/3.1.0/gems/temple-0.10.4/lib/temple/parser.rb +9 -0
- data/bundle/ruby/3.1.0/gems/temple-0.10.4/lib/temple/static_analyzer.rb +78 -0
- data/bundle/ruby/3.1.0/gems/temple-0.10.4/lib/temple/templates/rails.rb +31 -0
- data/bundle/ruby/3.1.0/gems/temple-0.10.4/lib/temple/templates/tilt.rb +39 -0
- data/bundle/ruby/3.1.0/gems/temple-0.10.4/lib/temple/templates.rb +12 -0
- data/bundle/ruby/3.1.0/gems/temple-0.10.4/lib/temple/utils.rb +91 -0
- data/bundle/ruby/3.1.0/gems/temple-0.10.4/lib/temple/version.rb +4 -0
- data/bundle/ruby/3.1.0/gems/temple-0.10.4/lib/temple.rb +70 -0
- data/bundle/ruby/3.1.0/gems/temple-0.10.4/temple.gemspec +27 -0
- data/bundle/ruby/3.1.0/gems/terminal-table-4.0.0/History.rdoc +149 -0
- data/bundle/ruby/3.1.0/gems/terminal-table-4.0.0/README.md +417 -0
- data/bundle/ruby/3.1.0/gems/terminal-table-4.0.0/lib/terminal-table/cell.rb +94 -0
- data/bundle/ruby/3.1.0/gems/terminal-table-4.0.0/lib/terminal-table/row.rb +66 -0
- data/bundle/ruby/3.1.0/gems/terminal-table-4.0.0/lib/terminal-table/separator.rb +66 -0
- data/bundle/ruby/3.1.0/gems/terminal-table-4.0.0/lib/terminal-table/style.rb +284 -0
- data/bundle/ruby/3.1.0/gems/terminal-table-4.0.0/lib/terminal-table/table.rb +374 -0
- data/bundle/ruby/3.1.0/gems/terminal-table-4.0.0/lib/terminal-table/util.rb +13 -0
- data/bundle/ruby/3.1.0/gems/terminal-table-4.0.0/lib/terminal-table/version.rb +5 -0
- data/bundle/ruby/3.1.0/gems/terminal-table-4.0.0/lib/terminal-table.rb +26 -0
- data/bundle/ruby/3.1.0/gems/terminal-table-4.0.0/terminal-table.gemspec +25 -0
- data/bundle/ruby/3.1.0/gems/tilt-2.6.1/COPYING +19 -0
- data/bundle/ruby/3.1.0/gems/tilt-2.6.1/lib/tilt/_emacs_org.rb +2 -0
- data/bundle/ruby/3.1.0/gems/tilt-2.6.1/lib/tilt/_handlebars.rb +2 -0
- data/bundle/ruby/3.1.0/gems/tilt-2.6.1/lib/tilt/_jbuilder.rb +2 -0
- data/bundle/ruby/3.1.0/gems/tilt-2.6.1/lib/tilt/_org.rb +2 -0
- data/bundle/ruby/3.1.0/gems/tilt-2.6.1/lib/tilt/asciidoc.rb +15 -0
- data/bundle/ruby/3.1.0/gems/tilt-2.6.1/lib/tilt/babel.rb +8 -0
- data/bundle/ruby/3.1.0/gems/tilt-2.6.1/lib/tilt/builder.rb +42 -0
- data/bundle/ruby/3.1.0/gems/tilt-2.6.1/lib/tilt/cli.rb +134 -0
- data/bundle/ruby/3.1.0/gems/tilt-2.6.1/lib/tilt/coffee.rb +39 -0
- data/bundle/ruby/3.1.0/gems/tilt-2.6.1/lib/tilt/commonmarker.rb +95 -0
- data/bundle/ruby/3.1.0/gems/tilt-2.6.1/lib/tilt/creole.rb +16 -0
- data/bundle/ruby/3.1.0/gems/tilt-2.6.1/lib/tilt/csv.rb +53 -0
- data/bundle/ruby/3.1.0/gems/tilt-2.6.1/lib/tilt/erb.rb +65 -0
- data/bundle/ruby/3.1.0/gems/tilt-2.6.1/lib/tilt/erubi.rb +55 -0
- data/bundle/ruby/3.1.0/gems/tilt-2.6.1/lib/tilt/etanni.rb +28 -0
- data/bundle/ruby/3.1.0/gems/tilt-2.6.1/lib/tilt/haml.rb +94 -0
- data/bundle/ruby/3.1.0/gems/tilt-2.6.1/lib/tilt/kramdown.rb +13 -0
- data/bundle/ruby/3.1.0/gems/tilt-2.6.1/lib/tilt/liquid.rb +37 -0
- data/bundle/ruby/3.1.0/gems/tilt-2.6.1/lib/tilt/livescript.rb +11 -0
- data/bundle/ruby/3.1.0/gems/tilt-2.6.1/lib/tilt/mapping.rb +412 -0
- data/bundle/ruby/3.1.0/gems/tilt-2.6.1/lib/tilt/markaby.rb +43 -0
- data/bundle/ruby/3.1.0/gems/tilt-2.6.1/lib/tilt/nokogiri.rb +37 -0
- data/bundle/ruby/3.1.0/gems/tilt-2.6.1/lib/tilt/pandoc.rb +39 -0
- data/bundle/ruby/3.1.0/gems/tilt-2.6.1/lib/tilt/pipeline.rb +19 -0
- data/bundle/ruby/3.1.0/gems/tilt-2.6.1/lib/tilt/plain.rb +5 -0
- data/bundle/ruby/3.1.0/gems/tilt-2.6.1/lib/tilt/prawn.rb +28 -0
- data/bundle/ruby/3.1.0/gems/tilt-2.6.1/lib/tilt/radius.rb +41 -0
- data/bundle/ruby/3.1.0/gems/tilt-2.6.1/lib/tilt/rdiscount.rb +23 -0
- data/bundle/ruby/3.1.0/gems/tilt-2.6.1/lib/tilt/rdoc.rb +11 -0
- data/bundle/ruby/3.1.0/gems/tilt-2.6.1/lib/tilt/redcarpet.rb +31 -0
- data/bundle/ruby/3.1.0/gems/tilt-2.6.1/lib/tilt/redcloth.rb +13 -0
- data/bundle/ruby/3.1.0/gems/tilt-2.6.1/lib/tilt/rst-pandoc.rb +10 -0
- data/bundle/ruby/3.1.0/gems/tilt-2.6.1/lib/tilt/sass.rb +78 -0
- data/bundle/ruby/3.1.0/gems/tilt-2.6.1/lib/tilt/slim.rb +5 -0
- data/bundle/ruby/3.1.0/gems/tilt-2.6.1/lib/tilt/string.rb +27 -0
- data/bundle/ruby/3.1.0/gems/tilt-2.6.1/lib/tilt/template.rb +611 -0
- data/bundle/ruby/3.1.0/gems/tilt-2.6.1/lib/tilt/typescript.rb +19 -0
- data/bundle/ruby/3.1.0/gems/tilt-2.6.1/lib/tilt/yajl.rb +81 -0
- data/bundle/ruby/3.1.0/gems/tilt-2.6.1/lib/tilt.rb +192 -0
- data/bundle/ruby/3.1.0/gems/unicode-display_width-3.2.0/CHANGELOG.md +299 -0
- data/bundle/ruby/3.1.0/gems/unicode-display_width-3.2.0/MIT-LICENSE.txt +22 -0
- data/bundle/ruby/3.1.0/gems/unicode-display_width-3.2.0/README.md +194 -0
- data/bundle/ruby/3.1.0/gems/unicode-display_width-3.2.0/data/display_width.marshal.gz +0 -0
- data/bundle/ruby/3.1.0/gems/unicode-display_width-3.2.0/lib/unicode/display_width/constants.rb +10 -0
- data/bundle/ruby/3.1.0/gems/unicode-display_width-3.2.0/lib/unicode/display_width/emoji_support.rb +55 -0
- data/bundle/ruby/3.1.0/gems/unicode-display_width-3.2.0/lib/unicode/display_width/index.rb +34 -0
- data/bundle/ruby/3.1.0/gems/unicode-display_width-3.2.0/lib/unicode/display_width/no_string_ext.rb +8 -0
- data/bundle/ruby/3.1.0/gems/unicode-display_width-3.2.0/lib/unicode/display_width/reline_ext.rb +14 -0
- data/bundle/ruby/3.1.0/gems/unicode-display_width-3.2.0/lib/unicode/display_width/string_ext.rb +9 -0
- data/bundle/ruby/3.1.0/gems/unicode-display_width-3.2.0/lib/unicode/display_width.rb +247 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.1.0/CHANGELOG.md +196 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.1.0/CODE_OF_CONDUCT.md +74 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.1.0/Gemfile +7 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.1.0/Gemfile.lock +33 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.1.0/MIT-LICENSE.txt +20 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.1.0/README.md +205 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.1.0/data/emoji.marshal.gz +0 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.1.0/data/generate_constants.rb +344 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.1.0/lib/unicode/emoji/constants.rb +49 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.1.0/lib/unicode/emoji/generated/regex.rb +8 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.1.0/lib/unicode/emoji/generated/regex_basic.rb +8 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.1.0/lib/unicode/emoji/generated/regex_emoji_keycap.rb +8 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.1.0/lib/unicode/emoji/generated/regex_include_mqe.rb +8 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.1.0/lib/unicode/emoji/generated/regex_include_mqe_uqe.rb +8 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.1.0/lib/unicode/emoji/generated/regex_include_text.rb +8 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.1.0/lib/unicode/emoji/generated/regex_picto.rb +8 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.1.0/lib/unicode/emoji/generated/regex_picto_no_emoji.rb +8 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.1.0/lib/unicode/emoji/generated/regex_possible.rb +8 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.1.0/lib/unicode/emoji/generated/regex_prop_component.rb +8 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.1.0/lib/unicode/emoji/generated/regex_prop_emoji.rb +8 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.1.0/lib/unicode/emoji/generated/regex_prop_modifier.rb +8 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.1.0/lib/unicode/emoji/generated/regex_prop_modifier_base.rb +8 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.1.0/lib/unicode/emoji/generated/regex_prop_presentation.rb +8 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.1.0/lib/unicode/emoji/generated/regex_text.rb +8 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.1.0/lib/unicode/emoji/generated/regex_text_presentation.rb +8 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.1.0/lib/unicode/emoji/generated/regex_valid.rb +8 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.1.0/lib/unicode/emoji/generated/regex_valid_include_text.rb +8 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.1.0/lib/unicode/emoji/generated/regex_well_formed.rb +8 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.1.0/lib/unicode/emoji/generated/regex_well_formed_include_text.rb +8 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.1.0/lib/unicode/emoji/generated_native/regex.rb +8 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.1.0/lib/unicode/emoji/generated_native/regex_basic.rb +8 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.1.0/lib/unicode/emoji/generated_native/regex_emoji_keycap.rb +8 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.1.0/lib/unicode/emoji/generated_native/regex_include_mqe.rb +8 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.1.0/lib/unicode/emoji/generated_native/regex_include_mqe_uqe.rb +8 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.1.0/lib/unicode/emoji/generated_native/regex_include_text.rb +8 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.1.0/lib/unicode/emoji/generated_native/regex_picto.rb +8 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.1.0/lib/unicode/emoji/generated_native/regex_picto_no_emoji.rb +8 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.1.0/lib/unicode/emoji/generated_native/regex_possible.rb +8 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.1.0/lib/unicode/emoji/generated_native/regex_prop_component.rb +8 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.1.0/lib/unicode/emoji/generated_native/regex_prop_emoji.rb +8 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.1.0/lib/unicode/emoji/generated_native/regex_prop_modifier.rb +8 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.1.0/lib/unicode/emoji/generated_native/regex_prop_modifier_base.rb +8 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.1.0/lib/unicode/emoji/generated_native/regex_prop_presentation.rb +8 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.1.0/lib/unicode/emoji/generated_native/regex_text.rb +8 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.1.0/lib/unicode/emoji/generated_native/regex_text_presentation.rb +8 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.1.0/lib/unicode/emoji/generated_native/regex_valid.rb +8 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.1.0/lib/unicode/emoji/generated_native/regex_valid_include_text.rb +8 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.1.0/lib/unicode/emoji/generated_native/regex_well_formed.rb +8 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.1.0/lib/unicode/emoji/generated_native/regex_well_formed_include_text.rb +8 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.1.0/lib/unicode/emoji/index.rb +14 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.1.0/lib/unicode/emoji/lazy_constants.rb +56 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.1.0/lib/unicode/emoji/list.rb +13 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.1.0/lib/unicode/emoji.rb +111 -0
- data/bundle/ruby/3.1.0/gems/unicode-emoji-4.1.0/unicode-emoji.gemspec +22 -0
- data/lib/brakeman/app_tree.rb +98 -19
- data/lib/brakeman/checks/base_check.rb +7 -5
- data/lib/brakeman/checks/check_basic_auth.rb +4 -2
- data/lib/brakeman/checks/check_basic_auth_timing_attack.rb +2 -1
- data/lib/brakeman/checks/check_content_tag.rb +16 -9
- data/lib/brakeman/checks/check_cookie_serialization.rb +2 -1
- data/lib/brakeman/checks/check_create_with.rb +4 -2
- data/lib/brakeman/checks/check_cross_site_scripting.rb +6 -3
- data/lib/brakeman/checks/check_csrf_token_forgery_cve.rb +2 -1
- data/lib/brakeman/checks/check_default_routes.rb +6 -3
- data/lib/brakeman/checks/check_deserialize.rb +6 -2
- data/lib/brakeman/checks/check_detailed_exceptions.rb +4 -2
- data/lib/brakeman/checks/check_digest_dos.rb +2 -1
- data/lib/brakeman/checks/check_divide_by_zero.rb +2 -1
- data/lib/brakeman/checks/check_dynamic_finders.rb +2 -1
- data/lib/brakeman/checks/check_eol_rails.rb +7 -0
- data/lib/brakeman/checks/check_eol_ruby.rb +5 -1
- data/lib/brakeman/checks/check_escape_function.rb +2 -1
- data/lib/brakeman/checks/check_evaluation.rb +45 -7
- data/lib/brakeman/checks/check_execute.rb +34 -3
- data/lib/brakeman/checks/check_file_access.rb +2 -1
- data/lib/brakeman/checks/check_file_disclosure.rb +2 -1
- data/lib/brakeman/checks/check_filter_skipping.rb +2 -1
- data/lib/brakeman/checks/check_force_ssl.rb +2 -1
- data/lib/brakeman/checks/check_forgery_setting.rb +4 -2
- data/lib/brakeman/checks/check_header_dos.rb +2 -1
- data/lib/brakeman/checks/check_i18n_xss.rb +2 -1
- data/lib/brakeman/checks/check_jruby_xml.rb +2 -1
- data/lib/brakeman/checks/check_json_encoding.rb +2 -1
- data/lib/brakeman/checks/check_json_entity_escape.rb +4 -2
- data/lib/brakeman/checks/check_json_parsing.rb +4 -2
- data/lib/brakeman/checks/check_link_to.rb +2 -1
- data/lib/brakeman/checks/check_link_to_href.rb +4 -2
- data/lib/brakeman/checks/check_mail_to.rb +2 -1
- data/lib/brakeman/checks/check_mass_assignment.rb +6 -3
- data/lib/brakeman/checks/check_mime_type_dos.rb +2 -1
- data/lib/brakeman/checks/check_model_attr_accessible.rb +3 -1
- data/lib/brakeman/checks/check_model_attributes.rb +4 -2
- data/lib/brakeman/checks/check_model_serialize.rb +2 -1
- data/lib/brakeman/checks/check_nested_attributes.rb +2 -1
- data/lib/brakeman/checks/check_nested_attributes_bypass.rb +2 -1
- data/lib/brakeman/checks/check_number_to_currency.rb +4 -2
- data/lib/brakeman/checks/check_page_caching_cve.rb +2 -1
- data/lib/brakeman/checks/check_pathname.rb +48 -0
- data/lib/brakeman/checks/check_permit_attributes.rb +2 -1
- data/lib/brakeman/checks/check_quote_table_name.rb +2 -1
- data/lib/brakeman/checks/check_ransack.rb +53 -0
- data/lib/brakeman/checks/check_redirect.rb +67 -31
- data/lib/brakeman/checks/check_regex_dos.rb +2 -1
- data/lib/brakeman/checks/check_render.rb +15 -3
- data/lib/brakeman/checks/check_render_dos.rb +2 -1
- data/lib/brakeman/checks/check_render_inline.rb +4 -2
- data/lib/brakeman/checks/check_response_splitting.rb +2 -1
- data/lib/brakeman/checks/check_reverse_tabnabbing.rb +2 -1
- data/lib/brakeman/checks/check_route_dos.rb +2 -1
- data/lib/brakeman/checks/check_safe_buffer_manipulation.rb +2 -1
- data/lib/brakeman/checks/check_sanitize_config_cve.rb +120 -0
- data/lib/brakeman/checks/check_sanitize_methods.rb +6 -3
- data/lib/brakeman/checks/check_secrets.rb +2 -1
- data/lib/brakeman/checks/check_select_tag.rb +2 -1
- data/lib/brakeman/checks/check_select_vulnerability.rb +2 -1
- data/lib/brakeman/checks/check_send.rb +2 -1
- data/lib/brakeman/checks/check_session_manipulation.rb +2 -1
- data/lib/brakeman/checks/check_session_settings.rb +8 -6
- data/lib/brakeman/checks/check_simple_format.rb +4 -2
- data/lib/brakeman/checks/check_single_quotes.rb +2 -1
- data/lib/brakeman/checks/check_skip_before_filter.rb +4 -2
- data/lib/brakeman/checks/check_sprockets_path_traversal.rb +2 -1
- data/lib/brakeman/checks/check_sql.rb +14 -5
- data/lib/brakeman/checks/check_sql_cves.rb +4 -2
- data/lib/brakeman/checks/check_ssl_verify.rb +2 -1
- data/lib/brakeman/checks/check_strip_tags.rb +6 -3
- data/lib/brakeman/checks/check_symbol_dos.rb +2 -1
- data/lib/brakeman/checks/check_symbol_dos_cve.rb +2 -1
- data/lib/brakeman/checks/check_template_injection.rb +2 -1
- data/lib/brakeman/checks/check_translate_bug.rb +2 -1
- data/lib/brakeman/checks/check_unsafe_reflection.rb +2 -1
- data/lib/brakeman/checks/check_unsafe_reflection_methods.rb +2 -1
- data/lib/brakeman/checks/check_unscoped_find.rb +10 -1
- data/lib/brakeman/checks/check_validation_regex.rb +2 -1
- data/lib/brakeman/checks/check_verb_confusion.rb +2 -1
- data/lib/brakeman/checks/check_weak_hash.rb +6 -3
- data/lib/brakeman/checks/check_weak_rsa_key.rb +112 -0
- data/lib/brakeman/checks/check_without_protection.rb +2 -1
- data/lib/brakeman/checks/check_xml_dos.rb +2 -1
- data/lib/brakeman/checks/check_yaml_parsing.rb +4 -2
- data/lib/brakeman/checks/eol_check.rb +4 -2
- data/lib/brakeman/commandline.rb +5 -0
- data/lib/brakeman/file_parser.rb +35 -2
- data/lib/brakeman/file_path.rb +4 -0
- data/lib/brakeman/messages.rb +1 -1
- data/lib/brakeman/options.rb +50 -5
- data/lib/brakeman/parsers/erubis_patch.rb +11 -0
- data/lib/brakeman/parsers/haml6_embedded.rb +23 -0
- data/lib/brakeman/parsers/rails2_erubis.rb +3 -0
- data/lib/brakeman/parsers/rails2_xss_plugin_erubis.rb +4 -0
- data/lib/brakeman/parsers/rails3_erubis.rb +5 -1
- data/lib/brakeman/parsers/slim_embedded.rb +2 -0
- data/lib/brakeman/parsers/template_parser.rb +32 -7
- data/lib/brakeman/processor.rb +2 -0
- data/lib/brakeman/processors/alias_processor.rb +160 -44
- data/lib/brakeman/processors/base_processor.rb +2 -0
- data/lib/brakeman/processors/gem_processor.rb +2 -2
- data/lib/brakeman/processors/haml6_template_processor.rb +92 -0
- data/lib/brakeman/processors/haml_template_processor.rb +8 -2
- data/lib/brakeman/processors/lib/file_type_detector.rb +9 -7
- data/lib/brakeman/processors/lib/find_all_calls.rb +1 -0
- data/lib/brakeman/processors/lib/module_helper.rb +31 -1
- data/lib/brakeman/processors/lib/rails3_config_processor.rb +1 -1
- data/lib/brakeman/processors/lib/render_helper.rb +38 -1
- data/lib/brakeman/processors/library_processor.rb +6 -0
- data/lib/brakeman/processors/template_processor.rb +1 -1
- data/lib/brakeman/report/ignore/config.rb +0 -1
- data/lib/brakeman/report/ignore/interactive.rb +2 -2
- data/lib/brakeman/report/pager.rb +2 -2
- data/lib/brakeman/report/report_codeclimate.rb +1 -1
- data/lib/brakeman/report/report_csv.rb +2 -0
- data/lib/brakeman/report/report_github.rb +1 -1
- data/lib/brakeman/report/report_html.rb +1 -1
- data/lib/brakeman/report/report_junit.rb +6 -59
- data/lib/brakeman/report/report_markdown.rb +1 -1
- data/lib/brakeman/report/report_sarif.rb +122 -2
- data/lib/brakeman/report/report_table.rb +7 -7
- data/lib/brakeman/report/report_tabs.rb +0 -1
- data/lib/brakeman/report/report_text.rb +10 -1
- data/lib/brakeman/report/templates/controller_warnings.html.erb +2 -0
- data/lib/brakeman/report/templates/header.html.erb +8 -3
- data/lib/brakeman/report/templates/ignored_warnings.html.erb +5 -3
- data/lib/brakeman/report/templates/model_warnings.html.erb +2 -0
- data/lib/brakeman/report/templates/security_warnings.html.erb +2 -0
- data/lib/brakeman/report/templates/view_warnings.html.erb +2 -0
- data/lib/brakeman/rescanner.rb +40 -388
- data/lib/brakeman/scanner.rb +182 -88
- data/lib/brakeman/tracker/config.rb +89 -34
- data/lib/brakeman/tracker/controller.rb +14 -10
- data/lib/brakeman/tracker/file_cache.rb +83 -0
- data/lib/brakeman/tracker.rb +27 -4
- data/lib/brakeman/util.rb +21 -7
- data/lib/brakeman/version.rb +1 -1
- data/lib/brakeman/warning.rb +6 -3
- data/lib/brakeman/warning_codes.rb +6 -0
- data/lib/brakeman.rb +33 -7
- data/lib/ruby_parser/bm_sexp.rb +5 -1
- metadata +515 -422
- data/bundle/ruby/2.7.0/gems/haml-5.2.2/CHANGELOG.md +0 -1505
- data/bundle/ruby/2.7.0/gems/haml-5.2.2/FAQ.md +0 -147
- data/bundle/ruby/2.7.0/gems/haml-5.2.2/Gemfile +0 -16
- data/bundle/ruby/2.7.0/gems/haml-5.2.2/MIT-LICENSE +0 -20
- data/bundle/ruby/2.7.0/gems/haml-5.2.2/README.md +0 -216
- data/bundle/ruby/2.7.0/gems/haml-5.2.2/REFERENCE.md +0 -1380
- data/bundle/ruby/2.7.0/gems/haml-5.2.2/TODO +0 -24
- data/bundle/ruby/2.7.0/gems/haml-5.2.2/haml.gemspec +0 -45
- data/bundle/ruby/2.7.0/gems/haml-5.2.2/lib/haml/attribute_builder.rb +0 -219
- data/bundle/ruby/2.7.0/gems/haml-5.2.2/lib/haml/attribute_compiler.rb +0 -237
- data/bundle/ruby/2.7.0/gems/haml-5.2.2/lib/haml/attribute_parser.rb +0 -150
- data/bundle/ruby/2.7.0/gems/haml-5.2.2/lib/haml/buffer.rb +0 -182
- data/bundle/ruby/2.7.0/gems/haml-5.2.2/lib/haml/compiler.rb +0 -330
- data/bundle/ruby/2.7.0/gems/haml-5.2.2/lib/haml/engine.rb +0 -238
- data/bundle/ruby/2.7.0/gems/haml-5.2.2/lib/haml/error.rb +0 -65
- data/bundle/ruby/2.7.0/gems/haml-5.2.2/lib/haml/escapable.rb +0 -77
- data/bundle/ruby/2.7.0/gems/haml-5.2.2/lib/haml/exec.rb +0 -347
- data/bundle/ruby/2.7.0/gems/haml-5.2.2/lib/haml/filters.rb +0 -399
- data/bundle/ruby/2.7.0/gems/haml-5.2.2/lib/haml/generator.rb +0 -42
- data/bundle/ruby/2.7.0/gems/haml-5.2.2/lib/haml/helpers/action_view_extensions.rb +0 -60
- data/bundle/ruby/2.7.0/gems/haml-5.2.2/lib/haml/helpers/action_view_mods.rb +0 -132
- data/bundle/ruby/2.7.0/gems/haml-5.2.2/lib/haml/helpers/action_view_xss_mods.rb +0 -60
- data/bundle/ruby/2.7.0/gems/haml-5.2.2/lib/haml/helpers/safe_erubi_template.rb +0 -20
- data/bundle/ruby/2.7.0/gems/haml-5.2.2/lib/haml/helpers/safe_erubis_template.rb +0 -33
- data/bundle/ruby/2.7.0/gems/haml-5.2.2/lib/haml/helpers/xss_mods.rb +0 -114
- data/bundle/ruby/2.7.0/gems/haml-5.2.2/lib/haml/helpers.rb +0 -709
- data/bundle/ruby/2.7.0/gems/haml-5.2.2/lib/haml/options.rb +0 -273
- data/bundle/ruby/2.7.0/gems/haml-5.2.2/lib/haml/parser.rb +0 -856
- data/bundle/ruby/2.7.0/gems/haml-5.2.2/lib/haml/plugin.rb +0 -54
- data/bundle/ruby/2.7.0/gems/haml-5.2.2/lib/haml/railtie.rb +0 -53
- data/bundle/ruby/2.7.0/gems/haml-5.2.2/lib/haml/sass_rails_filter.rb +0 -47
- data/bundle/ruby/2.7.0/gems/haml-5.2.2/lib/haml/template/options.rb +0 -27
- data/bundle/ruby/2.7.0/gems/haml-5.2.2/lib/haml/template.rb +0 -39
- data/bundle/ruby/2.7.0/gems/haml-5.2.2/lib/haml/temple_engine.rb +0 -124
- data/bundle/ruby/2.7.0/gems/haml-5.2.2/lib/haml/temple_line_counter.rb +0 -30
- data/bundle/ruby/2.7.0/gems/haml-5.2.2/lib/haml/util.rb +0 -258
- data/bundle/ruby/2.7.0/gems/haml-5.2.2/lib/haml/version.rb +0 -5
- data/bundle/ruby/2.7.0/gems/haml-5.2.2/lib/haml.rb +0 -25
- data/bundle/ruby/2.7.0/gems/haml-5.2.2/yard/default/fulldoc/html/css/common.sass +0 -15
- data/bundle/ruby/2.7.0/gems/haml-5.2.2/yard/default/layout/html/footer.erb +0 -12
- data/bundle/ruby/2.7.0/gems/highline-2.0.3/Changelog.md +0 -620
- data/bundle/ruby/2.7.0/gems/highline-2.0.3/Gemfile +0 -22
- data/bundle/ruby/2.7.0/gems/highline-2.0.3/README.md +0 -202
- data/bundle/ruby/2.7.0/gems/highline-2.0.3/appveyor.yml +0 -37
- data/bundle/ruby/2.7.0/gems/highline-2.0.3/highline.gemspec +0 -35
- data/bundle/ruby/2.7.0/gems/highline-2.0.3/lib/highline/io_console_compatible.rb +0 -37
- data/bundle/ruby/2.7.0/gems/highline-2.0.3/lib/highline/list_renderer.rb +0 -261
- data/bundle/ruby/2.7.0/gems/highline-2.0.3/lib/highline/menu.rb +0 -576
- data/bundle/ruby/2.7.0/gems/highline-2.0.3/lib/highline/question/answer_converter.rb +0 -103
- data/bundle/ruby/2.7.0/gems/highline-2.0.3/lib/highline/question.rb +0 -630
- data/bundle/ruby/2.7.0/gems/highline-2.0.3/lib/highline/question_asker.rb +0 -150
- data/bundle/ruby/2.7.0/gems/highline-2.0.3/lib/highline/terminal/io_console.rb +0 -36
- data/bundle/ruby/2.7.0/gems/highline-2.0.3/lib/highline/terminal/unix_stty.rb +0 -51
- data/bundle/ruby/2.7.0/gems/highline-2.0.3/lib/highline/terminal.rb +0 -190
- data/bundle/ruby/2.7.0/gems/highline-2.0.3/lib/highline/version.rb +0 -6
- data/bundle/ruby/2.7.0/gems/highline-2.0.3/lib/highline.rb +0 -650
- data/bundle/ruby/2.7.0/gems/parallel-1.22.1/lib/parallel/processor_count.rb +0 -44
- data/bundle/ruby/2.7.0/gems/parallel-1.22.1/lib/parallel/version.rb +0 -4
- data/bundle/ruby/2.7.0/gems/parallel-1.22.1/lib/parallel.rb +0 -612
- data/bundle/ruby/2.7.0/gems/rexml-3.2.5/NEWS.md +0 -178
- data/bundle/ruby/2.7.0/gems/rexml-3.2.5/README.md +0 -48
- data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/attribute.rb +0 -205
- data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/cdata.rb +0 -68
- data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/child.rb +0 -97
- data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/comment.rb +0 -80
- data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/doctype.rb +0 -311
- data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/document.rb +0 -451
- data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/element.rb +0 -2599
- data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/encoding.rb +0 -51
- data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/entity.rb +0 -171
- data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/formatters/pretty.rb +0 -142
- data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/functions.rb +0 -447
- data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/instruction.rb +0 -79
- data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/namespace.rb +0 -59
- data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/node.rb +0 -76
- data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/parseexception.rb +0 -52
- data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb +0 -694
- data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/parsers/pullparser.rb +0 -197
- data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/parsers/sax2parser.rb +0 -273
- data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/parsers/streamparser.rb +0 -61
- data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/parsers/treeparser.rb +0 -101
- data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/parsers/xpathparser.rb +0 -689
- data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/quickpath.rb +0 -266
- data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/rexml.rb +0 -37
- data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/security.rb +0 -28
- data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/source.rb +0 -298
- data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/text.rb +0 -424
- data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/validation/relaxng.rb +0 -539
- data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/validation/validation.rb +0 -144
- data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/xpath.rb +0 -81
- data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/xpath_parser.rb +0 -974
- data/bundle/ruby/2.7.0/gems/ruby2ruby-2.4.4/History.rdoc +0 -435
- data/bundle/ruby/2.7.0/gems/ruby2ruby-2.4.4/lib/ruby2ruby.rb +0 -1309
- data/bundle/ruby/2.7.0/gems/ruby_parser-3.19.1/History.rdoc +0 -1297
- data/bundle/ruby/2.7.0/gems/ruby_parser-3.19.1/Manifest.txt +0 -46
- data/bundle/ruby/2.7.0/gems/ruby_parser-3.19.1/README.rdoc +0 -112
- data/bundle/ruby/2.7.0/gems/ruby_parser-3.19.1/compare/normalize.rb +0 -218
- data/bundle/ruby/2.7.0/gems/ruby_parser-3.19.1/lib/ruby20_parser.rb +0 -10973
- data/bundle/ruby/2.7.0/gems/ruby_parser-3.19.1/lib/ruby20_parser.y +0 -2683
- data/bundle/ruby/2.7.0/gems/ruby_parser-3.19.1/lib/ruby21_parser.rb +0 -10980
- data/bundle/ruby/2.7.0/gems/ruby_parser-3.19.1/lib/ruby21_parser.y +0 -2700
- data/bundle/ruby/2.7.0/gems/ruby_parser-3.19.1/lib/ruby22_parser.rb +0 -11123
- data/bundle/ruby/2.7.0/gems/ruby_parser-3.19.1/lib/ruby22_parser.y +0 -2711
- data/bundle/ruby/2.7.0/gems/ruby_parser-3.19.1/lib/ruby23_parser.rb +0 -11132
- data/bundle/ruby/2.7.0/gems/ruby_parser-3.19.1/lib/ruby23_parser.y +0 -2713
- data/bundle/ruby/2.7.0/gems/ruby_parser-3.19.1/lib/ruby24_parser.rb +0 -11231
- data/bundle/ruby/2.7.0/gems/ruby_parser-3.19.1/lib/ruby24_parser.y +0 -2721
- data/bundle/ruby/2.7.0/gems/ruby_parser-3.19.1/lib/ruby25_parser.rb +0 -11231
- data/bundle/ruby/2.7.0/gems/ruby_parser-3.19.1/lib/ruby25_parser.y +0 -2721
- data/bundle/ruby/2.7.0/gems/ruby_parser-3.19.1/lib/ruby26_parser.rb +0 -11253
- data/bundle/ruby/2.7.0/gems/ruby_parser-3.19.1/lib/ruby26_parser.y +0 -2736
- data/bundle/ruby/2.7.0/gems/ruby_parser-3.19.1/lib/ruby27_parser.rb +0 -12980
- data/bundle/ruby/2.7.0/gems/ruby_parser-3.19.1/lib/ruby27_parser.y +0 -3324
- data/bundle/ruby/2.7.0/gems/ruby_parser-3.19.1/lib/ruby30_parser.rb +0 -13242
- data/bundle/ruby/2.7.0/gems/ruby_parser-3.19.1/lib/ruby30_parser.y +0 -3447
- data/bundle/ruby/2.7.0/gems/ruby_parser-3.19.1/lib/ruby31_parser.rb +0 -13622
- data/bundle/ruby/2.7.0/gems/ruby_parser-3.19.1/lib/ruby31_parser.y +0 -3481
- data/bundle/ruby/2.7.0/gems/ruby_parser-3.19.1/lib/ruby3_parser.yy +0 -3536
- data/bundle/ruby/2.7.0/gems/ruby_parser-3.19.1/lib/ruby_lexer.rb +0 -1144
- data/bundle/ruby/2.7.0/gems/ruby_parser-3.19.1/lib/ruby_lexer.rex.rb +0 -399
- data/bundle/ruby/2.7.0/gems/ruby_parser-3.19.1/lib/ruby_lexer_strings.rb +0 -638
- data/bundle/ruby/2.7.0/gems/ruby_parser-3.19.1/lib/ruby_parser.rb +0 -98
- data/bundle/ruby/2.7.0/gems/ruby_parser-3.19.1/lib/ruby_parser.yy +0 -3465
- data/bundle/ruby/2.7.0/gems/ruby_parser-3.19.1/lib/ruby_parser_extras.rb +0 -1865
- data/bundle/ruby/2.7.0/gems/ruby_parser-3.19.1/tools/munge.rb +0 -250
- data/bundle/ruby/2.7.0/gems/ruby_parser-3.19.1/tools/ripper.rb +0 -44
- data/bundle/ruby/2.7.0/gems/ruby_parser-legacy-1.0.0/History.rdoc +0 -6
- data/bundle/ruby/2.7.0/gems/ruby_parser-legacy-1.0.0/Manifest.txt +0 -19
- data/bundle/ruby/2.7.0/gems/ruby_parser-legacy-1.0.0/README.rdoc +0 -54
- data/bundle/ruby/2.7.0/gems/ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy/ruby18_parser.rb +0 -5794
- data/bundle/ruby/2.7.0/gems/ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy/ruby18_parser.y +0 -1909
- data/bundle/ruby/2.7.0/gems/ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy/ruby19_parser.rb +0 -6186
- data/bundle/ruby/2.7.0/gems/ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy/ruby19_parser.y +0 -2117
- data/bundle/ruby/2.7.0/gems/ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy/ruby_lexer.rb +0 -1412
- data/bundle/ruby/2.7.0/gems/ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy/ruby_lexer.rex +0 -179
- data/bundle/ruby/2.7.0/gems/ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy/ruby_lexer.rex.rb +0 -323
- data/bundle/ruby/2.7.0/gems/ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy/ruby_parser.rb +0 -30
- data/bundle/ruby/2.7.0/gems/ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy/ruby_parser_extras.rb +0 -1388
- data/bundle/ruby/2.7.0/gems/ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy.rb +0 -5
- data/bundle/ruby/2.7.0/gems/safe_yaml-1.0.5/CHANGES.md +0 -154
- data/bundle/ruby/2.7.0/gems/safe_yaml-1.0.5/Gemfile +0 -11
- data/bundle/ruby/2.7.0/gems/safe_yaml-1.0.5/LICENSE.txt +0 -22
- data/bundle/ruby/2.7.0/gems/safe_yaml-1.0.5/README.md +0 -191
- data/bundle/ruby/2.7.0/gems/safe_yaml-1.0.5/bundle_install_all_ruby_versions.sh +0 -11
- data/bundle/ruby/2.7.0/gems/safe_yaml-1.0.5/lib/safe_yaml/deep.rb +0 -34
- data/bundle/ruby/2.7.0/gems/safe_yaml-1.0.5/lib/safe_yaml/libyaml_checker.rb +0 -36
- data/bundle/ruby/2.7.0/gems/safe_yaml-1.0.5/lib/safe_yaml/load.rb +0 -181
- data/bundle/ruby/2.7.0/gems/safe_yaml-1.0.5/lib/safe_yaml/parse/date.rb +0 -37
- data/bundle/ruby/2.7.0/gems/safe_yaml-1.0.5/lib/safe_yaml/parse/hexadecimal.rb +0 -12
- data/bundle/ruby/2.7.0/gems/safe_yaml-1.0.5/lib/safe_yaml/parse/sexagesimal.rb +0 -26
- data/bundle/ruby/2.7.0/gems/safe_yaml-1.0.5/lib/safe_yaml/psych_handler.rb +0 -99
- data/bundle/ruby/2.7.0/gems/safe_yaml-1.0.5/lib/safe_yaml/psych_resolver.rb +0 -52
- data/bundle/ruby/2.7.0/gems/safe_yaml-1.0.5/lib/safe_yaml/resolver.rb +0 -94
- data/bundle/ruby/2.7.0/gems/safe_yaml-1.0.5/lib/safe_yaml/safe_to_ruby_visitor.rb +0 -29
- data/bundle/ruby/2.7.0/gems/safe_yaml-1.0.5/lib/safe_yaml/store.rb +0 -39
- data/bundle/ruby/2.7.0/gems/safe_yaml-1.0.5/lib/safe_yaml/syck_hack.rb +0 -36
- data/bundle/ruby/2.7.0/gems/safe_yaml-1.0.5/lib/safe_yaml/syck_node_monkeypatch.rb +0 -43
- data/bundle/ruby/2.7.0/gems/safe_yaml-1.0.5/lib/safe_yaml/syck_resolver.rb +0 -38
- data/bundle/ruby/2.7.0/gems/safe_yaml-1.0.5/lib/safe_yaml/transform/to_boolean.rb +0 -21
- data/bundle/ruby/2.7.0/gems/safe_yaml-1.0.5/lib/safe_yaml/transform/to_date.rb +0 -13
- data/bundle/ruby/2.7.0/gems/safe_yaml-1.0.5/lib/safe_yaml/transform/to_float.rb +0 -33
- data/bundle/ruby/2.7.0/gems/safe_yaml-1.0.5/lib/safe_yaml/transform/to_integer.rb +0 -26
- data/bundle/ruby/2.7.0/gems/safe_yaml-1.0.5/lib/safe_yaml/transform/to_nil.rb +0 -18
- data/bundle/ruby/2.7.0/gems/safe_yaml-1.0.5/lib/safe_yaml/transform/to_symbol.rb +0 -17
- data/bundle/ruby/2.7.0/gems/safe_yaml-1.0.5/lib/safe_yaml/transform/transformation_map.rb +0 -47
- data/bundle/ruby/2.7.0/gems/safe_yaml-1.0.5/lib/safe_yaml/transform.rb +0 -41
- data/bundle/ruby/2.7.0/gems/safe_yaml-1.0.5/lib/safe_yaml/version.rb +0 -3
- data/bundle/ruby/2.7.0/gems/safe_yaml-1.0.5/lib/safe_yaml.rb +0 -94
- data/bundle/ruby/2.7.0/gems/safe_yaml-1.0.5/run_specs_all_ruby_versions.sh +0 -38
- data/bundle/ruby/2.7.0/gems/safe_yaml-1.0.5/safe_yaml.gemspec +0 -19
- data/bundle/ruby/2.7.0/gems/sexp_processor-4.16.0/History.rdoc +0 -448
- data/bundle/ruby/2.7.0/gems/sexp_processor-4.16.0/lib/pt_testcase.rb +0 -3133
- data/bundle/ruby/2.7.0/gems/sexp_processor-4.16.0/lib/sexp.rb +0 -391
- data/bundle/ruby/2.7.0/gems/sexp_processor-4.16.0/lib/sexp_matcher.rb +0 -1100
- data/bundle/ruby/2.7.0/gems/sexp_processor-4.16.0/lib/sexp_processor.rb +0 -754
- data/bundle/ruby/2.7.0/gems/sexp_processor-4.16.0/lib/strict_sexp.rb +0 -148
- data/bundle/ruby/2.7.0/gems/slim-4.1.0/CHANGES +0 -460
- data/bundle/ruby/2.7.0/gems/slim-4.1.0/Gemfile +0 -70
- data/bundle/ruby/2.7.0/gems/slim-4.1.0/LICENSE +0 -21
- data/bundle/ruby/2.7.0/gems/slim-4.1.0/README.jp.md +0 -1289
- data/bundle/ruby/2.7.0/gems/slim-4.1.0/README.md +0 -1290
- data/bundle/ruby/2.7.0/gems/slim-4.1.0/lib/slim/code_attributes.rb +0 -67
- data/bundle/ruby/2.7.0/gems/slim-4.1.0/lib/slim/command.rb +0 -128
- data/bundle/ruby/2.7.0/gems/slim-4.1.0/lib/slim/controls.rb +0 -60
- data/bundle/ruby/2.7.0/gems/slim-4.1.0/lib/slim/do_inserter.rb +0 -33
- data/bundle/ruby/2.7.0/gems/slim-4.1.0/lib/slim/embedded.rb +0 -248
- data/bundle/ruby/2.7.0/gems/slim-4.1.0/lib/slim/end_inserter.rb +0 -62
- data/bundle/ruby/2.7.0/gems/slim-4.1.0/lib/slim/engine.rb +0 -39
- data/bundle/ruby/2.7.0/gems/slim-4.1.0/lib/slim/erb_converter.rb +0 -14
- data/bundle/ruby/2.7.0/gems/slim-4.1.0/lib/slim/filter.rb +0 -30
- data/bundle/ruby/2.7.0/gems/slim-4.1.0/lib/slim/grammar.rb +0 -23
- data/bundle/ruby/2.7.0/gems/slim-4.1.0/lib/slim/include.rb +0 -57
- data/bundle/ruby/2.7.0/gems/slim-4.1.0/lib/slim/interpolation.rb +0 -35
- data/bundle/ruby/2.7.0/gems/slim-4.1.0/lib/slim/logic_less/context.rb +0 -127
- data/bundle/ruby/2.7.0/gems/slim-4.1.0/lib/slim/logic_less/filter.rb +0 -80
- data/bundle/ruby/2.7.0/gems/slim-4.1.0/lib/slim/logic_less.rb +0 -5
- data/bundle/ruby/2.7.0/gems/slim-4.1.0/lib/slim/parser.rb +0 -548
- data/bundle/ruby/2.7.0/gems/slim-4.1.0/lib/slim/smart/escaper.rb +0 -42
- data/bundle/ruby/2.7.0/gems/slim-4.1.0/lib/slim/smart/filter.rb +0 -96
- data/bundle/ruby/2.7.0/gems/slim-4.1.0/lib/slim/smart/parser.rb +0 -34
- data/bundle/ruby/2.7.0/gems/slim-4.1.0/lib/slim/smart.rb +0 -8
- data/bundle/ruby/2.7.0/gems/slim-4.1.0/lib/slim/splat/builder.rb +0 -107
- data/bundle/ruby/2.7.0/gems/slim-4.1.0/lib/slim/splat/filter.rb +0 -91
- data/bundle/ruby/2.7.0/gems/slim-4.1.0/lib/slim/template.rb +0 -19
- data/bundle/ruby/2.7.0/gems/slim-4.1.0/lib/slim/translator.rb +0 -118
- data/bundle/ruby/2.7.0/gems/slim-4.1.0/lib/slim/version.rb +0 -5
- data/bundle/ruby/2.7.0/gems/slim-4.1.0/lib/slim.rb +0 -14
- data/bundle/ruby/2.7.0/gems/slim-4.1.0/slim.gemspec +0 -24
- data/bundle/ruby/2.7.0/gems/temple-0.8.2/CHANGES +0 -260
- data/bundle/ruby/2.7.0/gems/temple-0.8.2/Gemfile +0 -3
- data/bundle/ruby/2.7.0/gems/temple-0.8.2/README.md +0 -267
- data/bundle/ruby/2.7.0/gems/temple-0.8.2/lib/temple/engine.rb +0 -67
- data/bundle/ruby/2.7.0/gems/temple-0.8.2/lib/temple/erb/engine.rb +0 -15
- data/bundle/ruby/2.7.0/gems/temple-0.8.2/lib/temple/erb/parser.rb +0 -40
- data/bundle/ruby/2.7.0/gems/temple-0.8.2/lib/temple/erb/template.rb +0 -11
- data/bundle/ruby/2.7.0/gems/temple-0.8.2/lib/temple/erb/trimming.rb +0 -23
- data/bundle/ruby/2.7.0/gems/temple-0.8.2/lib/temple/exceptions.rb +0 -13
- data/bundle/ruby/2.7.0/gems/temple-0.8.2/lib/temple/filter.rb +0 -9
- data/bundle/ruby/2.7.0/gems/temple-0.8.2/lib/temple/filters/code_merger.rb +0 -30
- data/bundle/ruby/2.7.0/gems/temple-0.8.2/lib/temple/filters/control_flow.rb +0 -42
- data/bundle/ruby/2.7.0/gems/temple-0.8.2/lib/temple/filters/dynamic_inliner.rb +0 -71
- data/bundle/ruby/2.7.0/gems/temple-0.8.2/lib/temple/filters/encoding.rb +0 -24
- data/bundle/ruby/2.7.0/gems/temple-0.8.2/lib/temple/filters/eraser.rb +0 -22
- data/bundle/ruby/2.7.0/gems/temple-0.8.2/lib/temple/filters/escapable.rb +0 -40
- data/bundle/ruby/2.7.0/gems/temple-0.8.2/lib/temple/filters/multi_flattener.rb +0 -25
- data/bundle/ruby/2.7.0/gems/temple-0.8.2/lib/temple/filters/remove_bom.rb +0 -13
- data/bundle/ruby/2.7.0/gems/temple-0.8.2/lib/temple/filters/static_analyzer.rb +0 -30
- data/bundle/ruby/2.7.0/gems/temple-0.8.2/lib/temple/filters/static_merger.rb +0 -37
- data/bundle/ruby/2.7.0/gems/temple-0.8.2/lib/temple/filters/string_splitter.rb +0 -130
- data/bundle/ruby/2.7.0/gems/temple-0.8.2/lib/temple/filters/validator.rb +0 -15
- data/bundle/ruby/2.7.0/gems/temple-0.8.2/lib/temple/generator.rb +0 -88
- data/bundle/ruby/2.7.0/gems/temple-0.8.2/lib/temple/generators/array.rb +0 -21
- data/bundle/ruby/2.7.0/gems/temple-0.8.2/lib/temple/generators/array_buffer.rb +0 -29
- data/bundle/ruby/2.7.0/gems/temple-0.8.2/lib/temple/generators/erb.rb +0 -32
- data/bundle/ruby/2.7.0/gems/temple-0.8.2/lib/temple/generators/rails_output_buffer.rb +0 -35
- data/bundle/ruby/2.7.0/gems/temple-0.8.2/lib/temple/generators/string_buffer.rb +0 -25
- data/bundle/ruby/2.7.0/gems/temple-0.8.2/lib/temple/grammar.rb +0 -57
- data/bundle/ruby/2.7.0/gems/temple-0.8.2/lib/temple/html/attribute_merger.rb +0 -42
- data/bundle/ruby/2.7.0/gems/temple-0.8.2/lib/temple/html/attribute_remover.rb +0 -35
- data/bundle/ruby/2.7.0/gems/temple-0.8.2/lib/temple/html/attribute_sorter.rb +0 -21
- data/bundle/ruby/2.7.0/gems/temple-0.8.2/lib/temple/html/dispatcher.rb +0 -31
- data/bundle/ruby/2.7.0/gems/temple-0.8.2/lib/temple/html/fast.rb +0 -130
- data/bundle/ruby/2.7.0/gems/temple-0.8.2/lib/temple/html/filter.rb +0 -21
- data/bundle/ruby/2.7.0/gems/temple-0.8.2/lib/temple/html/pretty.rb +0 -103
- data/bundle/ruby/2.7.0/gems/temple-0.8.2/lib/temple/html/safe.rb +0 -23
- data/bundle/ruby/2.7.0/gems/temple-0.8.2/lib/temple/map.rb +0 -105
- data/bundle/ruby/2.7.0/gems/temple-0.8.2/lib/temple/mixins/dispatcher.rb +0 -161
- data/bundle/ruby/2.7.0/gems/temple-0.8.2/lib/temple/mixins/engine_dsl.rb +0 -145
- data/bundle/ruby/2.7.0/gems/temple-0.8.2/lib/temple/mixins/grammar_dsl.rb +0 -170
- data/bundle/ruby/2.7.0/gems/temple-0.8.2/lib/temple/mixins/options.rb +0 -87
- data/bundle/ruby/2.7.0/gems/temple-0.8.2/lib/temple/mixins/template.rb +0 -28
- data/bundle/ruby/2.7.0/gems/temple-0.8.2/lib/temple/parser.rb +0 -8
- data/bundle/ruby/2.7.0/gems/temple-0.8.2/lib/temple/static_analyzer.rb +0 -77
- data/bundle/ruby/2.7.0/gems/temple-0.8.2/lib/temple/templates/rails.rb +0 -26
- data/bundle/ruby/2.7.0/gems/temple-0.8.2/lib/temple/templates/tilt.rb +0 -46
- data/bundle/ruby/2.7.0/gems/temple-0.8.2/lib/temple/templates.rb +0 -11
- data/bundle/ruby/2.7.0/gems/temple-0.8.2/lib/temple/utils.rb +0 -101
- data/bundle/ruby/2.7.0/gems/temple-0.8.2/lib/temple/version.rb +0 -3
- data/bundle/ruby/2.7.0/gems/temple-0.8.2/lib/temple.rb +0 -67
- data/bundle/ruby/2.7.0/gems/temple-0.8.2/temple.gemspec +0 -29
- data/bundle/ruby/2.7.0/gems/terminal-table-1.8.0/History.rdoc +0 -85
- data/bundle/ruby/2.7.0/gems/terminal-table-1.8.0/README.rdoc +0 -247
- data/bundle/ruby/2.7.0/gems/terminal-table-1.8.0/lib/terminal-table/cell.rb +0 -94
- data/bundle/ruby/2.7.0/gems/terminal-table-1.8.0/lib/terminal-table/row.rb +0 -52
- data/bundle/ruby/2.7.0/gems/terminal-table-1.8.0/lib/terminal-table/separator.rb +0 -14
- data/bundle/ruby/2.7.0/gems/terminal-table-1.8.0/lib/terminal-table/style.rb +0 -79
- data/bundle/ruby/2.7.0/gems/terminal-table-1.8.0/lib/terminal-table/table.rb +0 -343
- data/bundle/ruby/2.7.0/gems/terminal-table-1.8.0/lib/terminal-table/version.rb +0 -5
- data/bundle/ruby/2.7.0/gems/terminal-table-1.8.0/lib/terminal-table.rb +0 -26
- data/bundle/ruby/2.7.0/gems/terminal-table-1.8.0/terminal-table.gemspec +0 -26
- data/bundle/ruby/2.7.0/gems/tilt-2.0.10/COPYING +0 -18
- data/bundle/ruby/2.7.0/gems/tilt-2.0.10/lib/tilt/asciidoc.rb +0 -27
- data/bundle/ruby/2.7.0/gems/tilt-2.0.10/lib/tilt/babel.rb +0 -16
- data/bundle/ruby/2.7.0/gems/tilt-2.0.10/lib/tilt/bluecloth.rb +0 -24
- data/bundle/ruby/2.7.0/gems/tilt-2.0.10/lib/tilt/builder.rb +0 -37
- data/bundle/ruby/2.7.0/gems/tilt-2.0.10/lib/tilt/coffee.rb +0 -58
- data/bundle/ruby/2.7.0/gems/tilt-2.0.10/lib/tilt/commonmarker.rb +0 -78
- data/bundle/ruby/2.7.0/gems/tilt-2.0.10/lib/tilt/creole.rb +0 -25
- data/bundle/ruby/2.7.0/gems/tilt-2.0.10/lib/tilt/csv.rb +0 -65
- data/bundle/ruby/2.7.0/gems/tilt-2.0.10/lib/tilt/dummy.rb +0 -3
- data/bundle/ruby/2.7.0/gems/tilt-2.0.10/lib/tilt/erb.rb +0 -63
- data/bundle/ruby/2.7.0/gems/tilt-2.0.10/lib/tilt/erubi.rb +0 -32
- data/bundle/ruby/2.7.0/gems/tilt-2.0.10/lib/tilt/erubis.rb +0 -43
- data/bundle/ruby/2.7.0/gems/tilt-2.0.10/lib/tilt/etanni.rb +0 -27
- data/bundle/ruby/2.7.0/gems/tilt-2.0.10/lib/tilt/haml.rb +0 -86
- data/bundle/ruby/2.7.0/gems/tilt-2.0.10/lib/tilt/kramdown.rb +0 -25
- data/bundle/ruby/2.7.0/gems/tilt-2.0.10/lib/tilt/less.rb +0 -30
- data/bundle/ruby/2.7.0/gems/tilt-2.0.10/lib/tilt/liquid.rb +0 -44
- data/bundle/ruby/2.7.0/gems/tilt-2.0.10/lib/tilt/livescript.rb +0 -23
- data/bundle/ruby/2.7.0/gems/tilt-2.0.10/lib/tilt/mapping.rb +0 -293
- data/bundle/ruby/2.7.0/gems/tilt-2.0.10/lib/tilt/markaby.rb +0 -45
- data/bundle/ruby/2.7.0/gems/tilt-2.0.10/lib/tilt/maruku.rb +0 -22
- data/bundle/ruby/2.7.0/gems/tilt-2.0.10/lib/tilt/nokogiri.rb +0 -36
- data/bundle/ruby/2.7.0/gems/tilt-2.0.10/lib/tilt/pandoc.rb +0 -49
- data/bundle/ruby/2.7.0/gems/tilt-2.0.10/lib/tilt/plain.rb +0 -16
- data/bundle/ruby/2.7.0/gems/tilt-2.0.10/lib/tilt/prawn.rb +0 -43
- data/bundle/ruby/2.7.0/gems/tilt-2.0.10/lib/tilt/radius.rb +0 -48
- data/bundle/ruby/2.7.0/gems/tilt-2.0.10/lib/tilt/rdiscount.rb +0 -39
- data/bundle/ruby/2.7.0/gems/tilt-2.0.10/lib/tilt/rdoc.rb +0 -40
- data/bundle/ruby/2.7.0/gems/tilt-2.0.10/lib/tilt/redcarpet.rb +0 -83
- data/bundle/ruby/2.7.0/gems/tilt-2.0.10/lib/tilt/redcloth.rb +0 -23
- data/bundle/ruby/2.7.0/gems/tilt-2.0.10/lib/tilt/rst-pandoc.rb +0 -18
- data/bundle/ruby/2.7.0/gems/tilt-2.0.10/lib/tilt/sass.rb +0 -52
- data/bundle/ruby/2.7.0/gems/tilt-2.0.10/lib/tilt/sigil.rb +0 -34
- data/bundle/ruby/2.7.0/gems/tilt-2.0.10/lib/tilt/string.rb +0 -21
- data/bundle/ruby/2.7.0/gems/tilt-2.0.10/lib/tilt/template.rb +0 -297
- data/bundle/ruby/2.7.0/gems/tilt-2.0.10/lib/tilt/typescript.rb +0 -26
- data/bundle/ruby/2.7.0/gems/tilt-2.0.10/lib/tilt/wikicloth.rb +0 -22
- data/bundle/ruby/2.7.0/gems/tilt-2.0.10/lib/tilt/yajl.rb +0 -87
- data/bundle/ruby/2.7.0/gems/tilt-2.0.10/lib/tilt.rb +0 -166
- data/bundle/ruby/2.7.0/gems/unicode-display_width-1.8.0/CHANGELOG.md +0 -137
- data/bundle/ruby/2.7.0/gems/unicode-display_width-1.8.0/MIT-LICENSE.txt +0 -22
- data/bundle/ruby/2.7.0/gems/unicode-display_width-1.8.0/README.md +0 -124
- data/bundle/ruby/2.7.0/gems/unicode-display_width-1.8.0/data/display_width.marshal.gz +0 -0
- data/bundle/ruby/2.7.0/gems/unicode-display_width-1.8.0/lib/unicode/display_width/constants.rb +0 -8
- data/bundle/ruby/2.7.0/gems/unicode-display_width-1.8.0/lib/unicode/display_width/index.rb +0 -12
- data/bundle/ruby/2.7.0/gems/unicode-display_width-1.8.0/lib/unicode/display_width/no_string_ext.rb +0 -7
- data/bundle/ruby/2.7.0/gems/unicode-display_width-1.8.0/lib/unicode/display_width/string_ext.rb +0 -17
- data/bundle/ruby/2.7.0/gems/unicode-display_width-1.8.0/lib/unicode/display_width.rb +0 -51
- /data/bundle/ruby/{2.7.0 → 3.1.0}/gems/erubis-2.7.0/CHANGES.txt +0 -0
- /data/bundle/ruby/{2.7.0 → 3.1.0}/gems/erubis-2.7.0/MIT-LICENSE +0 -0
- /data/bundle/ruby/{2.7.0 → 3.1.0}/gems/erubis-2.7.0/README.txt +0 -0
- /data/bundle/ruby/{2.7.0 → 3.1.0}/gems/erubis-2.7.0/contrib/erubis +0 -0
- /data/bundle/ruby/{2.7.0 → 3.1.0}/gems/erubis-2.7.0/contrib/erubis-run.rb +0 -0
- /data/bundle/ruby/{2.7.0 → 3.1.0}/gems/erubis-2.7.0/contrib/inline-require +0 -0
- /data/bundle/ruby/{2.7.0 → 3.1.0}/gems/erubis-2.7.0/lib/erubis/context.rb +0 -0
- /data/bundle/ruby/{2.7.0 → 3.1.0}/gems/erubis-2.7.0/lib/erubis/converter.rb +0 -0
- /data/bundle/ruby/{2.7.0 → 3.1.0}/gems/erubis-2.7.0/lib/erubis/engine/ec.rb +0 -0
- /data/bundle/ruby/{2.7.0 → 3.1.0}/gems/erubis-2.7.0/lib/erubis/engine/ecpp.rb +0 -0
- /data/bundle/ruby/{2.7.0 → 3.1.0}/gems/erubis-2.7.0/lib/erubis/engine/ejava.rb +0 -0
- /data/bundle/ruby/{2.7.0 → 3.1.0}/gems/erubis-2.7.0/lib/erubis/engine/ejavascript.rb +0 -0
- /data/bundle/ruby/{2.7.0 → 3.1.0}/gems/erubis-2.7.0/lib/erubis/engine/enhanced.rb +0 -0
- /data/bundle/ruby/{2.7.0 → 3.1.0}/gems/erubis-2.7.0/lib/erubis/engine/eperl.rb +0 -0
- /data/bundle/ruby/{2.7.0 → 3.1.0}/gems/erubis-2.7.0/lib/erubis/engine/ephp.rb +0 -0
- /data/bundle/ruby/{2.7.0 → 3.1.0}/gems/erubis-2.7.0/lib/erubis/engine/eruby.rb +0 -0
- /data/bundle/ruby/{2.7.0 → 3.1.0}/gems/erubis-2.7.0/lib/erubis/engine/escheme.rb +0 -0
- /data/bundle/ruby/{2.7.0 → 3.1.0}/gems/erubis-2.7.0/lib/erubis/engine/optimized.rb +0 -0
- /data/bundle/ruby/{2.7.0 → 3.1.0}/gems/erubis-2.7.0/lib/erubis/engine.rb +0 -0
- /data/bundle/ruby/{2.7.0 → 3.1.0}/gems/erubis-2.7.0/lib/erubis/enhancer.rb +0 -0
- /data/bundle/ruby/{2.7.0 → 3.1.0}/gems/erubis-2.7.0/lib/erubis/error.rb +0 -0
- /data/bundle/ruby/{2.7.0 → 3.1.0}/gems/erubis-2.7.0/lib/erubis/evaluator.rb +0 -0
- /data/bundle/ruby/{2.7.0 → 3.1.0}/gems/erubis-2.7.0/lib/erubis/generator.rb +0 -0
- /data/bundle/ruby/{2.7.0 → 3.1.0}/gems/erubis-2.7.0/lib/erubis/helper.rb +0 -0
- /data/bundle/ruby/{2.7.0 → 3.1.0}/gems/erubis-2.7.0/lib/erubis/helpers/rails_form_helper.rb +0 -0
- /data/bundle/ruby/{2.7.0 → 3.1.0}/gems/erubis-2.7.0/lib/erubis/helpers/rails_helper.rb +0 -0
- /data/bundle/ruby/{2.7.0 → 3.1.0}/gems/erubis-2.7.0/lib/erubis/local-setting.rb +0 -0
- /data/bundle/ruby/{2.7.0 → 3.1.0}/gems/erubis-2.7.0/lib/erubis/main.rb +0 -0
- /data/bundle/ruby/{2.7.0 → 3.1.0}/gems/erubis-2.7.0/lib/erubis/preprocessing.rb +0 -0
- /data/bundle/ruby/{2.7.0 → 3.1.0}/gems/erubis-2.7.0/lib/erubis/tiny.rb +0 -0
- /data/bundle/ruby/{2.7.0 → 3.1.0}/gems/erubis-2.7.0/lib/erubis/util.rb +0 -0
- /data/bundle/ruby/{2.7.0 → 3.1.0}/gems/erubis-2.7.0/lib/erubis.rb +0 -0
- /data/bundle/ruby/{2.7.0 → 3.1.0}/gems/erubis-2.7.0/setup.rb +0 -0
- /data/bundle/ruby/{2.7.0/gems/highline-2.0.3 → 3.1.0/gems/highline-3.1.2}/AUTHORS +0 -0
- /data/bundle/ruby/{2.7.0/gems/highline-2.0.3 → 3.1.0/gems/highline-3.1.2}/COPYING +0 -0
- /data/bundle/ruby/{2.7.0/gems/highline-2.0.3 → 3.1.0/gems/highline-3.1.2}/LICENSE +0 -0
- /data/bundle/ruby/{2.7.0/gems/highline-2.0.3 → 3.1.0/gems/highline-3.1.2}/TODO +0 -0
- /data/bundle/ruby/{2.7.0/gems/highline-2.0.3 → 3.1.0/gems/highline-3.1.2}/lib/highline/builtin_styles.rb +0 -0
- /data/bundle/ruby/{2.7.0/gems/highline-2.0.3 → 3.1.0/gems/highline-3.1.2}/lib/highline/color_scheme.rb +0 -0
- /data/bundle/ruby/{2.7.0/gems/highline-2.0.3 → 3.1.0/gems/highline-3.1.2}/lib/highline/compatibility.rb +0 -0
- /data/bundle/ruby/{2.7.0/gems/highline-2.0.3 → 3.1.0/gems/highline-3.1.2}/lib/highline/custom_errors.rb +0 -0
- /data/bundle/ruby/{2.7.0/gems/highline-2.0.3 → 3.1.0/gems/highline-3.1.2}/lib/highline/import.rb +0 -0
- /data/bundle/ruby/{2.7.0/gems/highline-2.0.3 → 3.1.0/gems/highline-3.1.2}/lib/highline/list.rb +0 -0
- /data/bundle/ruby/{2.7.0/gems/highline-2.0.3 → 3.1.0/gems/highline-3.1.2}/lib/highline/menu/item.rb +0 -0
- /data/bundle/ruby/{2.7.0/gems/highline-2.0.3 → 3.1.0/gems/highline-3.1.2}/lib/highline/paginator.rb +0 -0
- /data/bundle/ruby/{2.7.0/gems/highline-2.0.3 → 3.1.0/gems/highline-3.1.2}/lib/highline/simulate.rb +0 -0
- /data/bundle/ruby/{2.7.0/gems/highline-2.0.3 → 3.1.0/gems/highline-3.1.2}/lib/highline/statement.rb +0 -0
- /data/bundle/ruby/{2.7.0/gems/highline-2.0.3 → 3.1.0/gems/highline-3.1.2}/lib/highline/string.rb +0 -0
- /data/bundle/ruby/{2.7.0/gems/highline-2.0.3 → 3.1.0/gems/highline-3.1.2}/lib/highline/string_extensions.rb +0 -0
- /data/bundle/ruby/{2.7.0/gems/highline-2.0.3 → 3.1.0/gems/highline-3.1.2}/lib/highline/template_renderer.rb +0 -0
- /data/bundle/ruby/{2.7.0/gems/highline-2.0.3 → 3.1.0/gems/highline-3.1.2}/lib/highline/terminal/ncurses.rb +0 -0
- /data/bundle/ruby/{2.7.0/gems/highline-2.0.3 → 3.1.0/gems/highline-3.1.2}/lib/highline/wrapper.rb +0 -0
- /data/bundle/ruby/{2.7.0/gems/parallel-1.22.1 → 3.1.0/gems/parallel-1.27.0}/MIT-LICENSE.txt +0 -0
- /data/bundle/ruby/{2.7.0/gems/rexml-3.2.5/LICENSE.txt → 3.1.0/gems/reline-0.6.2/BSDL} +0 -0
- /data/bundle/ruby/{2.7.0/gems/rexml-3.2.5 → 3.1.0/gems/rexml-3.4.4}/lib/rexml/attlistdecl.rb +0 -0
- /data/bundle/ruby/{2.7.0/gems/rexml-3.2.5 → 3.1.0/gems/rexml-3.4.4}/lib/rexml/dtd/attlistdecl.rb +0 -0
- /data/bundle/ruby/{2.7.0/gems/rexml-3.2.5 → 3.1.0/gems/rexml-3.4.4}/lib/rexml/dtd/dtd.rb +0 -0
- /data/bundle/ruby/{2.7.0/gems/rexml-3.2.5 → 3.1.0/gems/rexml-3.4.4}/lib/rexml/dtd/elementdecl.rb +0 -0
- /data/bundle/ruby/{2.7.0/gems/rexml-3.2.5 → 3.1.0/gems/rexml-3.4.4}/lib/rexml/dtd/entitydecl.rb +0 -0
- /data/bundle/ruby/{2.7.0/gems/rexml-3.2.5 → 3.1.0/gems/rexml-3.4.4}/lib/rexml/dtd/notationdecl.rb +0 -0
- /data/bundle/ruby/{2.7.0/gems/rexml-3.2.5 → 3.1.0/gems/rexml-3.4.4}/lib/rexml/formatters/default.rb +0 -0
- /data/bundle/ruby/{2.7.0/gems/rexml-3.2.5 → 3.1.0/gems/rexml-3.4.4}/lib/rexml/formatters/transitive.rb +0 -0
- /data/bundle/ruby/{2.7.0/gems/rexml-3.2.5 → 3.1.0/gems/rexml-3.4.4}/lib/rexml/light/node.rb +0 -0
- /data/bundle/ruby/{2.7.0/gems/rexml-3.2.5 → 3.1.0/gems/rexml-3.4.4}/lib/rexml/output.rb +0 -0
- /data/bundle/ruby/{2.7.0/gems/rexml-3.2.5 → 3.1.0/gems/rexml-3.4.4}/lib/rexml/parent.rb +0 -0
- /data/bundle/ruby/{2.7.0/gems/rexml-3.2.5 → 3.1.0/gems/rexml-3.4.4}/lib/rexml/parsers/lightparser.rb +0 -0
- /data/bundle/ruby/{2.7.0/gems/rexml-3.2.5 → 3.1.0/gems/rexml-3.4.4}/lib/rexml/parsers/ultralightparser.rb +0 -0
- /data/bundle/ruby/{2.7.0/gems/rexml-3.2.5 → 3.1.0/gems/rexml-3.4.4}/lib/rexml/sax2listener.rb +0 -0
- /data/bundle/ruby/{2.7.0/gems/rexml-3.2.5 → 3.1.0/gems/rexml-3.4.4}/lib/rexml/streamlistener.rb +0 -0
- /data/bundle/ruby/{2.7.0/gems/rexml-3.2.5 → 3.1.0/gems/rexml-3.4.4}/lib/rexml/undefinednamespaceexception.rb +0 -0
- /data/bundle/ruby/{2.7.0/gems/rexml-3.2.5 → 3.1.0/gems/rexml-3.4.4}/lib/rexml/validation/validationexception.rb +0 -0
- /data/bundle/ruby/{2.7.0/gems/rexml-3.2.5 → 3.1.0/gems/rexml-3.4.4}/lib/rexml/xmldecl.rb +0 -0
- /data/bundle/ruby/{2.7.0/gems/rexml-3.2.5 → 3.1.0/gems/rexml-3.4.4}/lib/rexml/xmltokens.rb +0 -0
- /data/bundle/ruby/{2.7.0/gems/rexml-3.2.5 → 3.1.0/gems/rexml-3.4.4}/lib/rexml.rb +0 -0
- /data/bundle/ruby/{2.7.0/gems/ruby2ruby-2.4.4 → 3.1.0/gems/ruby2ruby-2.5.2}/Manifest.txt +0 -0
- /data/bundle/ruby/{2.7.0/gems/ruby2ruby-2.4.4 → 3.1.0/gems/ruby2ruby-2.5.2}/README.rdoc +0 -0
- /data/bundle/ruby/{2.7.0/gems/ruby_parser-3.19.1 → 3.1.0/gems/ruby_parser-3.20.3}/debugging.md +0 -0
- /data/bundle/ruby/{2.7.0/gems/ruby_parser-3.19.1 → 3.1.0/gems/ruby_parser-3.20.3}/gauntlet.md +0 -0
- /data/bundle/ruby/{2.7.0/gems/ruby_parser-3.19.1 → 3.1.0/gems/ruby_parser-3.20.3}/lib/rp_extensions.rb +0 -0
- /data/bundle/ruby/{2.7.0/gems/ruby_parser-3.19.1 → 3.1.0/gems/ruby_parser-3.20.3}/lib/rp_stringscanner.rb +0 -0
- /data/bundle/ruby/{2.7.0/gems/ruby_parser-3.19.1 → 3.1.0/gems/ruby_parser-3.20.3}/lib/ruby_lexer.rex +0 -0
- /data/bundle/ruby/{2.7.0/gems/sexp_processor-4.16.0 → 3.1.0/gems/sexp_processor-4.17.4}/Manifest.txt +0 -0
- /data/bundle/ruby/{2.7.0/gems/sexp_processor-4.16.0 → 3.1.0/gems/sexp_processor-4.17.4}/README.rdoc +0 -0
- /data/bundle/ruby/{2.7.0/gems/sexp_processor-4.16.0 → 3.1.0/gems/sexp_processor-4.17.4}/lib/composite_sexp_processor.rb +0 -0
- /data/bundle/ruby/{2.7.0/gems/sexp_processor-4.16.0 → 3.1.0/gems/sexp_processor-4.17.4}/lib/unique.rb +0 -0
- /data/bundle/ruby/{2.7.0/gems/temple-0.8.2 → 3.1.0/gems/temple-0.10.4}/EXPRESSIONS.md +0 -0
- /data/bundle/ruby/{2.7.0/gems/temple-0.8.2 → 3.1.0/gems/temple-0.10.4}/LICENSE +0 -0
- /data/bundle/ruby/{2.7.0/gems/terminal-table-1.8.0 → 3.1.0/gems/terminal-table-4.0.0}/Gemfile +0 -0
- /data/bundle/ruby/{2.7.0/gems/terminal-table-1.8.0 → 3.1.0/gems/terminal-table-4.0.0}/LICENSE.txt +0 -0
- /data/bundle/ruby/{2.7.0/gems/terminal-table-1.8.0 → 3.1.0/gems/terminal-table-4.0.0}/Manifest +0 -0
- /data/bundle/ruby/{2.7.0/gems/terminal-table-1.8.0 → 3.1.0/gems/terminal-table-4.0.0}/Todo.rdoc +0 -0
- /data/bundle/ruby/{2.7.0/gems/terminal-table-1.8.0 → 3.1.0/gems/terminal-table-4.0.0}/lib/terminal-table/import.rb +0 -0
- /data/bundle/ruby/{2.7.0/gems/terminal-table-1.8.0 → 3.1.0/gems/terminal-table-4.0.0}/lib/terminal-table/table_helper.rb +0 -0
|
@@ -1,3133 +0,0 @@
|
|
|
1
|
-
# encoding: US-ASCII
|
|
2
|
-
|
|
3
|
-
$TESTING = true
|
|
4
|
-
# :stopdoc:
|
|
5
|
-
|
|
6
|
-
require "minitest/test"
|
|
7
|
-
require "sexp_processor" # for deep_clone
|
|
8
|
-
|
|
9
|
-
# key:
|
|
10
|
-
# wwtt = what were they thinking?
|
|
11
|
-
|
|
12
|
-
class Examples
|
|
13
|
-
attr_reader :reader
|
|
14
|
-
attr_writer :writer
|
|
15
|
-
|
|
16
|
-
def a_method x; x+1; end
|
|
17
|
-
alias an_alias a_method
|
|
18
|
-
|
|
19
|
-
define_method(:bmethod_noargs) do
|
|
20
|
-
x + 1
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
define_method(:unsplatted) do |x|
|
|
24
|
-
x + 1
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
define_method :splatted do |*args|
|
|
28
|
-
y = args.first
|
|
29
|
-
y + 42
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
define_method :dmethod_added, instance_method(:a_method) if
|
|
33
|
-
RUBY_VERSION < "1.9"
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
class ParseTreeTestCase < Minitest::Test
|
|
37
|
-
attr_accessor :processor # to be defined by subclass
|
|
38
|
-
|
|
39
|
-
def setup
|
|
40
|
-
super
|
|
41
|
-
@processor = nil
|
|
42
|
-
end
|
|
43
|
-
|
|
44
|
-
def after_process_hook klass, node, data, input_name, output_name
|
|
45
|
-
end
|
|
46
|
-
|
|
47
|
-
def before_process_hook klass, node, data, input_name, output_name
|
|
48
|
-
end
|
|
49
|
-
|
|
50
|
-
def self.add_test name, data, klass = self.name[4..-1]
|
|
51
|
-
name = name.to_s
|
|
52
|
-
klass = klass.to_s
|
|
53
|
-
|
|
54
|
-
if testcases.has_key? name then
|
|
55
|
-
if testcases[name].has_key? klass then
|
|
56
|
-
warn "testcase #{klass}##{name} already has data"
|
|
57
|
-
else
|
|
58
|
-
testcases[name][klass] = data
|
|
59
|
-
end
|
|
60
|
-
else
|
|
61
|
-
warn "testcase #{name} does not exist"
|
|
62
|
-
end
|
|
63
|
-
end
|
|
64
|
-
|
|
65
|
-
def self.add_tests name, hash
|
|
66
|
-
name = name.to_s
|
|
67
|
-
|
|
68
|
-
hash.each do |klass, data|
|
|
69
|
-
warn "testcase #{klass}##{name} already has data" if
|
|
70
|
-
testcases[name].has_key? klass
|
|
71
|
-
testcases[name][klass] = data
|
|
72
|
-
end
|
|
73
|
-
end
|
|
74
|
-
|
|
75
|
-
def self.add_18tests name, hash
|
|
76
|
-
add_tests "#{name}__18", hash
|
|
77
|
-
end
|
|
78
|
-
|
|
79
|
-
def self.add_19tests name, hash
|
|
80
|
-
add_tests "#{name}__19_20_21_22_23_24_25_26_27_30", hash # HACK?
|
|
81
|
-
end
|
|
82
|
-
|
|
83
|
-
def self.add_19edgecases ruby, sexp, cases
|
|
84
|
-
cases.each do |name, code|
|
|
85
|
-
add_19tests name, "Ruby" => code, "ParseTree" => sexp, "Ruby2Ruby" => ruby
|
|
86
|
-
end
|
|
87
|
-
end
|
|
88
|
-
|
|
89
|
-
def self.clone_same
|
|
90
|
-
@@testcases.each do |node, data|
|
|
91
|
-
data.each do |key, val|
|
|
92
|
-
if val == :same then
|
|
93
|
-
prev_key = self.previous(key)
|
|
94
|
-
data[key] = data[prev_key].deep_clone
|
|
95
|
-
end
|
|
96
|
-
end
|
|
97
|
-
end
|
|
98
|
-
end
|
|
99
|
-
|
|
100
|
-
def self.copy_test_case nonverbose, klass
|
|
101
|
-
verbose = nonverbose + "_mri_verbose_flag"
|
|
102
|
-
testcases[verbose][klass] = testcases[nonverbose][klass]
|
|
103
|
-
end
|
|
104
|
-
|
|
105
|
-
VER_RE = "(1[89]|2[01234567]|3[0])"
|
|
106
|
-
|
|
107
|
-
def self.generate_test klass, node, data, input_name, output_name
|
|
108
|
-
klass.send :define_method, "test_#{node}" do
|
|
109
|
-
flunk "Processor is nil" if processor.nil?
|
|
110
|
-
|
|
111
|
-
tversions = node[/(?:_#{VER_RE})+$/]
|
|
112
|
-
if tversions then
|
|
113
|
-
cversion = self.class.name[/#{VER_RE}/]
|
|
114
|
-
|
|
115
|
-
assert true # shut up prove_it!
|
|
116
|
-
|
|
117
|
-
# can't push this up because it may be generating into an
|
|
118
|
-
# abstract test class and the actual subclass is versioned.
|
|
119
|
-
return "version specific test" unless tversions.include? cversion if cversion
|
|
120
|
-
end
|
|
121
|
-
|
|
122
|
-
assert data.has_key?(input_name), "Unknown input data"
|
|
123
|
-
assert data.has_key?(output_name), "Missing test data"
|
|
124
|
-
|
|
125
|
-
$missing[node] << output_name unless data.has_key? output_name
|
|
126
|
-
|
|
127
|
-
input = data[input_name].deep_clone
|
|
128
|
-
expected = data[output_name].deep_clone
|
|
129
|
-
|
|
130
|
-
case expected
|
|
131
|
-
when :unsupported then
|
|
132
|
-
assert_raises(UnsupportedNodeError) do
|
|
133
|
-
processor.process(input)
|
|
134
|
-
end
|
|
135
|
-
else
|
|
136
|
-
extra_expected = []
|
|
137
|
-
extra_input = []
|
|
138
|
-
|
|
139
|
-
_, expected, extra_expected = *expected if
|
|
140
|
-
Array === expected and expected.sexp_type == :defx
|
|
141
|
-
_, input, extra_input = *input if
|
|
142
|
-
Array === input and input.sexp_type == :defx
|
|
143
|
-
|
|
144
|
-
# OMG... I can't believe I have to do this this way. these
|
|
145
|
-
# hooks are here instead of refactoring this define_method
|
|
146
|
-
# body into an assertion. It'll allow subclasses to hook in
|
|
147
|
-
# and add behavior before or after the processor does it's
|
|
148
|
-
# thing. If you go the body refactor route, some of the
|
|
149
|
-
# RawParseTree test cases fail for completely bogus reasons.
|
|
150
|
-
|
|
151
|
-
before_process_hook klass, node, data, input_name, output_name
|
|
152
|
-
refute_nil data[input_name], "testcase does not exist?"
|
|
153
|
-
timeout = (ENV["RP_TIMEOUT"] || 10).to_i
|
|
154
|
-
@result = processor.process input, "(string)", timeout
|
|
155
|
-
assert_equal(expected, @result,
|
|
156
|
-
"failed on input: #{data[input_name].inspect}")
|
|
157
|
-
after_process_hook klass, node, data, input_name, output_name
|
|
158
|
-
|
|
159
|
-
extra_input.each do |extra|
|
|
160
|
-
processor.process(extra)
|
|
161
|
-
end
|
|
162
|
-
extra = if processor.respond_to?(:extra_methods) then
|
|
163
|
-
processor.extra_methods
|
|
164
|
-
else
|
|
165
|
-
[]
|
|
166
|
-
end
|
|
167
|
-
assert_equal extra_expected, extra
|
|
168
|
-
end
|
|
169
|
-
end
|
|
170
|
-
end
|
|
171
|
-
|
|
172
|
-
def self.generate_tests klass
|
|
173
|
-
install_missing_reporter
|
|
174
|
-
clone_same
|
|
175
|
-
|
|
176
|
-
output_name = klass.name.to_s.sub(/^Test/, "")
|
|
177
|
-
|
|
178
|
-
input_name = self.previous(output_name)
|
|
179
|
-
|
|
180
|
-
@@testcases.each do |node, data|
|
|
181
|
-
next if [:skip, :unsupported].include? data[input_name]
|
|
182
|
-
next if data[output_name] == :skip
|
|
183
|
-
|
|
184
|
-
generate_test klass, node, data, input_name, output_name
|
|
185
|
-
end
|
|
186
|
-
end
|
|
187
|
-
|
|
188
|
-
def self.inherited klass
|
|
189
|
-
super
|
|
190
|
-
|
|
191
|
-
generate_tests klass unless klass.name =~ /TestCase/
|
|
192
|
-
end
|
|
193
|
-
|
|
194
|
-
def self.install_missing_reporter
|
|
195
|
-
unless defined? $missing then
|
|
196
|
-
$missing = Hash.new { |h,k| h[k] = [] }
|
|
197
|
-
at_exit {
|
|
198
|
-
at_exit {
|
|
199
|
-
warn ""
|
|
200
|
-
$missing.sort.each do |name, klasses|
|
|
201
|
-
warn "add_tests(#{name.inspect},"
|
|
202
|
-
klasses.map! { |klass| " #{klass.inspect} => :same" }
|
|
203
|
-
warn klasses.join("\n") + ")"
|
|
204
|
-
end
|
|
205
|
-
warn ""
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
end
|
|
209
|
-
end
|
|
210
|
-
|
|
211
|
-
def self.previous key, extra=0 # FIX: remove R2C code
|
|
212
|
-
idx = @@testcase_order.index(key)
|
|
213
|
-
|
|
214
|
-
raise "Unknown class #{key} in @@testcase_order" if idx.nil?
|
|
215
|
-
|
|
216
|
-
case key
|
|
217
|
-
when "RubyToRubyC" then
|
|
218
|
-
idx -= 1
|
|
219
|
-
end
|
|
220
|
-
@@testcase_order[idx - 1 - extra]
|
|
221
|
-
end
|
|
222
|
-
|
|
223
|
-
def self.testcase_order; @@testcase_order; end
|
|
224
|
-
def self.testcases; @@testcases; end
|
|
225
|
-
|
|
226
|
-
def self.unsupported_tests *tests
|
|
227
|
-
tests.flatten.each do |name|
|
|
228
|
-
add_test name, :unsupported
|
|
229
|
-
end
|
|
230
|
-
end
|
|
231
|
-
|
|
232
|
-
############################################################
|
|
233
|
-
# Shared TestCases:
|
|
234
|
-
|
|
235
|
-
@@testcase_order = %w(Ruby ParseTree)
|
|
236
|
-
|
|
237
|
-
@@testcases = Hash.new { |h,k| h[k] = {} }
|
|
238
|
-
|
|
239
|
-
###
|
|
240
|
-
# 1.8 specific tests
|
|
241
|
-
|
|
242
|
-
add_18tests("call_arglist_norm_hash_splat",
|
|
243
|
-
"Ruby" => "o.m(42, :a => 1, :b => 2, *c)",
|
|
244
|
-
"ParseTree" => s(:call,
|
|
245
|
-
s(:call, nil, :o), :m,
|
|
246
|
-
s(:lit, 42),
|
|
247
|
-
s(:hash,
|
|
248
|
-
s(:lit, :a), s(:lit, 1),
|
|
249
|
-
s(:lit, :b), s(:lit, 2)),
|
|
250
|
-
s(:splat, s(:call, nil, :c))))
|
|
251
|
-
|
|
252
|
-
add_18tests("call_arglist_space",
|
|
253
|
-
"Ruby" => "a (1,2,3)",
|
|
254
|
-
"ParseTree" => s(:call, nil, :a,
|
|
255
|
-
s(:lit, 1), s(:lit, 2), s(:lit, 3)),
|
|
256
|
-
"Ruby2Ruby" => "a(1, 2, 3)")
|
|
257
|
-
|
|
258
|
-
add_18tests("fcall_arglist_norm_hash_splat",
|
|
259
|
-
"Ruby" => "m(42, :a => 1, :b => 2, *c)",
|
|
260
|
-
"ParseTree" => s(:call, nil, :m,
|
|
261
|
-
s(:lit, 42),
|
|
262
|
-
s(:hash,
|
|
263
|
-
s(:lit, :a), s(:lit, 1),
|
|
264
|
-
s(:lit, :b), s(:lit, 2)),
|
|
265
|
-
s(:splat, s(:call, nil, :c))))
|
|
266
|
-
|
|
267
|
-
add_18tests("if_args_no_space_symbol",
|
|
268
|
-
"Ruby" => "x if y:z",
|
|
269
|
-
"ParseTree" => s(:if,
|
|
270
|
-
s(:call, nil, :y, s(:lit, :z)),
|
|
271
|
-
s(:call, nil, :x),
|
|
272
|
-
nil),
|
|
273
|
-
"Ruby2Ruby" => "x if y(:z)")
|
|
274
|
-
|
|
275
|
-
add_18tests("if_post_not",
|
|
276
|
-
"Ruby" => "a if not b",
|
|
277
|
-
"ParseTree" => s(:if, s(:call, nil, :b), nil,
|
|
278
|
-
s(:call, nil, :a)),
|
|
279
|
-
"Ruby2Ruby" => "a unless b")
|
|
280
|
-
|
|
281
|
-
add_18tests("if_pre_not",
|
|
282
|
-
"Ruby" => "if not b then a end",
|
|
283
|
-
"ParseTree" => s(:if, s(:call, nil, :b), nil,
|
|
284
|
-
s(:call, nil, :a)),
|
|
285
|
-
"Ruby2Ruby" => "a unless b")
|
|
286
|
-
|
|
287
|
-
add_18tests("iter_args_ivar",
|
|
288
|
-
"Ruby" => "a { |@a| 42 }",
|
|
289
|
-
"ParseTree" => s(:iter,
|
|
290
|
-
s(:call, nil, :a),
|
|
291
|
-
s(:args, :@a),
|
|
292
|
-
s(:lit, 42)))
|
|
293
|
-
|
|
294
|
-
add_18tests("iter_masgn_args_ivar",
|
|
295
|
-
"Ruby" => "a { |a, @b| 42 }",
|
|
296
|
-
"ParseTree" => s(:iter,
|
|
297
|
-
s(:call, nil, :a),
|
|
298
|
-
s(:args, :a, :@b),
|
|
299
|
-
s(:lit, 42)))
|
|
300
|
-
|
|
301
|
-
add_18tests("not",
|
|
302
|
-
"Ruby" => "(not true)",
|
|
303
|
-
"ParseTree" => s(:not, s(:true)))
|
|
304
|
-
|
|
305
|
-
add_18tests("str_question_control",
|
|
306
|
-
"Ruby" => '?\M-\C-a',
|
|
307
|
-
"ParseTree" => s(:lit, 129),
|
|
308
|
-
"Ruby2Ruby" => "129")
|
|
309
|
-
|
|
310
|
-
add_18tests("str_question_escape",
|
|
311
|
-
"Ruby" => '?\n',
|
|
312
|
-
"ParseTree" => s(:lit, 10),
|
|
313
|
-
"Ruby2Ruby" => "10")
|
|
314
|
-
|
|
315
|
-
add_18tests("str_question_literal",
|
|
316
|
-
"Ruby" => "?a",
|
|
317
|
-
"ParseTree" => s(:lit, 97),
|
|
318
|
-
"Ruby2Ruby" => "97")
|
|
319
|
-
|
|
320
|
-
add_18tests("unless_post_not",
|
|
321
|
-
"Ruby" => "a unless not b",
|
|
322
|
-
"ParseTree" => s(:if, s(:call, nil, :b),
|
|
323
|
-
s(:call, nil, :a), nil),
|
|
324
|
-
"Ruby2Ruby" => "a if b")
|
|
325
|
-
|
|
326
|
-
add_18tests("unless_pre_not",
|
|
327
|
-
"Ruby" => "unless not b then a end",
|
|
328
|
-
"ParseTree" => s(:if, s(:call, nil, :b),
|
|
329
|
-
s(:call, nil, :a), nil),
|
|
330
|
-
"Ruby2Ruby" => "a if b")
|
|
331
|
-
|
|
332
|
-
add_18tests("until_post_not",
|
|
333
|
-
"Ruby" => "begin\n (1 + 1)\nend until not true",
|
|
334
|
-
"ParseTree" => s(:while, s(:true),
|
|
335
|
-
s(:call, s(:lit, 1), :+, s(:lit, 1)), false),
|
|
336
|
-
"Ruby2Ruby" => "begin\n (1 + 1)\nend while true")
|
|
337
|
-
|
|
338
|
-
add_18tests("until_pre_not",
|
|
339
|
-
"Ruby" => "until not true do\n (1 + 1)\nend",
|
|
340
|
-
"ParseTree" => s(:while, s(:true),
|
|
341
|
-
s(:call, s(:lit, 1), :+, s(:lit, 1)), true),
|
|
342
|
-
"Ruby2Ruby" => "while true do\n (1 + 1)\nend")
|
|
343
|
-
|
|
344
|
-
add_18tests("until_pre_not_mod",
|
|
345
|
-
"Ruby" => "(1 + 1) until not true",
|
|
346
|
-
"ParseTree" => s(:while, s(:true),
|
|
347
|
-
s(:call, s(:lit, 1), :+, s(:lit, 1)), true),
|
|
348
|
-
"Ruby2Ruby" => "while true do\n (1 + 1)\nend")
|
|
349
|
-
|
|
350
|
-
add_18tests("while_post_not",
|
|
351
|
-
"Ruby" => "begin\n (1 + 1)\nend while not true",
|
|
352
|
-
"ParseTree" => s(:until, s(:true),
|
|
353
|
-
s(:call, s(:lit, 1), :+, s(:lit, 1)), false),
|
|
354
|
-
"Ruby2Ruby" => "begin\n (1 + 1)\nend until true")
|
|
355
|
-
|
|
356
|
-
add_18tests("while_pre_not",
|
|
357
|
-
"Ruby" => "while not true do\n (1 + 1)\nend",
|
|
358
|
-
"ParseTree" => s(:until, s(:true),
|
|
359
|
-
s(:call, s(:lit, 1), :+, s(:lit, 1)), true),
|
|
360
|
-
"Ruby2Ruby" => "until true do\n (1 + 1)\nend")
|
|
361
|
-
|
|
362
|
-
add_18tests("while_pre_not_mod",
|
|
363
|
-
"Ruby" => "(1 + 1) while not true",
|
|
364
|
-
"ParseTree" => s(:until, s(:true),
|
|
365
|
-
s(:call, s(:lit, 1), :+, s(:lit, 1)), true),
|
|
366
|
-
"Ruby2Ruby" => "until true do\n (1 + 1)\nend") # FIX
|
|
367
|
-
|
|
368
|
-
###
|
|
369
|
-
# 1.9 specific tests
|
|
370
|
-
|
|
371
|
-
add_19edgecases("-> () { (x + 1) }",
|
|
372
|
-
s(:iter,
|
|
373
|
-
s(:lambda),
|
|
374
|
-
s(:args),
|
|
375
|
-
s(:call, s(:call, nil, :x), :+, s(:lit, 1))),
|
|
376
|
-
"stabby_args" => "->() { (x + 1) }",
|
|
377
|
-
"stabby_args_doend" => "->() do (x + 1) end")
|
|
378
|
-
|
|
379
|
-
add_19edgecases("-> { (x + 1) }",
|
|
380
|
-
s(:iter,
|
|
381
|
-
s(:lambda),
|
|
382
|
-
0,
|
|
383
|
-
s(:call, s(:call, nil, :x), :+, s(:lit, 1))),
|
|
384
|
-
"stabby_args_0_no_parens" => "-> { (x + 1) }",
|
|
385
|
-
"stabby_args_0_no_parens_doend" => "-> do (x + 1) end",
|
|
386
|
-
"stabby_args_0_spacebar_broken" => "->{x+1}") # I hate you
|
|
387
|
-
|
|
388
|
-
add_19edgecases("-> (x, y) { (x + y) }",
|
|
389
|
-
s(:iter,
|
|
390
|
-
s(:lambda),
|
|
391
|
-
s(:args, :x, :y),
|
|
392
|
-
s(:call, s(:lvar, :x), :+, s(:lvar, :y))),
|
|
393
|
-
"stabby_args_2" => "->(x, y) { (x + y) }",
|
|
394
|
-
"stabby_args_2_doend" => "->(x, y) do (x + y) end",
|
|
395
|
-
"stabby_args_2_no_parens" => "-> x, y { (x + y) }",
|
|
396
|
-
"stabby_args_2_no_parens_doend" => "-> x, y do (x + y) end")
|
|
397
|
-
|
|
398
|
-
add_19edgecases("-> (x) { (x + 1) }",
|
|
399
|
-
s(:iter,
|
|
400
|
-
s(:lambda),
|
|
401
|
-
s(:args, :x),
|
|
402
|
-
s(:call, s(:lvar, :x), :+, s(:lit, 1))),
|
|
403
|
-
"stabby_args_1" => "->(x) { (x + 1) }",
|
|
404
|
-
"stabby_args_1_doend" => "->(x) do (x + 1) end",
|
|
405
|
-
"stabby_args_1_no_parens" => "-> x { (x + 1) }",
|
|
406
|
-
"stabby_args_1_no_parens_doend" => "-> x do (x + 1) end")
|
|
407
|
-
|
|
408
|
-
add_19tests("array_bare_hash",
|
|
409
|
-
"Ruby" => "[:a, :b => :c]",
|
|
410
|
-
"ParseTree" => s(:array,
|
|
411
|
-
s(:lit, :a),
|
|
412
|
-
s(:hash,
|
|
413
|
-
s(:lit, :b),
|
|
414
|
-
s(:lit, :c))),
|
|
415
|
-
"Ruby2Ruby" => "[:a, { :b => :c }]")
|
|
416
|
-
|
|
417
|
-
add_19tests("array_bare_hash_labels",
|
|
418
|
-
"Ruby" => "[:a, b: :c]",
|
|
419
|
-
"ParseTree" => s(:array,
|
|
420
|
-
s(:lit, :a),
|
|
421
|
-
s(:hash,
|
|
422
|
-
s(:lit, :b),
|
|
423
|
-
s(:lit, :c))),
|
|
424
|
-
"Ruby2Ruby" => "[:a, { :b => :c }]")
|
|
425
|
-
|
|
426
|
-
add_19tests("call_arglist_norm_hash_colons",
|
|
427
|
-
"Ruby" => "o.m(42, a: 1, b: 2)",
|
|
428
|
-
"ParseTree" => s(:call,
|
|
429
|
-
s(:call, nil, :o),
|
|
430
|
-
:m,
|
|
431
|
-
s(:lit, 42),
|
|
432
|
-
s(:hash,
|
|
433
|
-
s(:lit, :a), s(:lit, 1),
|
|
434
|
-
s(:lit, :b), s(:lit, 2))),
|
|
435
|
-
"Ruby2Ruby" => "o.m(42, :a => 1, :b => 2)")
|
|
436
|
-
|
|
437
|
-
add_19tests("call_arglist_trailing_comma",
|
|
438
|
-
"Ruby" => "a(1,2,3,)",
|
|
439
|
-
"ParseTree" => s(:call,
|
|
440
|
-
nil,
|
|
441
|
-
:a,
|
|
442
|
-
s(:lit, 1), s(:lit, 2), s(:lit, 3)),
|
|
443
|
-
"Ruby2Ruby" => "a(1, 2, 3)")
|
|
444
|
-
|
|
445
|
-
add_19tests("call_bang",
|
|
446
|
-
"Ruby" => "!a",
|
|
447
|
-
"ParseTree" => s(:call,
|
|
448
|
-
s(:call, nil, :a),
|
|
449
|
-
:"!"),
|
|
450
|
-
"Ruby2Ruby" => "(not a)")
|
|
451
|
-
|
|
452
|
-
add_19tests("call_bang_empty",
|
|
453
|
-
"Ruby" => "! ()",
|
|
454
|
-
"ParseTree" => s(:call, s(:nil), :"!"),
|
|
455
|
-
"Ruby2Ruby" => "(not nil)")
|
|
456
|
-
|
|
457
|
-
add_19tests("call_fonz",
|
|
458
|
-
"Ruby" => "a.()",
|
|
459
|
-
"ParseTree" => s(:call, s(:call, nil, :a), :call),
|
|
460
|
-
"Ruby2Ruby" => "a.call")
|
|
461
|
-
|
|
462
|
-
add_19tests("call_fonz_cm",
|
|
463
|
-
"Ruby" => "a::()",
|
|
464
|
-
"ParseTree" => s(:call, s(:call, nil, :a), :call),
|
|
465
|
-
"Ruby2Ruby" => "a.call")
|
|
466
|
-
|
|
467
|
-
add_19tests("call_not",
|
|
468
|
-
"Ruby" => "not (42)",
|
|
469
|
-
"ParseTree" => s(:call, s(:lit, 42), :"!"),
|
|
470
|
-
"Ruby2Ruby" => "(not 42)")
|
|
471
|
-
|
|
472
|
-
# add_19tests("call_not_empty",
|
|
473
|
-
# "Ruby" => "not ()",
|
|
474
|
-
# "ParseTree" => s(:call, s(:lit, 42), :"!"))
|
|
475
|
-
|
|
476
|
-
add_19tests("call_not_equal",
|
|
477
|
-
"Ruby" => "a != b",
|
|
478
|
-
"ParseTree" => s(:call,
|
|
479
|
-
s(:call, nil, :a),
|
|
480
|
-
:"!=",
|
|
481
|
-
s(:call, nil, :b)),
|
|
482
|
-
"Ruby2Ruby" => "(a != b)")
|
|
483
|
-
|
|
484
|
-
add_19tests("call_splat_mid",
|
|
485
|
-
"Ruby" => "def f(a = nil, *b, c)\n # do nothing\nend",
|
|
486
|
-
"ParseTree" => s(:defn, :f,
|
|
487
|
-
s(:args, s(:lasgn, :a, s(:nil)), :"*b", :c),
|
|
488
|
-
s(:nil)))
|
|
489
|
-
|
|
490
|
-
add_19tests("defn_args_mand_opt_mand",
|
|
491
|
-
"Ruby" => "def f(mand1, opt = 42, mand2)\n # do nothing\nend",
|
|
492
|
-
"ParseTree" => s(:defn, :f,
|
|
493
|
-
s(:args, :mand1, s(:lasgn, :opt, s(:lit, 42)), :mand2),
|
|
494
|
-
s(:nil)))
|
|
495
|
-
|
|
496
|
-
add_19tests("defn_args_mand_opt_splat_mand",
|
|
497
|
-
"Ruby" => "def f(mand1, opt = 42, *rest, mand2)\n # do nothing\nend",
|
|
498
|
-
"ParseTree" => s(:defn, :f,
|
|
499
|
-
s(:args, :mand1, s(:lasgn, :opt, s(:lit, 42)), :"*rest", :mand2),
|
|
500
|
-
s(:nil)))
|
|
501
|
-
|
|
502
|
-
add_19tests("defn_args_opt_mand",
|
|
503
|
-
"Ruby" => "def f(opt = 42, mand)\n # do nothing\nend",
|
|
504
|
-
"ParseTree" => s(:defn, :f,
|
|
505
|
-
s(:args, s(:lasgn, :opt, s(:lit, 42)), :mand),
|
|
506
|
-
s(:nil)))
|
|
507
|
-
|
|
508
|
-
add_19tests("defn_args_opt_splat_mand",
|
|
509
|
-
"Ruby" => "def f(opt = 42, *rest, mand)\n # do nothing\nend",
|
|
510
|
-
"ParseTree" => s(:defn, :f,
|
|
511
|
-
s(:args, s(:lasgn, :opt, s(:lit, 42)), :"*rest", :mand),
|
|
512
|
-
s(:nil)))
|
|
513
|
-
|
|
514
|
-
add_19tests("defn_args_splat_mand",
|
|
515
|
-
"Ruby" => "def f(*rest, mand)\n # do nothing\nend",
|
|
516
|
-
"ParseTree" => s(:defn, :f,
|
|
517
|
-
s(:args, :"*rest", :mand),
|
|
518
|
-
s(:nil)))
|
|
519
|
-
|
|
520
|
-
add_19tests("defn_args_splat_middle",
|
|
521
|
-
"Ruby" => "def f(first, *middle, last)\n # do nothing\nend",
|
|
522
|
-
"ParseTree" => s(:defn, :f,
|
|
523
|
-
s(:args, :first, :"*middle", :last),
|
|
524
|
-
s(:nil)))
|
|
525
|
-
|
|
526
|
-
add_19tests("fcall_arglist_hash_colons",
|
|
527
|
-
"Ruby" => "m(a: 1, b: 2)",
|
|
528
|
-
"ParseTree" => s(:call, nil, :m,
|
|
529
|
-
s(:hash,
|
|
530
|
-
s(:lit, :a), s(:lit, 1),
|
|
531
|
-
s(:lit, :b), s(:lit, 2))),
|
|
532
|
-
"Ruby2Ruby" => "m(:a => 1, :b => 2)")
|
|
533
|
-
|
|
534
|
-
add_19tests("hash_new",
|
|
535
|
-
"Ruby" => "{ a: 1, b: 2 }",
|
|
536
|
-
"ParseTree" => s(:hash,
|
|
537
|
-
s(:lit, :a), s(:lit, 1),
|
|
538
|
-
s(:lit, :b), s(:lit, 2)),
|
|
539
|
-
"Ruby2Ruby" => "{ :a => 1, :b => 2 }")
|
|
540
|
-
|
|
541
|
-
add_19tests("hash_new_no_space",
|
|
542
|
-
"Ruby" => "{a:1,b:2}",
|
|
543
|
-
"ParseTree" => s(:hash,
|
|
544
|
-
s(:lit, :a), s(:lit, 1),
|
|
545
|
-
s(:lit, :b), s(:lit, 2)),
|
|
546
|
-
"Ruby2Ruby" => "{ :a => 1, :b => 2 }")
|
|
547
|
-
|
|
548
|
-
add_19tests("hash_new_with_keyword",
|
|
549
|
-
"Ruby" => "{ true: 1, b: 2 }",
|
|
550
|
-
"ParseTree" => s(:hash,
|
|
551
|
-
s(:lit, :true), s(:lit, 1),
|
|
552
|
-
s(:lit, :b), s(:lit, 2)),
|
|
553
|
-
"Ruby2Ruby" => "{ :true => 1, :b => 2 }")
|
|
554
|
-
|
|
555
|
-
add_19tests("if_post_not",
|
|
556
|
-
"Ruby" => "a if not b",
|
|
557
|
-
"ParseTree" => s(:if, s(:call, s(:call, nil, :b), :"!"),
|
|
558
|
-
s(:call, nil, :a),
|
|
559
|
-
nil),
|
|
560
|
-
"Ruby2Ruby" => "a unless b")
|
|
561
|
-
|
|
562
|
-
add_19tests("if_pre_not",
|
|
563
|
-
"Ruby" => "if not b then a end",
|
|
564
|
-
"ParseTree" => s(:if, s(:call, s(:call, nil, :b), :"!"),
|
|
565
|
-
s(:call, nil, :a),
|
|
566
|
-
nil),
|
|
567
|
-
"Ruby2Ruby" => "a unless b")
|
|
568
|
-
|
|
569
|
-
add_19tests("label_in_bare_hash_in_array_in_ternary",
|
|
570
|
-
"Ruby" => "1 ? [:a, b: 2] : 1",
|
|
571
|
-
"ParseTree" => s(:if, s(:lit, 1),
|
|
572
|
-
s(:array,
|
|
573
|
-
s(:lit, :a),
|
|
574
|
-
s(:hash, s(:lit, :b), s(:lit, 2))),
|
|
575
|
-
s(:lit, 1)),
|
|
576
|
-
"Ruby2Ruby" => "1 ? ([:a, { :b => 2 }]) : (1)")
|
|
577
|
-
|
|
578
|
-
add_19tests("label_in_callargs_in_ternary",
|
|
579
|
-
"Ruby" => "1 ? m(a: 2) : 1",
|
|
580
|
-
"ParseTree" => s(:if, s(:lit, 1),
|
|
581
|
-
s(:call, nil, :m,
|
|
582
|
-
s(:hash, s(:lit, :a), s(:lit, 2))),
|
|
583
|
-
s(:lit, 1)),
|
|
584
|
-
"Ruby2Ruby" => "1 ? (m(:a => 2)) : (1)")
|
|
585
|
-
|
|
586
|
-
add_19tests("not",
|
|
587
|
-
"Ruby" => "(not true)",
|
|
588
|
-
"ParseTree" => s(:call, s(:true), :"!"))
|
|
589
|
-
|
|
590
|
-
add_19tests("splat_fcall_middle",
|
|
591
|
-
"Ruby" => "meth(1, *[2], 3)",
|
|
592
|
-
"ParseTree" => s(:call,
|
|
593
|
-
nil,
|
|
594
|
-
:meth,
|
|
595
|
-
s(:lit, 1),
|
|
596
|
-
s(:splat, s(:array, s(:lit, 2))),
|
|
597
|
-
s(:lit, 3)))
|
|
598
|
-
|
|
599
|
-
add_19tests("str_question_control",
|
|
600
|
-
"Ruby" => '?\M-\C-a',
|
|
601
|
-
"ParseTree" => s(:str, "\x81"),
|
|
602
|
-
"Ruby2Ruby" => "\"\\x81\"")
|
|
603
|
-
|
|
604
|
-
add_19tests("str_question_escape",
|
|
605
|
-
"Ruby" => '?\n',
|
|
606
|
-
"ParseTree" => s(:str, "\n"),
|
|
607
|
-
"Ruby2Ruby" => "\"\\n\"")
|
|
608
|
-
|
|
609
|
-
add_19tests("str_question_literal",
|
|
610
|
-
"Ruby" => "?a",
|
|
611
|
-
"ParseTree" => s(:str, "a"),
|
|
612
|
-
"Ruby2Ruby" => '"a"')
|
|
613
|
-
|
|
614
|
-
add_19tests("unless_post_not",
|
|
615
|
-
"Ruby" => "a unless not b",
|
|
616
|
-
"ParseTree" => s(:if, s(:call, s(:call, nil, :b), :"!"),
|
|
617
|
-
nil,
|
|
618
|
-
s(:call, nil, :a)),
|
|
619
|
-
"Ruby2Ruby" => "a if b")
|
|
620
|
-
|
|
621
|
-
add_19tests("unless_pre_not",
|
|
622
|
-
"Ruby" => "unless not b then a end",
|
|
623
|
-
"ParseTree" => s(:if, s(:call, s(:call, nil, :b), :"!"),
|
|
624
|
-
nil,
|
|
625
|
-
s(:call, nil, :a)),
|
|
626
|
-
"Ruby2Ruby" => "a if b")
|
|
627
|
-
|
|
628
|
-
add_19tests("until_post_not",
|
|
629
|
-
"Ruby" => "begin\n (1 + 1)\nend until not true",
|
|
630
|
-
"ParseTree" => s(:until, s(:call, s(:true), :"!"),
|
|
631
|
-
s(:call, s(:lit, 1), :+, s(:lit, 1)), false),
|
|
632
|
-
"Ruby2Ruby" => "begin\n (1 + 1)\nend while true")
|
|
633
|
-
|
|
634
|
-
add_19tests("until_pre_not",
|
|
635
|
-
"Ruby" => "until not true do\n (1 + 1)\nend",
|
|
636
|
-
"ParseTree" => s(:until, s(:call, s(:true), :"!"),
|
|
637
|
-
s(:call, s(:lit, 1), :+, s(:lit, 1)), true),
|
|
638
|
-
"Ruby2Ruby" => "while true do\n (1 + 1)\nend")
|
|
639
|
-
|
|
640
|
-
add_19tests("until_pre_not_mod",
|
|
641
|
-
"Ruby" => "(1 + 1) until not true",
|
|
642
|
-
"ParseTree" => s(:until, s(:call, s(:true), :"!"),
|
|
643
|
-
s(:call, s(:lit, 1), :+, s(:lit, 1)), true),
|
|
644
|
-
"Ruby2Ruby" => "while true do\n (1 + 1)\nend")
|
|
645
|
-
|
|
646
|
-
add_19tests("while_post_not",
|
|
647
|
-
"Ruby" => "begin\n (1 + 1)\nend while not true",
|
|
648
|
-
"ParseTree" => s(:while, s(:call, s(:true), :"!"),
|
|
649
|
-
s(:call, s(:lit, 1), :+, s(:lit, 1)), false),
|
|
650
|
-
"Ruby2Ruby" => "begin\n (1 + 1)\nend until true")
|
|
651
|
-
|
|
652
|
-
add_19tests("while_pre_not",
|
|
653
|
-
"Ruby" => "while not true do\n (1 + 1)\nend",
|
|
654
|
-
"ParseTree" => s(:while, s(:call, s(:true), :"!"),
|
|
655
|
-
s(:call, s(:lit, 1), :+, s(:lit, 1)), true),
|
|
656
|
-
"Ruby2Ruby" => "until true do\n (1 + 1)\nend")
|
|
657
|
-
|
|
658
|
-
add_19tests("while_pre_not_mod",
|
|
659
|
-
"Ruby" => "(1 + 1) while not true",
|
|
660
|
-
"ParseTree" => s(:while, s(:call, s(:true), :"!"),
|
|
661
|
-
s(:call, s(:lit, 1), :+, s(:lit, 1)), true),
|
|
662
|
-
"Ruby2Ruby" => "until true do\n (1 + 1)\nend") # FIX
|
|
663
|
-
|
|
664
|
-
###
|
|
665
|
-
# Shared tests:
|
|
666
|
-
|
|
667
|
-
add_tests("alias",
|
|
668
|
-
"Ruby" => "class X\n alias :y :x\nend",
|
|
669
|
-
"ParseTree" => s(:class, :X, nil,
|
|
670
|
-
s(:alias, s(:lit, :y), s(:lit, :x))))
|
|
671
|
-
|
|
672
|
-
add_tests("alias_ugh",
|
|
673
|
-
"Ruby" => "class X\n alias y x\nend",
|
|
674
|
-
"ParseTree" => s(:class, :X, nil,
|
|
675
|
-
s(:alias, s(:lit, :y), s(:lit, :x))),
|
|
676
|
-
"Ruby2Ruby" => "class X\n alias :y :x\nend")
|
|
677
|
-
|
|
678
|
-
add_tests("and",
|
|
679
|
-
"Ruby" => "a and b",
|
|
680
|
-
"ParseTree" => s(:and,
|
|
681
|
-
s(:call, nil, :a),
|
|
682
|
-
s(:call, nil, :b)))
|
|
683
|
-
|
|
684
|
-
add_tests("argscat_inside",
|
|
685
|
-
"Ruby" => "a = [b, *c]",
|
|
686
|
-
"ParseTree" => s(:lasgn, :a,
|
|
687
|
-
s(:array,
|
|
688
|
-
s(:call, nil, :b),
|
|
689
|
-
s(:splat, s(:call, nil, :c)))))
|
|
690
|
-
|
|
691
|
-
add_tests("argscat_svalue",
|
|
692
|
-
"Ruby" => "a = b, c, *d",
|
|
693
|
-
"ParseTree" => s(:lasgn, :a,
|
|
694
|
-
s(:svalue,
|
|
695
|
-
s(:array,
|
|
696
|
-
s(:call, nil, :b),
|
|
697
|
-
s(:call, nil, :c),
|
|
698
|
-
s(:splat,
|
|
699
|
-
s(:call, nil, :d))))))
|
|
700
|
-
|
|
701
|
-
add_tests("argspush",
|
|
702
|
-
"Ruby" => "a[*b] = c",
|
|
703
|
-
"ParseTree" => s(:attrasgn,
|
|
704
|
-
s(:call, nil, :a),
|
|
705
|
-
:[]=,
|
|
706
|
-
s(:splat,
|
|
707
|
-
s(:call, nil, :b)),
|
|
708
|
-
s(:call, nil, :c)))
|
|
709
|
-
|
|
710
|
-
add_tests("array",
|
|
711
|
-
"Ruby" => "[1, :b, \"c\"]",
|
|
712
|
-
"ParseTree" => s(:array, s(:lit, 1), s(:lit, :b), s(:str, "c")))
|
|
713
|
-
|
|
714
|
-
add_tests("array_pct_W",
|
|
715
|
-
"Ruby" => "%W[a b c]",
|
|
716
|
-
"ParseTree" => s(:array,
|
|
717
|
-
s(:str, "a"), s(:str, "b"), s(:str, "c")),
|
|
718
|
-
"Ruby2Ruby" => "[\"a\", \"b\", \"c\"]")
|
|
719
|
-
|
|
720
|
-
add_tests("array_pct_W_dstr",
|
|
721
|
-
"Ruby" => "%W[a #\{@b} c]",
|
|
722
|
-
"ParseTree" => s(:array,
|
|
723
|
-
s(:str, "a"),
|
|
724
|
-
s(:dstr, "", s(:evstr, s(:ivar, :@b))),
|
|
725
|
-
s(:str, "c")),
|
|
726
|
-
"Ruby2Ruby" => "[\"a\", \"#\{@b}\", \"c\"]")
|
|
727
|
-
|
|
728
|
-
add_tests("array_pct_w",
|
|
729
|
-
"Ruby" => "%w[a b c]",
|
|
730
|
-
"ParseTree" => s(:array,
|
|
731
|
-
s(:str, "a"), s(:str, "b"), s(:str, "c")),
|
|
732
|
-
"Ruby2Ruby" => "[\"a\", \"b\", \"c\"]")
|
|
733
|
-
|
|
734
|
-
add_tests("array_pct_w_dstr",
|
|
735
|
-
"Ruby" => "%w[a #\{@b} c]",
|
|
736
|
-
"ParseTree" => s(:array,
|
|
737
|
-
s(:str, "a"),
|
|
738
|
-
s(:str, "#\{@b}"),
|
|
739
|
-
s(:str, "c")),
|
|
740
|
-
"Ruby2Ruby" => "[\"a\", \"\\\#{@b}\", \"c\"]") # TODO: huh?
|
|
741
|
-
|
|
742
|
-
add_tests("attrasgn",
|
|
743
|
-
"Ruby" => "y = 0\n42.method = y\n",
|
|
744
|
-
"ParseTree" => s(:block,
|
|
745
|
-
s(:lasgn, :y, s(:lit, 0)),
|
|
746
|
-
s(:attrasgn,
|
|
747
|
-
s(:lit, 42), :method=, s(:lvar, :y))))
|
|
748
|
-
|
|
749
|
-
add_tests("attrasgn_index_equals",
|
|
750
|
-
"Ruby" => "a[42] = 24",
|
|
751
|
-
"ParseTree" => s(:attrasgn,
|
|
752
|
-
s(:call, nil, :a),
|
|
753
|
-
:[]=,
|
|
754
|
-
s(:lit, 42), s(:lit, 24)))
|
|
755
|
-
|
|
756
|
-
add_tests("attrasgn_index_equals_space",
|
|
757
|
-
"Ruby" => "a = []; a [42] = 24",
|
|
758
|
-
"ParseTree" => s(:block,
|
|
759
|
-
s(:lasgn, :a, s(:array)),
|
|
760
|
-
s(:attrasgn, s(:lvar, :a), :[]=,
|
|
761
|
-
s(:lit, 42), s(:lit, 24))),
|
|
762
|
-
"Ruby2Ruby" => "a = []\na[42] = 24\n")
|
|
763
|
-
|
|
764
|
-
add_tests("back_ref",
|
|
765
|
-
"Ruby" => "[$&, $`, $', $+]",
|
|
766
|
-
"ParseTree" => s(:array,
|
|
767
|
-
s(:back_ref, :&),
|
|
768
|
-
s(:back_ref, :"`"),
|
|
769
|
-
s(:back_ref, :"'"),
|
|
770
|
-
s(:back_ref, :+)))
|
|
771
|
-
|
|
772
|
-
add_tests("begin",
|
|
773
|
-
"Ruby" => "begin\n (1 + 1)\nend",
|
|
774
|
-
"ParseTree" => s(:call, s(:lit, 1), :+, s(:lit, 1)),
|
|
775
|
-
"Ruby2Ruby" => "(1 + 1)")
|
|
776
|
-
|
|
777
|
-
add_tests("begin_def",
|
|
778
|
-
"Ruby" => "def m\n begin\n\n end\nend",
|
|
779
|
-
"ParseTree" => s(:defn, :m, s(:args), s(:nil)),
|
|
780
|
-
"Ruby2Ruby" => "def m\n # do nothing\nend")
|
|
781
|
-
|
|
782
|
-
add_tests("begin_rescue_ensure",
|
|
783
|
-
"Ruby" => "begin\n a\nrescue\n # do nothing\nensure\n # do nothing\nend",
|
|
784
|
-
"ParseTree" => s(:ensure,
|
|
785
|
-
s(:rescue,
|
|
786
|
-
s(:call, nil, :a),
|
|
787
|
-
s(:resbody, s(:array), nil)),
|
|
788
|
-
s(:nil)))
|
|
789
|
-
|
|
790
|
-
add_tests("begin_rescue_ensure_all_empty",
|
|
791
|
-
"Ruby" => "begin\n # do nothing\nrescue\n # do nothing\nensure\n # do nothing\nend",
|
|
792
|
-
"ParseTree" => s(:ensure,
|
|
793
|
-
s(:rescue,
|
|
794
|
-
s(:resbody, s(:array), nil)),
|
|
795
|
-
s(:nil)))
|
|
796
|
-
|
|
797
|
-
add_tests("begin_rescue_twice",
|
|
798
|
-
"Ruby" => "begin\n a\nrescue => mes\n # do nothing\nend\nbegin\n b\nrescue => mes\n # do nothing\nend\n",
|
|
799
|
-
"ParseTree" => s(:block,
|
|
800
|
-
s(:rescue,
|
|
801
|
-
s(:call, nil, :a),
|
|
802
|
-
s(:resbody,
|
|
803
|
-
s(:array, s(:lasgn, :mes, s(:gvar, :$!))),
|
|
804
|
-
nil)),
|
|
805
|
-
s(:rescue,
|
|
806
|
-
s(:call, nil, :b),
|
|
807
|
-
s(:resbody,
|
|
808
|
-
s(:array,
|
|
809
|
-
s(:lasgn, :mes, s(:gvar, :$!))),
|
|
810
|
-
nil))))
|
|
811
|
-
copy_test_case "begin_rescue_twice", "Ruby"
|
|
812
|
-
copy_test_case "begin_rescue_twice", "ParseTree"
|
|
813
|
-
|
|
814
|
-
add_tests("block_attrasgn",
|
|
815
|
-
"Ruby" => "def self.setup(ctx)\n bind = allocate\n bind.context = ctx\n return bind\nend",
|
|
816
|
-
"ParseTree" => s(:defs, s(:self), :setup,
|
|
817
|
-
s(:args, :ctx),
|
|
818
|
-
s(:lasgn, :bind, s(:call, nil, :allocate)),
|
|
819
|
-
s(:attrasgn,
|
|
820
|
-
s(:lvar, :bind), :context=, s(:lvar, :ctx)),
|
|
821
|
-
s(:return, s(:lvar, :bind))))
|
|
822
|
-
|
|
823
|
-
add_tests("block_lasgn",
|
|
824
|
-
"Ruby" => "x = (y = 1\n(y + 2))",
|
|
825
|
-
"ParseTree" => s(:lasgn, :x,
|
|
826
|
-
s(:block,
|
|
827
|
-
s(:lasgn, :y, s(:lit, 1)),
|
|
828
|
-
s(:call, s(:lvar, :y), :+, s(:lit, 2)))))
|
|
829
|
-
|
|
830
|
-
add_tests("block_mystery_block",
|
|
831
|
-
"Ruby" => "a(b) do\n if b then\n true\n else\n c = false\n d { |x| c = true }\n c\n end\nend",
|
|
832
|
-
"ParseTree" => s(:iter,
|
|
833
|
-
s(:call, nil, :a, s(:call, nil, :b)),
|
|
834
|
-
0,
|
|
835
|
-
s(:if,
|
|
836
|
-
s(:call, nil, :b),
|
|
837
|
-
s(:true),
|
|
838
|
-
s(:block,
|
|
839
|
-
s(:lasgn, :c, s(:false)),
|
|
840
|
-
s(:iter,
|
|
841
|
-
s(:call, nil, :d),
|
|
842
|
-
s(:args, :x),
|
|
843
|
-
s(:lasgn, :c, s(:true))),
|
|
844
|
-
s(:lvar, :c)))))
|
|
845
|
-
|
|
846
|
-
add_tests("block_pass_args_and_splat",
|
|
847
|
-
"Ruby" => "def blah(*args, &block)\n other(42, *args, &block)\nend",
|
|
848
|
-
"ParseTree" => s(:defn, :blah, s(:args, :"*args", :"&block"),
|
|
849
|
-
s(:call, nil, :other,
|
|
850
|
-
s(:lit, 42),
|
|
851
|
-
s(:splat, s(:lvar, :args)),
|
|
852
|
-
s(:block_pass, s(:lvar, :block)))))
|
|
853
|
-
|
|
854
|
-
add_tests("block_pass_call_0",
|
|
855
|
-
"Ruby" => "a.b(&c)",
|
|
856
|
-
"ParseTree" => s(:call,
|
|
857
|
-
s(:call, nil, :a),
|
|
858
|
-
:b,
|
|
859
|
-
s(:block_pass, s(:call, nil, :c))))
|
|
860
|
-
|
|
861
|
-
add_tests("block_pass_call_1",
|
|
862
|
-
"Ruby" => "a.b(4, &c)",
|
|
863
|
-
"ParseTree" => s(:call,
|
|
864
|
-
s(:call, nil, :a),
|
|
865
|
-
:b,
|
|
866
|
-
s(:lit, 4),
|
|
867
|
-
s(:block_pass, s(:call, nil, :c))))
|
|
868
|
-
|
|
869
|
-
add_tests("block_pass_call_n",
|
|
870
|
-
"Ruby" => "a.b(1, 2, 3, &c)",
|
|
871
|
-
"ParseTree" => s(:call,
|
|
872
|
-
s(:call, nil, :a),
|
|
873
|
-
:b,
|
|
874
|
-
s(:lit, 1), s(:lit, 2), s(:lit, 3),
|
|
875
|
-
s(:block_pass, s(:call, nil, :c))))
|
|
876
|
-
|
|
877
|
-
add_tests("block_pass_fcall_0",
|
|
878
|
-
"Ruby" => "a(&b)",
|
|
879
|
-
"ParseTree" => s(:call, nil, :a,
|
|
880
|
-
s(:block_pass, s(:call, nil, :b))))
|
|
881
|
-
|
|
882
|
-
add_tests("block_pass_fcall_1",
|
|
883
|
-
"Ruby" => "a(4, &b)",
|
|
884
|
-
"ParseTree" => s(:call, nil, :a,
|
|
885
|
-
s(:lit, 4),
|
|
886
|
-
s(:block_pass, s(:call, nil, :b))))
|
|
887
|
-
|
|
888
|
-
add_tests("block_pass_fcall_n",
|
|
889
|
-
"Ruby" => "a(1, 2, 3, &b)",
|
|
890
|
-
"ParseTree" => s(:call, nil, :a,
|
|
891
|
-
s(:lit, 1), s(:lit, 2), s(:lit, 3),
|
|
892
|
-
s(:block_pass, s(:call, nil, :b))))
|
|
893
|
-
|
|
894
|
-
add_tests("block_pass_omgwtf",
|
|
895
|
-
"Ruby" => "define_attr_method(:x, :sequence_name, &Proc.new { |*args| nil })",
|
|
896
|
-
"ParseTree" => s(:call, nil, :define_attr_method,
|
|
897
|
-
s(:lit, :x),
|
|
898
|
-
s(:lit, :sequence_name),
|
|
899
|
-
s(:block_pass,
|
|
900
|
-
s(:iter,
|
|
901
|
-
s(:call, s(:const, :Proc), :new),
|
|
902
|
-
s(:args, :"*args"),
|
|
903
|
-
s(:nil)))))
|
|
904
|
-
|
|
905
|
-
add_tests("block_pass_splat",
|
|
906
|
-
"Ruby" => "def blah(*args, &block)\n other(*args, &block)\nend",
|
|
907
|
-
"ParseTree" => s(:defn, :blah,
|
|
908
|
-
s(:args, :"*args", :"&block"),
|
|
909
|
-
s(:call, nil, :other,
|
|
910
|
-
s(:splat, s(:lvar, :args)),
|
|
911
|
-
s(:block_pass, s(:lvar, :block)))))
|
|
912
|
-
|
|
913
|
-
add_tests("block_pass_thingy",
|
|
914
|
-
"Ruby" => "r.read_body(dest, &block)",
|
|
915
|
-
"ParseTree" => s(:call,
|
|
916
|
-
s(:call, nil, :r),
|
|
917
|
-
:read_body,
|
|
918
|
-
s(:call, nil, :dest),
|
|
919
|
-
s(:block_pass, s(:call, nil, :block))))
|
|
920
|
-
|
|
921
|
-
add_tests("block_stmt_after",
|
|
922
|
-
"Ruby" => "def f\n begin\n b\n rescue\n c\n end\n\n d\nend",
|
|
923
|
-
"ParseTree" => s(:defn, :f, s(:args),
|
|
924
|
-
s(:rescue,
|
|
925
|
-
s(:call, nil, :b),
|
|
926
|
-
s(:resbody,
|
|
927
|
-
s(:array),
|
|
928
|
-
s(:call, nil, :c))),
|
|
929
|
-
s(:call, nil, :d)),
|
|
930
|
-
"Ruby2Ruby" => "def f\n b rescue c\n d\nend")
|
|
931
|
-
copy_test_case "block_stmt_after", "Ruby"
|
|
932
|
-
copy_test_case "block_stmt_after", "ParseTree"
|
|
933
|
-
copy_test_case "block_stmt_after", "Ruby2Ruby"
|
|
934
|
-
|
|
935
|
-
add_tests("block_stmt_before",
|
|
936
|
-
"Ruby" => "def f\n a\n begin\n b\n rescue\n c\n end\nend",
|
|
937
|
-
"ParseTree" => s(:defn, :f, s(:args),
|
|
938
|
-
s(:call, nil, :a),
|
|
939
|
-
s(:rescue, s(:call, nil, :b),
|
|
940
|
-
s(:resbody,
|
|
941
|
-
s(:array),
|
|
942
|
-
s(:call, nil, :c)))),
|
|
943
|
-
"Ruby2Ruby" => "def f\n a\n b rescue c\nend")
|
|
944
|
-
# oddly... this one doesn't HAVE any differences when verbose... new?
|
|
945
|
-
copy_test_case "block_stmt_before", "Ruby"
|
|
946
|
-
copy_test_case "block_stmt_before", "ParseTree"
|
|
947
|
-
copy_test_case "block_stmt_before", "Ruby2Ruby"
|
|
948
|
-
|
|
949
|
-
add_tests("block_stmt_both",
|
|
950
|
-
"Ruby" => "def f\n a\n begin\n b\n rescue\n c\n end\n d\nend",
|
|
951
|
-
"ParseTree" => s(:defn, :f, s(:args),
|
|
952
|
-
s(:call, nil, :a),
|
|
953
|
-
s(:rescue,
|
|
954
|
-
s(:call, nil, :b),
|
|
955
|
-
s(:resbody,
|
|
956
|
-
s(:array),
|
|
957
|
-
s(:call, nil, :c))),
|
|
958
|
-
s(:call, nil, :d)),
|
|
959
|
-
"Ruby2Ruby" => "def f\n a\n b rescue c\n d\nend")
|
|
960
|
-
copy_test_case "block_stmt_both", "Ruby"
|
|
961
|
-
copy_test_case "block_stmt_both", "ParseTree"
|
|
962
|
-
copy_test_case "block_stmt_both", "Ruby2Ruby"
|
|
963
|
-
|
|
964
|
-
add_tests("bmethod",
|
|
965
|
-
"Ruby" => [Examples, :unsplatted],
|
|
966
|
-
"ParseTree" => s(:defn, :unsplatted, s(:args, :x),
|
|
967
|
-
s(:call, s(:lvar, :x), :+, s(:lit, 1))),
|
|
968
|
-
"Ruby2Ruby" => "def unsplatted(x)\n (x + 1)\nend")
|
|
969
|
-
|
|
970
|
-
add_tests("bmethod_noargs",
|
|
971
|
-
"Ruby" => [Examples, :bmethod_noargs],
|
|
972
|
-
"ParseTree" => s(:defn, :bmethod_noargs, s(:args),
|
|
973
|
-
s(:call,
|
|
974
|
-
s(:call, nil, :x),
|
|
975
|
-
:"+",
|
|
976
|
-
s(:lit, 1))),
|
|
977
|
-
"Ruby2Ruby" => "def bmethod_noargs\n (x + 1)\nend")
|
|
978
|
-
|
|
979
|
-
add_tests("bmethod_splat",
|
|
980
|
-
"Ruby" => [Examples, :splatted],
|
|
981
|
-
"ParseTree" => s(:defn, :splatted, s(:args, :"*args"),
|
|
982
|
-
s(:lasgn, :y,
|
|
983
|
-
s(:call, s(:lvar, :args), :first)),
|
|
984
|
-
s(:call, s(:lvar, :y), :+, s(:lit, 42))),
|
|
985
|
-
"Ruby2Ruby" => "def splatted(*args)\n y = args.first\n (y + 42)\nend")
|
|
986
|
-
|
|
987
|
-
add_tests("break",
|
|
988
|
-
"Ruby" => "loop { break if true }",
|
|
989
|
-
"ParseTree" => s(:iter,
|
|
990
|
-
s(:call, nil, :loop),
|
|
991
|
-
0,
|
|
992
|
-
s(:if, s(:true), s(:break), nil)))
|
|
993
|
-
|
|
994
|
-
add_tests("break_arg",
|
|
995
|
-
"Ruby" => "loop { break 42 if true }",
|
|
996
|
-
"ParseTree" => s(:iter,
|
|
997
|
-
s(:call, nil, :loop),
|
|
998
|
-
0,
|
|
999
|
-
s(:if, s(:true), s(:break, s(:lit, 42)), nil)))
|
|
1000
|
-
|
|
1001
|
-
add_tests("call",
|
|
1002
|
-
"Ruby" => "self.method",
|
|
1003
|
-
"ParseTree" => s(:call, s(:self), :method))
|
|
1004
|
-
|
|
1005
|
-
add_tests("call_arglist",
|
|
1006
|
-
"Ruby" => "o.puts(42)",
|
|
1007
|
-
"ParseTree" => s(:call, s(:call, nil, :o), :puts, s(:lit, 42)))
|
|
1008
|
-
|
|
1009
|
-
add_tests("call_arglist_hash",
|
|
1010
|
-
"Ruby" => "o.m(:a => 1, :b => 2)",
|
|
1011
|
-
"ParseTree" => s(:call,
|
|
1012
|
-
s(:call, nil, :o), :m,
|
|
1013
|
-
s(:hash,
|
|
1014
|
-
s(:lit, :a), s(:lit, 1),
|
|
1015
|
-
s(:lit, :b), s(:lit, 2))))
|
|
1016
|
-
|
|
1017
|
-
add_tests("call_arglist_norm_hash",
|
|
1018
|
-
"Ruby" => "o.m(42, :a => 1, :b => 2)",
|
|
1019
|
-
"ParseTree" => s(:call,
|
|
1020
|
-
s(:call, nil, :o), :m,
|
|
1021
|
-
s(:lit, 42),
|
|
1022
|
-
s(:hash,
|
|
1023
|
-
s(:lit, :a), s(:lit, 1),
|
|
1024
|
-
s(:lit, :b), s(:lit, 2))))
|
|
1025
|
-
|
|
1026
|
-
add_tests("call_command",
|
|
1027
|
-
"Ruby" => "1.b(c)",
|
|
1028
|
-
"ParseTree" => s(:call,
|
|
1029
|
-
s(:lit, 1),
|
|
1030
|
-
:b,
|
|
1031
|
-
s(:call, nil, :c)))
|
|
1032
|
-
|
|
1033
|
-
add_tests("call_expr",
|
|
1034
|
-
"Ruby" => "(v = (1 + 1)).zero?",
|
|
1035
|
-
"ParseTree" => s(:call,
|
|
1036
|
-
s(:lasgn, :v,
|
|
1037
|
-
s(:call, s(:lit, 1), :+, s(:lit, 1))),
|
|
1038
|
-
:zero?))
|
|
1039
|
-
|
|
1040
|
-
add_tests("call_index",
|
|
1041
|
-
"Ruby" => "a = []\na[42]\n",
|
|
1042
|
-
"ParseTree" => s(:block,
|
|
1043
|
-
s(:lasgn, :a, s(:array)),
|
|
1044
|
-
s(:call, s(:lvar, :a), :[], s(:lit, 42))))
|
|
1045
|
-
|
|
1046
|
-
add_tests("call_index_no_args",
|
|
1047
|
-
"Ruby" => "a[]",
|
|
1048
|
-
"ParseTree" => s(:call, s(:call, nil, :a),
|
|
1049
|
-
:[]))
|
|
1050
|
-
|
|
1051
|
-
add_tests("call_index_space",
|
|
1052
|
-
"Ruby" => "a = []\na [42]\n",
|
|
1053
|
-
"ParseTree" => s(:block,
|
|
1054
|
-
s(:lasgn, :a, s(:array)),
|
|
1055
|
-
s(:call, s(:lvar, :a), :[], s(:lit, 42))),
|
|
1056
|
-
"Ruby2Ruby" => "a = []\na[42]\n")
|
|
1057
|
-
|
|
1058
|
-
add_tests("call_no_space_symbol",
|
|
1059
|
-
"Ruby" => "foo:bar",
|
|
1060
|
-
"ParseTree" => s(:call, nil, :foo, s(:lit, :bar)),
|
|
1061
|
-
"Ruby2Ruby" => "foo(:bar)")
|
|
1062
|
-
|
|
1063
|
-
add_tests("call_unary_neg",
|
|
1064
|
-
"Ruby" => "-2**31",
|
|
1065
|
-
"ParseTree" => s(:call,
|
|
1066
|
-
s(:call, s(:lit, 2), :**, s(:lit, 31)),
|
|
1067
|
-
:-@),
|
|
1068
|
-
"Ruby2Ruby" => "-(2 ** 31)")
|
|
1069
|
-
|
|
1070
|
-
add_tests("case",
|
|
1071
|
-
"Ruby" => "var = 2\nresult = \"\"\ncase var\nwhen 1 then\n puts(\"something\")\n result = \"red\"\nwhen 2, 3 then\n result = \"yellow\"\nwhen 4 then\n # do nothing\nelse\n result = \"green\"\nend\ncase result\nwhen \"red\" then\n var = 1\nwhen \"yellow\" then\n var = 2\nwhen \"green\" then\n var = 3\nelse\n # do nothing\nend\n",
|
|
1072
|
-
"ParseTree" => s(:block,
|
|
1073
|
-
s(:lasgn, :var, s(:lit, 2)),
|
|
1074
|
-
s(:lasgn, :result, s(:str, "")),
|
|
1075
|
-
s(:case,
|
|
1076
|
-
s(:lvar, :var),
|
|
1077
|
-
s(:when,
|
|
1078
|
-
s(:array, s(:lit, 1)),
|
|
1079
|
-
s(:call, nil, :puts, s(:str, "something")),
|
|
1080
|
-
s(:lasgn, :result, s(:str, "red"))),
|
|
1081
|
-
s(:when,
|
|
1082
|
-
s(:array, s(:lit, 2), s(:lit, 3)),
|
|
1083
|
-
s(:lasgn, :result, s(:str, "yellow"))),
|
|
1084
|
-
s(:when, s(:array, s(:lit, 4)), nil),
|
|
1085
|
-
s(:lasgn, :result, s(:str, "green"))),
|
|
1086
|
-
s(:case,
|
|
1087
|
-
s(:lvar, :result),
|
|
1088
|
-
s(:when, s(:array, s(:str, "red")),
|
|
1089
|
-
s(:lasgn, :var, s(:lit, 1))),
|
|
1090
|
-
s(:when, s(:array, s(:str, "yellow")),
|
|
1091
|
-
s(:lasgn, :var, s(:lit, 2))),
|
|
1092
|
-
s(:when, s(:array, s(:str, "green")),
|
|
1093
|
-
s(:lasgn, :var, s(:lit, 3))),
|
|
1094
|
-
nil)))
|
|
1095
|
-
|
|
1096
|
-
add_tests("case_nested",
|
|
1097
|
-
"Ruby" => "var1 = 1\nvar2 = 2\nresult = nil\ncase var1\nwhen 1 then\n case var2\n when 1 then\n result = 1\n when 2 then\n result = 2\n else\n result = 3\n end\nwhen 2 then\n case var2\n when 1 then\n result = 4\n when 2 then\n result = 5\n else\n result = 6\n end\nelse\n result = 7\nend\n",
|
|
1098
|
-
"ParseTree" => s(:block,
|
|
1099
|
-
s(:lasgn, :var1, s(:lit, 1)),
|
|
1100
|
-
s(:lasgn, :var2, s(:lit, 2)),
|
|
1101
|
-
s(:lasgn, :result, s(:nil)),
|
|
1102
|
-
s(:case,
|
|
1103
|
-
s(:lvar, :var1),
|
|
1104
|
-
s(:when, s(:array, s(:lit, 1)),
|
|
1105
|
-
s(:case,
|
|
1106
|
-
s(:lvar, :var2),
|
|
1107
|
-
s(:when, s(:array, s(:lit, 1)),
|
|
1108
|
-
s(:lasgn, :result, s(:lit, 1))),
|
|
1109
|
-
s(:when, s(:array, s(:lit, 2)),
|
|
1110
|
-
s(:lasgn, :result, s(:lit, 2))),
|
|
1111
|
-
s(:lasgn, :result, s(:lit, 3)))),
|
|
1112
|
-
s(:when, s(:array, s(:lit, 2)),
|
|
1113
|
-
s(:case,
|
|
1114
|
-
s(:lvar, :var2),
|
|
1115
|
-
s(:when, s(:array, s(:lit, 1)),
|
|
1116
|
-
s(:lasgn, :result, s(:lit, 4))),
|
|
1117
|
-
s(:when, s(:array, s(:lit, 2)),
|
|
1118
|
-
s(:lasgn, :result, s(:lit, 5))),
|
|
1119
|
-
s(:lasgn, :result, s(:lit, 6)))),
|
|
1120
|
-
s(:lasgn, :result, s(:lit, 7)))))
|
|
1121
|
-
|
|
1122
|
-
add_tests("case_nested_inner_no_expr",
|
|
1123
|
-
"Ruby" => "case a\nwhen b then\n case\n when (d and e) then\n f\n else\n # do nothing\n end\nelse\n # do nothing\nend",
|
|
1124
|
-
"ParseTree" => s(:case, s(:call, nil, :a),
|
|
1125
|
-
s(:when,
|
|
1126
|
-
s(:array, s(:call, nil, :b)),
|
|
1127
|
-
s(:case, nil,
|
|
1128
|
-
s(:when,
|
|
1129
|
-
s(:array,
|
|
1130
|
-
s(:and,
|
|
1131
|
-
s(:call, nil, :d),
|
|
1132
|
-
s(:call, nil, :e))),
|
|
1133
|
-
s(:call, nil, :f)),
|
|
1134
|
-
nil)),
|
|
1135
|
-
nil))
|
|
1136
|
-
|
|
1137
|
-
add_tests("case_no_expr",
|
|
1138
|
-
"Ruby" => "case\nwhen (a == 1) then\n :a\nwhen (a == 2) then\n :b\nelse\n :c\nend",
|
|
1139
|
-
"ParseTree" => s(:case, nil,
|
|
1140
|
-
s(:when,
|
|
1141
|
-
s(:array,
|
|
1142
|
-
s(:call,
|
|
1143
|
-
s(:call, nil, :a),
|
|
1144
|
-
:==,
|
|
1145
|
-
s(:lit, 1))),
|
|
1146
|
-
s(:lit, :a)),
|
|
1147
|
-
s(:when,
|
|
1148
|
-
s(:array,
|
|
1149
|
-
s(:call,
|
|
1150
|
-
s(:call, nil, :a),
|
|
1151
|
-
:==,
|
|
1152
|
-
s(:lit, 2))),
|
|
1153
|
-
s(:lit, :b)),
|
|
1154
|
-
s(:lit, :c)))
|
|
1155
|
-
|
|
1156
|
-
add_tests("case_splat",
|
|
1157
|
-
"Ruby" => "case a\nwhen :b, *c then\n d\nelse\n e\nend",
|
|
1158
|
-
"ParseTree" => s(:case, s(:call, nil, :a),
|
|
1159
|
-
s(:when,
|
|
1160
|
-
s(:array,
|
|
1161
|
-
s(:lit, :b),
|
|
1162
|
-
s(:splat, s(:call, nil, :c))),
|
|
1163
|
-
s(:call, nil, :d)),
|
|
1164
|
-
s(:call, nil, :e)))
|
|
1165
|
-
|
|
1166
|
-
add_tests("cdecl",
|
|
1167
|
-
"Ruby" => "X = 42",
|
|
1168
|
-
"ParseTree" => s(:cdecl, :X, s(:lit, 42)))
|
|
1169
|
-
|
|
1170
|
-
add_tests("class_plain",
|
|
1171
|
-
"Ruby" => "class X\n puts((1 + 1))\n \n def blah\n puts(\"hello\")\n end\nend",
|
|
1172
|
-
"ParseTree" => s(:class, :X, nil,
|
|
1173
|
-
s(:call, nil, :puts,
|
|
1174
|
-
s(:call, s(:lit, 1), :+, s(:lit, 1))),
|
|
1175
|
-
s(:defn, :blah, s(:args),
|
|
1176
|
-
s(:call, nil, :puts, s(:str, "hello")))))
|
|
1177
|
-
|
|
1178
|
-
add_tests("class_scoped",
|
|
1179
|
-
"Ruby" => "class X::Y\n c\nend",
|
|
1180
|
-
"ParseTree" => s(:class, s(:colon2, s(:const, :X), :Y), nil,
|
|
1181
|
-
s(:call, nil, :c)))
|
|
1182
|
-
|
|
1183
|
-
add_tests("class_scoped3",
|
|
1184
|
-
"Ruby" => "class ::Y\n c\nend",
|
|
1185
|
-
"ParseTree" => s(:class, s(:colon3, :Y), nil,
|
|
1186
|
-
s(:call, nil, :c)))
|
|
1187
|
-
|
|
1188
|
-
add_tests("class_super_array",
|
|
1189
|
-
"Ruby" => "class X < Array\nend",
|
|
1190
|
-
"ParseTree" => s(:class, :X, s(:const, :Array)))
|
|
1191
|
-
|
|
1192
|
-
add_tests("class_super_expr",
|
|
1193
|
-
"Ruby" => "class X < expr\nend",
|
|
1194
|
-
"ParseTree" => s(:class, :X, s(:call, nil, :expr)))
|
|
1195
|
-
|
|
1196
|
-
add_tests("class_super_object",
|
|
1197
|
-
"Ruby" => "class X < Object\nend",
|
|
1198
|
-
"ParseTree" => s(:class, :X, s(:const, :Object)))
|
|
1199
|
-
|
|
1200
|
-
add_tests("colon2",
|
|
1201
|
-
"Ruby" => "X::Y",
|
|
1202
|
-
"ParseTree" => s(:colon2, s(:const, :X), :Y))
|
|
1203
|
-
|
|
1204
|
-
add_tests("colon3",
|
|
1205
|
-
"Ruby" => "::X",
|
|
1206
|
-
"ParseTree" => s(:colon3, :X))
|
|
1207
|
-
|
|
1208
|
-
add_tests("const",
|
|
1209
|
-
"Ruby" => "X",
|
|
1210
|
-
"ParseTree" => s(:const, :X))
|
|
1211
|
-
|
|
1212
|
-
add_tests("constX",
|
|
1213
|
-
"Ruby" => "X = 1",
|
|
1214
|
-
"ParseTree" => s(:cdecl, :X, s(:lit, 1)))
|
|
1215
|
-
|
|
1216
|
-
add_tests("constY",
|
|
1217
|
-
"Ruby" => "::X = 1",
|
|
1218
|
-
"ParseTree" => s(:cdecl, s(:colon3, :X), s(:lit, 1)))
|
|
1219
|
-
|
|
1220
|
-
add_tests("constZ",
|
|
1221
|
-
"Ruby" => "X::Y = 1",
|
|
1222
|
-
"ParseTree" => s(:cdecl,
|
|
1223
|
-
s(:colon2, s(:const, :X), :Y),
|
|
1224
|
-
s(:lit, 1)))
|
|
1225
|
-
|
|
1226
|
-
add_tests("cvar",
|
|
1227
|
-
"Ruby" => "@@x",
|
|
1228
|
-
"ParseTree" => s(:cvar, :@@x))
|
|
1229
|
-
|
|
1230
|
-
add_tests("cvasgn",
|
|
1231
|
-
"Ruby" => "def x\n @@blah = 1\nend",
|
|
1232
|
-
"ParseTree" => s(:defn, :x, s(:args),
|
|
1233
|
-
s(:cvasgn, :@@blah, s(:lit, 1))))
|
|
1234
|
-
|
|
1235
|
-
add_tests("cvasgn_cls_method",
|
|
1236
|
-
"Ruby" => "def self.quiet_mode=(boolean)\n @@quiet_mode = boolean\nend",
|
|
1237
|
-
"ParseTree" => s(:defs, s(:self), :quiet_mode=,
|
|
1238
|
-
s(:args, :boolean),
|
|
1239
|
-
s(:cvasgn, :@@quiet_mode,
|
|
1240
|
-
s(:lvar, :boolean))))
|
|
1241
|
-
|
|
1242
|
-
add_tests("cvdecl",
|
|
1243
|
-
"Ruby" => "class X\n @@blah = 1\nend",
|
|
1244
|
-
"ParseTree" => s(:class, :X, nil,
|
|
1245
|
-
s(:cvdecl, :@@blah, s(:lit, 1))))
|
|
1246
|
-
|
|
1247
|
-
add_tests("dasgn_0",
|
|
1248
|
-
"Ruby" => "a.each { |x| b.each { |y| x = (x + 1) } if true }",
|
|
1249
|
-
"ParseTree" => s(:iter,
|
|
1250
|
-
s(:call, s(:call, nil, :a), :each),
|
|
1251
|
-
s(:args, :x),
|
|
1252
|
-
s(:if, s(:true),
|
|
1253
|
-
s(:iter,
|
|
1254
|
-
s(:call, s(:call, nil, :b), :each),
|
|
1255
|
-
s(:args, :y),
|
|
1256
|
-
s(:lasgn, :x,
|
|
1257
|
-
s(:call, s(:lvar, :x), :+, s(:lit, 1)))),
|
|
1258
|
-
nil)))
|
|
1259
|
-
|
|
1260
|
-
add_tests("dasgn_1",
|
|
1261
|
-
"Ruby" => "a.each { |x| b.each { |y| c = (c + 1) } if true }",
|
|
1262
|
-
"ParseTree" => s(:iter,
|
|
1263
|
-
s(:call, s(:call, nil, :a), :each),
|
|
1264
|
-
s(:args, :x),
|
|
1265
|
-
s(:if, s(:true),
|
|
1266
|
-
s(:iter,
|
|
1267
|
-
s(:call, s(:call, nil, :b), :each),
|
|
1268
|
-
s(:args, :y),
|
|
1269
|
-
s(:lasgn, :c,
|
|
1270
|
-
s(:call, s(:lvar, :c), :+, s(:lit, 1)))),
|
|
1271
|
-
nil)))
|
|
1272
|
-
|
|
1273
|
-
add_tests("dasgn_2",
|
|
1274
|
-
"Ruby" => "a.each do |x|\n if true then\n c = 0\n b.each { |y| c = (c + 1) }\n end\nend",
|
|
1275
|
-
"ParseTree" => s(:iter,
|
|
1276
|
-
s(:call, s(:call, nil, :a), :each),
|
|
1277
|
-
s(:args, :x),
|
|
1278
|
-
s(:if, s(:true),
|
|
1279
|
-
s(:block,
|
|
1280
|
-
s(:lasgn, :c, s(:lit, 0)),
|
|
1281
|
-
s(:iter,
|
|
1282
|
-
s(:call, s(:call, nil, :b), :each),
|
|
1283
|
-
s(:args, :y),
|
|
1284
|
-
s(:lasgn, :c,
|
|
1285
|
-
s(:call, s(:lvar, :c), :+,
|
|
1286
|
-
s(:lit, 1))))),
|
|
1287
|
-
nil)))
|
|
1288
|
-
|
|
1289
|
-
add_tests("dasgn_curr",
|
|
1290
|
-
"Ruby" => "data.each do |x, y|\n a = 1\n b = a\n b = a = x\nend",
|
|
1291
|
-
"ParseTree" => s(:iter,
|
|
1292
|
-
s(:call, s(:call, nil, :data), :each),
|
|
1293
|
-
s(:args, :x, :y),
|
|
1294
|
-
s(:block,
|
|
1295
|
-
s(:lasgn, :a, s(:lit, 1)),
|
|
1296
|
-
s(:lasgn, :b, s(:lvar, :a)),
|
|
1297
|
-
s(:lasgn, :b, s(:lasgn, :a, s(:lvar, :x))))))
|
|
1298
|
-
|
|
1299
|
-
add_tests("dasgn_icky",
|
|
1300
|
-
"Ruby" => "a do\n v = nil\n assert_block(full_message) do\n begin\n yield\n rescue Exception => v\n break\n end\n end\nend",
|
|
1301
|
-
"ParseTree" => s(:iter,
|
|
1302
|
-
s(:call, nil, :a),
|
|
1303
|
-
0,
|
|
1304
|
-
s(:block,
|
|
1305
|
-
s(:lasgn, :v, s(:nil)),
|
|
1306
|
-
s(:iter,
|
|
1307
|
-
s(:call, nil, :assert_block,
|
|
1308
|
-
s(:call, nil, :full_message)),
|
|
1309
|
-
0,
|
|
1310
|
-
s(:rescue,
|
|
1311
|
-
s(:yield),
|
|
1312
|
-
s(:resbody,
|
|
1313
|
-
s(:array,
|
|
1314
|
-
s(:const, :Exception),
|
|
1315
|
-
s(:lasgn, :v, s(:gvar, :$!))),
|
|
1316
|
-
s(:break)))))))
|
|
1317
|
-
|
|
1318
|
-
add_tests("dasgn_mixed",
|
|
1319
|
-
"Ruby" => "t = 0\nns.each { |n| t += n }\n",
|
|
1320
|
-
"ParseTree" => s(:block,
|
|
1321
|
-
s(:lasgn, :t, s(:lit, 0)),
|
|
1322
|
-
s(:iter,
|
|
1323
|
-
s(:call, s(:call, nil, :ns), :each),
|
|
1324
|
-
s(:args, :n),
|
|
1325
|
-
s(:lasgn, :t,
|
|
1326
|
-
s(:call, s(:lvar, :t), :+, s(:lvar, :n))))),
|
|
1327
|
-
"Ruby2Ruby" => "t = 0\nns.each { |n| t = (t + n) }\n")
|
|
1328
|
-
|
|
1329
|
-
add_tests("defined",
|
|
1330
|
-
"Ruby" => "defined? $x",
|
|
1331
|
-
"ParseTree" => s(:defined, s(:gvar, :$x)))
|
|
1332
|
-
|
|
1333
|
-
add_tests("defn_args_block", # TODO: make all the defn_args* p their arglist
|
|
1334
|
-
"Ruby" => "def f(&block)\n # do nothing\nend",
|
|
1335
|
-
"ParseTree" => s(:defn, :f, s(:args, :"&block"),
|
|
1336
|
-
s(:nil)))
|
|
1337
|
-
|
|
1338
|
-
add_tests("defn_args_mand",
|
|
1339
|
-
"Ruby" => "def f(mand)\n # do nothing\nend",
|
|
1340
|
-
"ParseTree" => s(:defn, :f, s(:args, :mand),
|
|
1341
|
-
s(:nil)))
|
|
1342
|
-
|
|
1343
|
-
add_tests("defn_args_mand_block",
|
|
1344
|
-
"Ruby" => "def f(mand, &block)\n # do nothing\nend",
|
|
1345
|
-
"ParseTree" => s(:defn, :f, s(:args, :mand, :"&block"),
|
|
1346
|
-
s(:nil)))
|
|
1347
|
-
|
|
1348
|
-
add_tests("defn_args_mand_opt",
|
|
1349
|
-
"Ruby" => "def f(mand, opt = 42)\n # do nothing\nend",
|
|
1350
|
-
"ParseTree" => s(:defn, :f,
|
|
1351
|
-
s(:args, :mand, s(:lasgn, :opt, s(:lit, 42))),
|
|
1352
|
-
s(:nil)))
|
|
1353
|
-
|
|
1354
|
-
add_tests("defn_args_mand_opt_block",
|
|
1355
|
-
"Ruby" => "def f(mand, opt = 42, &block)\n # do nothing\nend",
|
|
1356
|
-
"ParseTree" => s(:defn, :f,
|
|
1357
|
-
s(:args, :mand, s(:lasgn, :opt, s(:lit, 42)), :"&block"),
|
|
1358
|
-
s(:nil)))
|
|
1359
|
-
|
|
1360
|
-
add_tests("defn_args_mand_opt_splat",
|
|
1361
|
-
"Ruby" => "def f(mand, opt = 42, *rest)\n # do nothing\nend",
|
|
1362
|
-
"ParseTree" => s(:defn, :f,
|
|
1363
|
-
s(:args, :mand, s(:lasgn, :opt, s(:lit, 42)), :"*rest"),
|
|
1364
|
-
s(:nil)))
|
|
1365
|
-
|
|
1366
|
-
add_tests("defn_args_mand_opt_splat_block",
|
|
1367
|
-
"Ruby" => "def f(mand, opt = 42, *rest, &block)\n # do nothing\nend",
|
|
1368
|
-
"ParseTree" => s(:defn, :f,
|
|
1369
|
-
s(:args, :mand, s(:lasgn, :opt, s(:lit, 42)), :"*rest", :"&block"),
|
|
1370
|
-
s(:nil)))
|
|
1371
|
-
|
|
1372
|
-
add_tests("defn_args_mand_opt_splat_no_name",
|
|
1373
|
-
"Ruby" => "def x(a, b = 42, *)\n # do nothing\nend",
|
|
1374
|
-
"ParseTree" => s(:defn, :x,
|
|
1375
|
-
s(:args, :a, s(:lasgn, :b, s(:lit, 42)), :"*"),
|
|
1376
|
-
s(:nil)))
|
|
1377
|
-
|
|
1378
|
-
add_tests("defn_args_mand_splat",
|
|
1379
|
-
"Ruby" => "def f(mand, *rest)\n # do nothing\nend",
|
|
1380
|
-
"ParseTree" => s(:defn, :f,
|
|
1381
|
-
s(:args, :mand, :"*rest"),
|
|
1382
|
-
s(:nil)))
|
|
1383
|
-
|
|
1384
|
-
add_tests("defn_args_mand_splat_block",
|
|
1385
|
-
"Ruby" => "def f(mand, *rest, &block)\n # do nothing\nend",
|
|
1386
|
-
"ParseTree" => s(:defn, :f,
|
|
1387
|
-
s(:args, :mand, :"*rest", :"&block"),
|
|
1388
|
-
s(:nil)))
|
|
1389
|
-
|
|
1390
|
-
add_tests("defn_args_mand_splat_no_name",
|
|
1391
|
-
"Ruby" => "def x(a, *args)\n p(a, args)\nend",
|
|
1392
|
-
"ParseTree" => s(:defn, :x, s(:args, :a, :"*args"),
|
|
1393
|
-
s(:call, nil, :p,
|
|
1394
|
-
s(:lvar, :a), s(:lvar, :args))))
|
|
1395
|
-
|
|
1396
|
-
add_tests("defn_args_none",
|
|
1397
|
-
"Ruby" => "def empty\n # do nothing\nend",
|
|
1398
|
-
"ParseTree" => s(:defn, :empty, s(:args),
|
|
1399
|
-
s(:nil)))
|
|
1400
|
-
|
|
1401
|
-
add_tests("defn_args_opt",
|
|
1402
|
-
"Ruby" => "def f(opt = 42)\n # do nothing\nend",
|
|
1403
|
-
"ParseTree" => s(:defn, :f,
|
|
1404
|
-
s(:args, s(:lasgn, :opt, s(:lit, 42))),
|
|
1405
|
-
s(:nil)))
|
|
1406
|
-
|
|
1407
|
-
add_tests("defn_args_opt_block",
|
|
1408
|
-
"Ruby" => "def f(opt = 42, &block)\n # do nothing\nend",
|
|
1409
|
-
"ParseTree" => s(:defn, :f,
|
|
1410
|
-
s(:args, s(:lasgn, :opt, s(:lit, 42)), :"&block"),
|
|
1411
|
-
s(:nil)))
|
|
1412
|
-
|
|
1413
|
-
add_tests("defn_args_opt_splat",
|
|
1414
|
-
"Ruby" => "def f(opt = 42, *rest)\n # do nothing\nend",
|
|
1415
|
-
"ParseTree" => s(:defn, :f,
|
|
1416
|
-
s(:args, s(:lasgn, :opt, s(:lit, 42)), :"*rest"),
|
|
1417
|
-
s(:nil)))
|
|
1418
|
-
|
|
1419
|
-
add_tests("defn_args_opt_splat_block",
|
|
1420
|
-
"Ruby" => "def f(opt = 42, *rest, &block)\n # do nothing\nend",
|
|
1421
|
-
"ParseTree" => s(:defn, :f,
|
|
1422
|
-
s(:args,
|
|
1423
|
-
s(:lasgn, :opt, s(:lit, 42)),
|
|
1424
|
-
:"*rest", :"&block"),
|
|
1425
|
-
s(:nil)))
|
|
1426
|
-
|
|
1427
|
-
add_tests("defn_args_opt_splat_no_name",
|
|
1428
|
-
"Ruby" => "def x(b = 42, *)\n # do nothing\nend",
|
|
1429
|
-
"ParseTree" => s(:defn, :x,
|
|
1430
|
-
s(:args, s(:lasgn, :b, s(:lit, 42)), :"*"),
|
|
1431
|
-
s(:nil)))
|
|
1432
|
-
|
|
1433
|
-
add_tests("defn_args_splat",
|
|
1434
|
-
"Ruby" => "def f(*rest)\n # do nothing\nend",
|
|
1435
|
-
"ParseTree" => s(:defn, :f, s(:args, :"*rest"),
|
|
1436
|
-
s(:nil)))
|
|
1437
|
-
|
|
1438
|
-
add_tests("defn_args_splat_no_name",
|
|
1439
|
-
"Ruby" => "def x(*)\n # do nothing\nend",
|
|
1440
|
-
"ParseTree" => s(:defn, :x, s(:args, :"*"),
|
|
1441
|
-
s(:nil)))
|
|
1442
|
-
|
|
1443
|
-
add_tests("defn_or",
|
|
1444
|
-
"Ruby" => "def |(o)\n # do nothing\nend",
|
|
1445
|
-
"ParseTree" => s(:defn, :|, s(:args, :o),
|
|
1446
|
-
s(:nil)))
|
|
1447
|
-
|
|
1448
|
-
add_tests("defn_rescue",
|
|
1449
|
-
"Ruby" => "def eql?(resource)\n (self.uuid == resource.uuid)\nrescue\n false\nend",
|
|
1450
|
-
"ParseTree" => s(:defn, :eql?,
|
|
1451
|
-
s(:args, :resource),
|
|
1452
|
-
s(:rescue,
|
|
1453
|
-
s(:call,
|
|
1454
|
-
s(:call, s(:self), :uuid),
|
|
1455
|
-
:==,
|
|
1456
|
-
s(:call, s(:lvar, :resource), :uuid)),
|
|
1457
|
-
s(:resbody, s(:array), s(:false)))),
|
|
1458
|
-
"Ruby2Ruby" => "def eql?(resource)\n (self.uuid == resource.uuid) rescue false\nend")
|
|
1459
|
-
|
|
1460
|
-
add_tests("defn_rescue_mri_verbose_flag",
|
|
1461
|
-
"Ruby" => "def eql?(resource)\n (self.uuid == resource.uuid)\nrescue\n false\nend",
|
|
1462
|
-
"ParseTree" => s(:defn, :eql?,
|
|
1463
|
-
s(:args, :resource),
|
|
1464
|
-
s(:rescue,
|
|
1465
|
-
s(:call,
|
|
1466
|
-
s(:call, s(:self), :uuid),
|
|
1467
|
-
:==,
|
|
1468
|
-
s(:call, s(:lvar, :resource), :uuid)),
|
|
1469
|
-
s(:resbody, s(:array), s(:false)))),
|
|
1470
|
-
"Ruby2Ruby" => "def eql?(resource)\n (self.uuid == resource.uuid) rescue false\nend")
|
|
1471
|
-
|
|
1472
|
-
add_tests("defn_something_eh",
|
|
1473
|
-
"Ruby" => "def something?\n # do nothing\nend",
|
|
1474
|
-
"ParseTree" => s(:defn, :something?,
|
|
1475
|
-
s(:args),
|
|
1476
|
-
s(:nil)))
|
|
1477
|
-
|
|
1478
|
-
add_tests("defn_splat_no_name",
|
|
1479
|
-
"Ruby" => "def x(a, *)\n p(a)\nend",
|
|
1480
|
-
"ParseTree" => s(:defn, :x,
|
|
1481
|
-
s(:args, :a, :"*"),
|
|
1482
|
-
s(:call, nil, :p, s(:lvar, :a))))
|
|
1483
|
-
|
|
1484
|
-
add_tests("defn_zarray",
|
|
1485
|
-
"Ruby" => "def zarray\n a = []\n return a\nend",
|
|
1486
|
-
"ParseTree" => s(:defn, :zarray,
|
|
1487
|
-
s(:args),
|
|
1488
|
-
s(:lasgn, :a, s(:array)),
|
|
1489
|
-
s(:return, s(:lvar, :a))))
|
|
1490
|
-
|
|
1491
|
-
add_tests("defs",
|
|
1492
|
-
"Ruby" => "def self.x(y)\n (y + 1)\nend",
|
|
1493
|
-
"ParseTree" => s(:defs, s(:self), :x,
|
|
1494
|
-
s(:args, :y),
|
|
1495
|
-
s(:call, s(:lvar, :y), :+, s(:lit, 1))))
|
|
1496
|
-
|
|
1497
|
-
add_tests("defs_empty",
|
|
1498
|
-
"Ruby" => "def self.empty\n # do nothing\nend",
|
|
1499
|
-
"ParseTree" => s(:defs, s(:self), :empty, s(:args), s(:nil)))
|
|
1500
|
-
|
|
1501
|
-
add_tests("defs_empty_args",
|
|
1502
|
-
"Ruby" => "def self.empty(*)\n # do nothing\nend",
|
|
1503
|
-
"ParseTree" => s(:defs, s(:self), :empty,
|
|
1504
|
-
s(:args, :*),
|
|
1505
|
-
s(:nil)))
|
|
1506
|
-
|
|
1507
|
-
add_tests("defs_expr_wtf",
|
|
1508
|
-
"Ruby" => "def (a.b).empty(*)\n # do nothing\nend",
|
|
1509
|
-
"ParseTree" => s(:defs,
|
|
1510
|
-
s(:call, s(:call, nil, :a), :b),
|
|
1511
|
-
:empty,
|
|
1512
|
-
s(:args, :*),
|
|
1513
|
-
s(:nil)))
|
|
1514
|
-
|
|
1515
|
-
add_tests("dmethod",
|
|
1516
|
-
"Ruby" => [Examples, :dmethod_added],
|
|
1517
|
-
"ParseTree" => s(:defn, :dmethod_added,
|
|
1518
|
-
s(:args, :x),
|
|
1519
|
-
s(:call, s(:lvar, :x), :+, s(:lit, 1))),
|
|
1520
|
-
"Ruby2Ruby" => "def dmethod_added(x)\n (x + 1)\nend")
|
|
1521
|
-
|
|
1522
|
-
add_tests("dot2",
|
|
1523
|
-
"Ruby" => "(a..b)",
|
|
1524
|
-
"ParseTree" => s(:dot2,
|
|
1525
|
-
s(:call, nil, :a),
|
|
1526
|
-
s(:call, nil, :b)))
|
|
1527
|
-
|
|
1528
|
-
add_tests("dot3",
|
|
1529
|
-
"Ruby" => "(a...b)",
|
|
1530
|
-
"ParseTree" => s(:dot3,
|
|
1531
|
-
s(:call, nil, :a),
|
|
1532
|
-
s(:call, nil, :b)))
|
|
1533
|
-
|
|
1534
|
-
add_tests("dregx",
|
|
1535
|
-
"Ruby" => "/x#\{(1 + 1)}y/",
|
|
1536
|
-
"ParseTree" => s(:dregx, "x",
|
|
1537
|
-
s(:evstr,
|
|
1538
|
-
s(:call, s(:lit, 1), :+, s(:lit, 1))),
|
|
1539
|
-
s(:str, "y")))
|
|
1540
|
-
|
|
1541
|
-
add_tests("dregx_interp",
|
|
1542
|
-
"Ruby" => "/#\{@rakefile}/",
|
|
1543
|
-
"ParseTree" => s(:dregx, "", s(:evstr, s(:ivar, :@rakefile))))
|
|
1544
|
-
|
|
1545
|
-
add_tests("dregx_interp_empty",
|
|
1546
|
-
"Ruby" => "/a#\{}b/",
|
|
1547
|
-
"ParseTree" => s(:dregx, "a", s(:evstr), s(:str, "b")))
|
|
1548
|
-
|
|
1549
|
-
add_tests("dregx_n",
|
|
1550
|
-
"Ruby" => '/#{1}/n',
|
|
1551
|
-
"ParseTree" => s(:dregx, "",
|
|
1552
|
-
s(:evstr, s(:lit, 1)), /x/n.options))
|
|
1553
|
-
|
|
1554
|
-
add_tests("dregx_once",
|
|
1555
|
-
"Ruby" => "/x#\{(1 + 1)}y/o",
|
|
1556
|
-
"ParseTree" => s(:dregx_once, "x",
|
|
1557
|
-
s(:evstr,
|
|
1558
|
-
s(:call, s(:lit, 1), :+, s(:lit, 1))),
|
|
1559
|
-
s(:str, "y")))
|
|
1560
|
-
|
|
1561
|
-
add_tests("dregx_once_n_interp",
|
|
1562
|
-
"Ruby" => "/#\{IAC}#\{SB}/no",
|
|
1563
|
-
"ParseTree" => s(:dregx_once, "",
|
|
1564
|
-
s(:evstr, s(:const, :IAC)),
|
|
1565
|
-
s(:evstr, s(:const, :SB)), /x/n.options))
|
|
1566
|
-
|
|
1567
|
-
add_tests("dstr",
|
|
1568
|
-
"Ruby" => "argl = 1\n\"x#\{argl}y\"\n",
|
|
1569
|
-
"ParseTree" => s(:block,
|
|
1570
|
-
s(:lasgn, :argl, s(:lit, 1)),
|
|
1571
|
-
s(:dstr, "x", s(:evstr, s(:lvar, :argl)),
|
|
1572
|
-
s(:str, "y"))))
|
|
1573
|
-
|
|
1574
|
-
add_tests("dstr_2",
|
|
1575
|
-
"Ruby" => "argl = 1\n\"x#\{(\"%.2f\" % 3.14159)}y\"\n",
|
|
1576
|
-
"ParseTree" => s(:block,
|
|
1577
|
-
s(:lasgn, :argl, s(:lit, 1)),
|
|
1578
|
-
s(:dstr,
|
|
1579
|
-
"x",
|
|
1580
|
-
s(:evstr,
|
|
1581
|
-
s(:call, s(:str, "%.2f"), :%,
|
|
1582
|
-
s(:lit, 3.14159))),
|
|
1583
|
-
s(:str, "y"))))
|
|
1584
|
-
|
|
1585
|
-
add_tests("dstr_3",
|
|
1586
|
-
"Ruby" => "max = 2\nargl = 1\n\"x#\{(\"%.#\{max}f\" % 3.14159)}y\"\n",
|
|
1587
|
-
"ParseTree" => s(:block,
|
|
1588
|
-
s(:lasgn, :max, s(:lit, 2)),
|
|
1589
|
-
s(:lasgn, :argl, s(:lit, 1)),
|
|
1590
|
-
s(:dstr, "x",
|
|
1591
|
-
s(:evstr,
|
|
1592
|
-
s(:call,
|
|
1593
|
-
s(:dstr, "%.",
|
|
1594
|
-
s(:evstr, s(:lvar, :max)),
|
|
1595
|
-
s(:str, "f")),
|
|
1596
|
-
:%,
|
|
1597
|
-
s(:lit, 3.14159))),
|
|
1598
|
-
s(:str, "y"))))
|
|
1599
|
-
|
|
1600
|
-
add_tests("dstr_concat",
|
|
1601
|
-
"Ruby" => '"#{22}aa" "cd#{44}" "55" "#{66}"',
|
|
1602
|
-
"ParseTree" => s(:dstr,
|
|
1603
|
-
"",
|
|
1604
|
-
s(:evstr, s(:lit, 22)),
|
|
1605
|
-
s(:str, "aa"),
|
|
1606
|
-
s(:str, "cd"),
|
|
1607
|
-
s(:evstr, s(:lit, 44)),
|
|
1608
|
-
s(:str, "55"),
|
|
1609
|
-
s(:evstr, s(:lit, 66))),
|
|
1610
|
-
"Ruby2Ruby" => '"#{22}aacd#{44}55#{66}"')
|
|
1611
|
-
|
|
1612
|
-
add_tests("dstr_gross",
|
|
1613
|
-
"Ruby" => '"a #$global b #@ivar c #@@cvar d"',
|
|
1614
|
-
"ParseTree" => s(:dstr, "a ",
|
|
1615
|
-
s(:evstr, s(:gvar, :$global)),
|
|
1616
|
-
s(:str, " b "),
|
|
1617
|
-
s(:evstr, s(:ivar, :@ivar)),
|
|
1618
|
-
s(:str, " c "),
|
|
1619
|
-
s(:evstr, s(:cvar, :@@cvar)),
|
|
1620
|
-
s(:str, " d")),
|
|
1621
|
-
"Ruby2Ruby" => '"a #{$global} b #{@ivar} c #{@@cvar} d"')
|
|
1622
|
-
|
|
1623
|
-
add_tests("dstr_heredoc_expand",
|
|
1624
|
-
"Ruby" => "<<EOM\n blah\n#\{1 + 1}blah\nEOM\n",
|
|
1625
|
-
"ParseTree" => s(:dstr, " blah\n",
|
|
1626
|
-
s(:evstr, s(:call, s(:lit, 1), :+, s(:lit, 1))),
|
|
1627
|
-
s(:str, "blah\n")),
|
|
1628
|
-
"Ruby2Ruby" => "\" blah\\n#\{(1 + 1)}blah\\n\"")
|
|
1629
|
-
|
|
1630
|
-
add_tests("dstr_heredoc_windoze_sucks",
|
|
1631
|
-
"Ruby" => "<<-EOF\r\ndef test_#\{action}_valid_feed\r\n EOF\r\n",
|
|
1632
|
-
"ParseTree" => s(:dstr,
|
|
1633
|
-
"def test_",
|
|
1634
|
-
s(:evstr, s(:call, nil, :action)),
|
|
1635
|
-
s(:str, "_valid_feed\n")),
|
|
1636
|
-
"Ruby2Ruby" => "\"def test_#\{action}_valid_feed\\n\"")
|
|
1637
|
-
|
|
1638
|
-
add_tests("dstr_heredoc_yet_again",
|
|
1639
|
-
"Ruby" => "<<-EOF\ns1 '#\{RUBY_PLATFORM}' s2\n#\{__FILE__}\n EOF\n",
|
|
1640
|
-
"ParseTree" => s(:dstr, "s1 '",
|
|
1641
|
-
s(:evstr, s(:const, :RUBY_PLATFORM)),
|
|
1642
|
-
s(:str, "' s2\n"),
|
|
1643
|
-
s(:str, "(string)"),
|
|
1644
|
-
s(:str, "\n")),
|
|
1645
|
-
"Ruby2Ruby" => "\"s1 '#\{RUBY_PLATFORM}' s2\\n(string)\\n\"")
|
|
1646
|
-
|
|
1647
|
-
add_tests("dstr_nest",
|
|
1648
|
-
"Ruby" => "%Q[before [#\{nest}] after]",
|
|
1649
|
-
"ParseTree" => s(:dstr, "before [",
|
|
1650
|
-
s(:evstr, s(:call, nil, :nest)),
|
|
1651
|
-
s(:str, "] after")),
|
|
1652
|
-
"Ruby2Ruby" => "\"before [#\{nest}] after\"")
|
|
1653
|
-
|
|
1654
|
-
add_tests("dstr_str_lit_start",
|
|
1655
|
-
"Ruby" => '"#{"blah"}#{__FILE__}:#{__LINE__}: warning: #{$!.message} (#{$!.class})"',
|
|
1656
|
-
"ParseTree" => s(:dstr,
|
|
1657
|
-
"blah(string):",
|
|
1658
|
-
s(:evstr, s(:lit, 1)),
|
|
1659
|
-
s(:str, ": warning: "),
|
|
1660
|
-
s(:evstr, s(:call, s(:gvar, :$!), :message)),
|
|
1661
|
-
s(:str, " ("),
|
|
1662
|
-
s(:evstr, s(:call, s(:gvar, :$!), :class)),
|
|
1663
|
-
s(:str, ")")),
|
|
1664
|
-
"Ruby2Ruby" => '"blah(string):#{1}: warning: #{$!.message} (#{$!.class})"')
|
|
1665
|
-
|
|
1666
|
-
add_tests("dstr_the_revenge",
|
|
1667
|
-
"Ruby" => '"before #{from} middle #{to} (#{__FILE__}:#{__LINE__})"',
|
|
1668
|
-
"ParseTree" => s(:dstr,
|
|
1669
|
-
"before ",
|
|
1670
|
-
s(:evstr, s(:call, nil, :from)),
|
|
1671
|
-
s(:str, " middle "),
|
|
1672
|
-
s(:evstr, s(:call, nil, :to)),
|
|
1673
|
-
s(:str, " ("),
|
|
1674
|
-
s(:str, "(string)"),
|
|
1675
|
-
s(:str, ":"),
|
|
1676
|
-
s(:evstr, s(:lit, 1)),
|
|
1677
|
-
s(:str, ")")),
|
|
1678
|
-
"Ruby2Ruby" => '"before #{from} middle #{to} ((string):#{1})"')
|
|
1679
|
-
|
|
1680
|
-
add_tests("dsym",
|
|
1681
|
-
"Ruby" => ":\"x#\{(1 + 1)}y\"",
|
|
1682
|
-
"ParseTree" => s(:dsym, "x",
|
|
1683
|
-
s(:evstr, s(:call, s(:lit, 1), :+, s(:lit, 1))),
|
|
1684
|
-
s(:str, "y")))
|
|
1685
|
-
|
|
1686
|
-
add_tests("dxstr",
|
|
1687
|
-
"Ruby" => "t = 5\n`touch #\{t}`\n",
|
|
1688
|
-
"ParseTree" => s(:block,
|
|
1689
|
-
s(:lasgn, :t, s(:lit, 5)),
|
|
1690
|
-
s(:dxstr, "touch ", s(:evstr, s(:lvar, :t)))))
|
|
1691
|
-
|
|
1692
|
-
add_tests("ensure",
|
|
1693
|
-
"Ruby" => "begin\n (1 + 1)\nrescue SyntaxError => e1\n 2\nrescue Exception => e2\n 3\nelse\n 4\nensure\n 5\nend",
|
|
1694
|
-
"ParseTree" => s(:ensure,
|
|
1695
|
-
s(:rescue,
|
|
1696
|
-
s(:call, s(:lit, 1), :+, s(:lit, 1)),
|
|
1697
|
-
s(:resbody,
|
|
1698
|
-
s(:array,
|
|
1699
|
-
s(:const, :SyntaxError),
|
|
1700
|
-
s(:lasgn, :e1, s(:gvar, :$!))),
|
|
1701
|
-
s(:lit, 2)),
|
|
1702
|
-
s(:resbody,
|
|
1703
|
-
s(:array,
|
|
1704
|
-
s(:const, :Exception),
|
|
1705
|
-
s(:lasgn, :e2, s(:gvar, :$!))),
|
|
1706
|
-
s(:lit, 3)),
|
|
1707
|
-
s(:lit, 4)),
|
|
1708
|
-
s(:lit, 5)))
|
|
1709
|
-
|
|
1710
|
-
add_tests("false",
|
|
1711
|
-
"Ruby" => "false",
|
|
1712
|
-
"ParseTree" => s(:false))
|
|
1713
|
-
|
|
1714
|
-
add_tests("fbody",
|
|
1715
|
-
"Ruby" => [Examples, :an_alias],
|
|
1716
|
-
"ParseTree" => s(:defn, :an_alias, s(:args, :x),
|
|
1717
|
-
s(:call, s(:lvar, :x), :+, s(:lit, 1))),
|
|
1718
|
-
"Ruby2Ruby" => "def an_alias(x)\n (x + 1)\nend")
|
|
1719
|
-
|
|
1720
|
-
add_tests("fcall_arglist",
|
|
1721
|
-
"Ruby" => "m(42)",
|
|
1722
|
-
"ParseTree" => s(:call, nil, :m, s(:lit, 42)))
|
|
1723
|
-
|
|
1724
|
-
add_tests("fcall_arglist_hash",
|
|
1725
|
-
"Ruby" => "m(:a => 1, :b => 2)",
|
|
1726
|
-
"ParseTree" => s(:call, nil, :m,
|
|
1727
|
-
s(:hash,
|
|
1728
|
-
s(:lit, :a), s(:lit, 1),
|
|
1729
|
-
s(:lit, :b), s(:lit, 2))))
|
|
1730
|
-
|
|
1731
|
-
add_tests("fcall_arglist_norm_hash",
|
|
1732
|
-
"Ruby" => "m(42, :a => 1, :b => 2)",
|
|
1733
|
-
"ParseTree" => s(:call, nil, :m,
|
|
1734
|
-
s(:lit, 42),
|
|
1735
|
-
s(:hash,
|
|
1736
|
-
s(:lit, :a), s(:lit, 1),
|
|
1737
|
-
s(:lit, :b), s(:lit, 2))))
|
|
1738
|
-
|
|
1739
|
-
add_tests("fcall_block",
|
|
1740
|
-
"Ruby" => "a(:b) { :c }",
|
|
1741
|
-
"ParseTree" => s(:iter,
|
|
1742
|
-
s(:call, nil, :a, s(:lit, :b)),
|
|
1743
|
-
0,
|
|
1744
|
-
s(:lit, :c)))
|
|
1745
|
-
|
|
1746
|
-
add_tests("fcall_index_space",
|
|
1747
|
-
"Ruby" => "a [42]",
|
|
1748
|
-
"ParseTree" => s(:call, nil, :a, s(:array, s(:lit, 42))),
|
|
1749
|
-
"Ruby2Ruby" => "a([42])")
|
|
1750
|
-
|
|
1751
|
-
add_tests("fcall_inside_parens",
|
|
1752
|
-
"Ruby" => "( a (b), c)",
|
|
1753
|
-
"ParseTree" => s(:call, nil, :a,
|
|
1754
|
-
s(:call, nil, :b), s(:call, nil, :c)),
|
|
1755
|
-
"Ruby2Ruby" => "a(b, c)")
|
|
1756
|
-
|
|
1757
|
-
add_tests("fcall_keyword",
|
|
1758
|
-
"Ruby" => "42 if block_given?",
|
|
1759
|
-
"ParseTree" => s(:if,
|
|
1760
|
-
s(:call, nil, :block_given?),
|
|
1761
|
-
s(:lit, 42), nil))
|
|
1762
|
-
|
|
1763
|
-
add_tests("flip2",
|
|
1764
|
-
"Ruby" => "x = if ((i % 4) == 0)..((i % 3) == 0) then\n i\nelse\n nil\nend",
|
|
1765
|
-
"ParseTree" => s(:lasgn,
|
|
1766
|
-
:x,
|
|
1767
|
-
s(:if,
|
|
1768
|
-
s(:flip2,
|
|
1769
|
-
s(:call,
|
|
1770
|
-
s(:call, s(:call, nil, :i),
|
|
1771
|
-
:%,
|
|
1772
|
-
s(:lit, 4)),
|
|
1773
|
-
:==,
|
|
1774
|
-
s(:lit, 0)),
|
|
1775
|
-
s(:call,
|
|
1776
|
-
s(:call, s(:call, nil, :i),
|
|
1777
|
-
:%,
|
|
1778
|
-
s(:lit, 3)),
|
|
1779
|
-
:==,
|
|
1780
|
-
s(:lit, 0))),
|
|
1781
|
-
s(:call, nil, :i),
|
|
1782
|
-
s(:nil))))
|
|
1783
|
-
|
|
1784
|
-
add_tests("flip2_method",
|
|
1785
|
-
"Ruby" => "if 1..2.a?(b) then\n nil\nend",
|
|
1786
|
-
"ParseTree" => s(:if,
|
|
1787
|
-
s(:flip2,
|
|
1788
|
-
s(:lit, 1),
|
|
1789
|
-
s(:call, s(:lit, 2), :a?, s(:call, nil, :b))),
|
|
1790
|
-
s(:nil),
|
|
1791
|
-
nil))
|
|
1792
|
-
|
|
1793
|
-
add_tests("flip3",
|
|
1794
|
-
"Ruby" => "x = if ((i % 4) == 0)...((i % 3) == 0) then\n i\nelse\n nil\nend",
|
|
1795
|
-
"ParseTree" => s(:lasgn,
|
|
1796
|
-
:x,
|
|
1797
|
-
s(:if,
|
|
1798
|
-
s(:flip3,
|
|
1799
|
-
s(:call,
|
|
1800
|
-
s(:call, s(:call, nil, :i),
|
|
1801
|
-
:%,
|
|
1802
|
-
s(:lit, 4)),
|
|
1803
|
-
:==,
|
|
1804
|
-
s(:lit, 0)),
|
|
1805
|
-
s(:call,
|
|
1806
|
-
s(:call, s(:call, nil, :i),
|
|
1807
|
-
:%,
|
|
1808
|
-
s(:lit, 3)),
|
|
1809
|
-
:==,
|
|
1810
|
-
s(:lit, 0))),
|
|
1811
|
-
s(:call, nil, :i),
|
|
1812
|
-
s(:nil))))
|
|
1813
|
-
|
|
1814
|
-
add_tests("for",
|
|
1815
|
-
"Ruby" => "for o in ary do\n puts(o)\nend",
|
|
1816
|
-
"ParseTree" => s(:for,
|
|
1817
|
-
s(:call, nil, :ary),
|
|
1818
|
-
s(:lasgn, :o),
|
|
1819
|
-
s(:call, nil, :puts, s(:lvar, :o))))
|
|
1820
|
-
|
|
1821
|
-
add_tests("for_no_body",
|
|
1822
|
-
"Ruby" => "for i in (0..max) do\n # do nothing\nend",
|
|
1823
|
-
"ParseTree" => s(:for,
|
|
1824
|
-
s(:dot2,
|
|
1825
|
-
s(:lit, 0),
|
|
1826
|
-
s(:call, nil, :max)),
|
|
1827
|
-
s(:lasgn, :i)))
|
|
1828
|
-
|
|
1829
|
-
add_tests("gasgn",
|
|
1830
|
-
"Ruby" => "$x = 42",
|
|
1831
|
-
"ParseTree" => s(:gasgn, :$x, s(:lit, 42)))
|
|
1832
|
-
|
|
1833
|
-
add_tests("global",
|
|
1834
|
-
"Ruby" => "$stderr",
|
|
1835
|
-
"ParseTree" => s(:gvar, :$stderr))
|
|
1836
|
-
|
|
1837
|
-
add_tests("gvar",
|
|
1838
|
-
"Ruby" => "$x",
|
|
1839
|
-
"ParseTree" => s(:gvar, :$x))
|
|
1840
|
-
|
|
1841
|
-
add_tests("gvar_underscore",
|
|
1842
|
-
"Ruby" => "$_",
|
|
1843
|
-
"ParseTree" => s(:gvar, :$_))
|
|
1844
|
-
|
|
1845
|
-
add_tests("gvar_underscore_blah",
|
|
1846
|
-
"Ruby" => "$__blah",
|
|
1847
|
-
"ParseTree" => s(:gvar, :$__blah))
|
|
1848
|
-
|
|
1849
|
-
add_tests("hash",
|
|
1850
|
-
"Ruby" => "{ 1 => 2, 3 => 4 }",
|
|
1851
|
-
"ParseTree" => s(:hash,
|
|
1852
|
-
s(:lit, 1), s(:lit, 2),
|
|
1853
|
-
s(:lit, 3), s(:lit, 4)))
|
|
1854
|
-
|
|
1855
|
-
add_tests("hash_rescue",
|
|
1856
|
-
"Ruby" => "{ 1 => (2 rescue 3) }",
|
|
1857
|
-
"ParseTree" => s(:hash,
|
|
1858
|
-
s(:lit, 1),
|
|
1859
|
-
s(:rescue,
|
|
1860
|
-
s(:lit, 2),
|
|
1861
|
-
s(:resbody, s(:array), s(:lit, 3)))))
|
|
1862
|
-
|
|
1863
|
-
add_tests("iasgn",
|
|
1864
|
-
"Ruby" => "@a = 4",
|
|
1865
|
-
"ParseTree" => s(:iasgn, :@a, s(:lit, 4)))
|
|
1866
|
-
|
|
1867
|
-
add_tests("if_block_condition",
|
|
1868
|
-
"Ruby" => "if (x = 5\n(x + 1)) then\n nil\nend",
|
|
1869
|
-
"ParseTree" => s(:if,
|
|
1870
|
-
s(:block,
|
|
1871
|
-
s(:lasgn, :x, s(:lit, 5)),
|
|
1872
|
-
s(:call, s(:lvar, :x), :+, s(:lit, 1))),
|
|
1873
|
-
s(:nil),
|
|
1874
|
-
nil))
|
|
1875
|
-
|
|
1876
|
-
add_tests("if_lasgn_short",
|
|
1877
|
-
"Ruby" => "if x = obj.x then\n x.do_it\nend",
|
|
1878
|
-
"ParseTree" => s(:if,
|
|
1879
|
-
s(:lasgn, :x,
|
|
1880
|
-
s(:call,
|
|
1881
|
-
s(:call, nil, :obj),
|
|
1882
|
-
:x)),
|
|
1883
|
-
s(:call, s(:lvar, :x), :do_it),
|
|
1884
|
-
nil))
|
|
1885
|
-
|
|
1886
|
-
add_tests("if_nested",
|
|
1887
|
-
"Ruby" => "return if false unless true",
|
|
1888
|
-
"ParseTree" => s(:if, s(:true), nil,
|
|
1889
|
-
s(:if, s(:false), s(:return), nil)))
|
|
1890
|
-
|
|
1891
|
-
add_tests("if_post",
|
|
1892
|
-
"Ruby" => "a if b",
|
|
1893
|
-
"ParseTree" => s(:if, s(:call, nil, :b),
|
|
1894
|
-
s(:call, nil, :a), nil))
|
|
1895
|
-
|
|
1896
|
-
add_tests("if_pre",
|
|
1897
|
-
"Ruby" => "if b then a end",
|
|
1898
|
-
"ParseTree" => s(:if, s(:call, nil, :b),
|
|
1899
|
-
s(:call, nil, :a), nil),
|
|
1900
|
-
"Ruby2Ruby" => "a if b")
|
|
1901
|
-
|
|
1902
|
-
add_tests("iter_call_arglist_space",
|
|
1903
|
-
"Ruby" => "a (1) {|c|d}",
|
|
1904
|
-
"ParseTree" => s(:iter,
|
|
1905
|
-
s(:call, nil, :a, s(:lit, 1)),
|
|
1906
|
-
s(:args, :c),
|
|
1907
|
-
s(:call, nil, :d)),
|
|
1908
|
-
"Ruby2Ruby" => "a(1) { |c| d }")
|
|
1909
|
-
|
|
1910
|
-
add_tests("iter_dasgn_curr_dasgn_madness",
|
|
1911
|
-
"Ruby" => "as.each { |a|\n b += a.b(false) }",
|
|
1912
|
-
"ParseTree" => s(:iter,
|
|
1913
|
-
s(:call, s(:call, nil, :as), :each),
|
|
1914
|
-
s(:args, :a),
|
|
1915
|
-
s(:lasgn, :b,
|
|
1916
|
-
s(:call,
|
|
1917
|
-
s(:lvar, :b),
|
|
1918
|
-
:+,
|
|
1919
|
-
s(:call, s(:lvar, :a), :b, s(:false))))),
|
|
1920
|
-
"Ruby2Ruby" => "as.each { |a| b = (b + a.b(false)) }")
|
|
1921
|
-
|
|
1922
|
-
add_tests("iter_downto",
|
|
1923
|
-
"Ruby" => "3.downto(1) { |n| puts(n.to_s) }",
|
|
1924
|
-
"ParseTree" => s(:iter,
|
|
1925
|
-
s(:call, s(:lit, 3), :downto, s(:lit, 1)),
|
|
1926
|
-
s(:args, :n),
|
|
1927
|
-
s(:call, nil, :puts,
|
|
1928
|
-
s(:call, s(:lvar, :n), :to_s))))
|
|
1929
|
-
|
|
1930
|
-
add_tests("iter_each_lvar",
|
|
1931
|
-
"Ruby" => "array = [1, 2, 3]\narray.each { |x| puts(x.to_s) }\n",
|
|
1932
|
-
"ParseTree" => s(:block,
|
|
1933
|
-
s(:lasgn, :array,
|
|
1934
|
-
s(:array,
|
|
1935
|
-
s(:lit, 1), s(:lit, 2), s(:lit, 3))),
|
|
1936
|
-
s(:iter,
|
|
1937
|
-
s(:call, s(:lvar, :array), :each),
|
|
1938
|
-
s(:args, :x),
|
|
1939
|
-
s(:call, nil, :puts,
|
|
1940
|
-
s(:call, s(:lvar, :x), :to_s)))))
|
|
1941
|
-
|
|
1942
|
-
add_tests("iter_each_nested",
|
|
1943
|
-
"Ruby" => "array1 = [1, 2, 3]\narray2 = [4, 5, 6, 7]\narray1.each do |x|\n array2.each do |y|\n puts(x.to_s)\n puts(y.to_s)\n end\nend\n",
|
|
1944
|
-
"ParseTree" => s(:block,
|
|
1945
|
-
s(:lasgn, :array1,
|
|
1946
|
-
s(:array,
|
|
1947
|
-
s(:lit, 1), s(:lit, 2), s(:lit, 3))),
|
|
1948
|
-
s(:lasgn, :array2,
|
|
1949
|
-
s(:array,
|
|
1950
|
-
s(:lit, 4), s(:lit, 5),
|
|
1951
|
-
s(:lit, 6), s(:lit, 7))),
|
|
1952
|
-
s(:iter,
|
|
1953
|
-
s(:call, s(:lvar, :array1), :each),
|
|
1954
|
-
s(:args, :x),
|
|
1955
|
-
s(:iter,
|
|
1956
|
-
s(:call, s(:lvar, :array2), :each),
|
|
1957
|
-
s(:args, :y),
|
|
1958
|
-
s(:block,
|
|
1959
|
-
s(:call, nil, :puts,
|
|
1960
|
-
s(:call, s(:lvar, :x), :to_s)),
|
|
1961
|
-
s(:call, nil, :puts,
|
|
1962
|
-
s(:call, s(:lvar, :y), :to_s)))))))
|
|
1963
|
-
|
|
1964
|
-
add_tests("iter_loop_empty",
|
|
1965
|
-
"Ruby" => "loop { }",
|
|
1966
|
-
"ParseTree" => s(:iter, s(:call, nil, :loop), 0))
|
|
1967
|
-
|
|
1968
|
-
add_tests("iter_masgn_2",
|
|
1969
|
-
"Ruby" => "a { |b, c| p(c) }",
|
|
1970
|
-
"ParseTree" => s(:iter,
|
|
1971
|
-
s(:call, nil, :a),
|
|
1972
|
-
s(:args, :b, :c),
|
|
1973
|
-
s(:call, nil, :p, s(:lvar, :c))))
|
|
1974
|
-
|
|
1975
|
-
add_tests("iter_masgn_args_splat",
|
|
1976
|
-
"Ruby" => "a { |b, c, *d| p(c) }",
|
|
1977
|
-
"ParseTree" => s(:iter,
|
|
1978
|
-
s(:call, nil, :a),
|
|
1979
|
-
s(:args, :b, :c, :"*d"),
|
|
1980
|
-
s(:call, nil, :p, s(:lvar, :c))))
|
|
1981
|
-
|
|
1982
|
-
add_tests("iter_masgn_args_splat_no_name",
|
|
1983
|
-
"Ruby" => "a { |b, c, *| p(c) }",
|
|
1984
|
-
"ParseTree" => s(:iter,
|
|
1985
|
-
s(:call, nil, :a),
|
|
1986
|
-
s(:args, :b, :c, :*),
|
|
1987
|
-
s(:call, nil, :p, s(:lvar, :c))))
|
|
1988
|
-
|
|
1989
|
-
add_tests("iter_masgn_splat",
|
|
1990
|
-
"Ruby" => "a { |*c| p(c) }",
|
|
1991
|
-
"ParseTree" => s(:iter,
|
|
1992
|
-
s(:call, nil, :a),
|
|
1993
|
-
s(:args, :"*c"),
|
|
1994
|
-
s(:call, nil, :p, s(:lvar, :c))))
|
|
1995
|
-
|
|
1996
|
-
add_tests("iter_masgn_splat_no_name",
|
|
1997
|
-
"Ruby" => "a { |*| p(c) }",
|
|
1998
|
-
"ParseTree" => s(:iter,
|
|
1999
|
-
s(:call, nil, :a),
|
|
2000
|
-
s(:args, :*),
|
|
2001
|
-
s(:call, nil, :p, s(:call, nil, :c))))
|
|
2002
|
-
|
|
2003
|
-
add_tests("iter_shadowed_var",
|
|
2004
|
-
"Ruby" => "a do |x|\n b do |x|\n puts x\n end\nend",
|
|
2005
|
-
"ParseTree" => s(:iter,
|
|
2006
|
-
s(:call, nil, :a),
|
|
2007
|
-
s(:args, :x),
|
|
2008
|
-
s(:iter,
|
|
2009
|
-
s(:call, nil, :b),
|
|
2010
|
-
s(:args, :x),
|
|
2011
|
-
s(:call, nil, :puts, s(:lvar, :x)))),
|
|
2012
|
-
"Ruby2Ruby" => "a { |x| b { |x| puts(x) } }")
|
|
2013
|
-
|
|
2014
|
-
add_tests("iter_upto",
|
|
2015
|
-
"Ruby" => "1.upto(3) { |n| puts(n.to_s) }",
|
|
2016
|
-
"ParseTree" => s(:iter,
|
|
2017
|
-
s(:call, s(:lit, 1), :upto, s(:lit, 3)),
|
|
2018
|
-
s(:args, :n),
|
|
2019
|
-
s(:call, nil, :puts,
|
|
2020
|
-
s(:call, s(:lvar, :n), :to_s))))
|
|
2021
|
-
|
|
2022
|
-
add_tests("iter_while",
|
|
2023
|
-
"Ruby" => "argl = 10\nwhile (argl >= 1) do\n puts(\"hello\")\n argl = (argl - 1)\nend\n",
|
|
2024
|
-
"ParseTree" => s(:block,
|
|
2025
|
-
s(:lasgn, :argl, s(:lit, 10)),
|
|
2026
|
-
s(:while,
|
|
2027
|
-
s(:call, s(:lvar, :argl), :">=", s(:lit, 1)),
|
|
2028
|
-
s(:block,
|
|
2029
|
-
s(:call, nil, :puts, s(:str, "hello")),
|
|
2030
|
-
s(:lasgn,
|
|
2031
|
-
:argl,
|
|
2032
|
-
s(:call, s(:lvar, :argl), :"-",
|
|
2033
|
-
s(:lit, 1)))),
|
|
2034
|
-
true)))
|
|
2035
|
-
|
|
2036
|
-
add_tests("ivar",
|
|
2037
|
-
"Ruby" => [Examples, :reader],
|
|
2038
|
-
"ParseTree" => s(:defn, :reader, s(:args),
|
|
2039
|
-
s(:ivar, :@reader)),
|
|
2040
|
-
"Ruby2Ruby" => "attr_reader :reader")
|
|
2041
|
-
|
|
2042
|
-
add_tests("lambda_args_anon_star",
|
|
2043
|
-
"Ruby" => "lambda { |*| nil }",
|
|
2044
|
-
"ParseTree" => s(:iter,
|
|
2045
|
-
s(:call, nil, :lambda),
|
|
2046
|
-
s(:args, :*),
|
|
2047
|
-
s(:nil)))
|
|
2048
|
-
|
|
2049
|
-
add_tests("lambda_args_anon_star_block",
|
|
2050
|
-
"Ruby" => "lambda { |*, &block| block }",
|
|
2051
|
-
"ParseTree" => s(:iter,
|
|
2052
|
-
s(:call, nil, :lambda),
|
|
2053
|
-
s(:args, :*, :"&block"),
|
|
2054
|
-
s(:lvar, :block)))
|
|
2055
|
-
|
|
2056
|
-
add_tests("lambda_args_block",
|
|
2057
|
-
"Ruby" => "lambda { |&block| block }",
|
|
2058
|
-
"ParseTree" => s(:iter,
|
|
2059
|
-
s(:call, nil, :lambda),
|
|
2060
|
-
s(:args, :"&block"),
|
|
2061
|
-
s(:lvar, :block)))
|
|
2062
|
-
|
|
2063
|
-
add_tests("lambda_args_norm_anon_star",
|
|
2064
|
-
"Ruby" => "lambda { |a, *| a }",
|
|
2065
|
-
"ParseTree" => s(:iter,
|
|
2066
|
-
s(:call, nil, :lambda),
|
|
2067
|
-
s(:args, :a, :*),
|
|
2068
|
-
s(:lvar, :a)))
|
|
2069
|
-
|
|
2070
|
-
add_tests("lambda_args_norm_anon_star_block",
|
|
2071
|
-
"Ruby" => "lambda { |a, *, &block| block }",
|
|
2072
|
-
"ParseTree" => s(:iter,
|
|
2073
|
-
s(:call, nil, :lambda),
|
|
2074
|
-
s(:args, :a, :*, :"&block"),
|
|
2075
|
-
s(:lvar, :block)))
|
|
2076
|
-
|
|
2077
|
-
add_tests("lambda_args_norm_block",
|
|
2078
|
-
"Ruby" => "lambda { |a, &block| block }",
|
|
2079
|
-
"ParseTree" => s(:iter,
|
|
2080
|
-
s(:call, nil, :lambda),
|
|
2081
|
-
s(:args, :a, :"&block"),
|
|
2082
|
-
s(:lvar, :block)))
|
|
2083
|
-
|
|
2084
|
-
add_tests("lambda_args_norm_comma",
|
|
2085
|
-
"Ruby" => "lambda { |a,| a }",
|
|
2086
|
-
"ParseTree" => s(:iter,
|
|
2087
|
-
s(:call, nil, :lambda),
|
|
2088
|
-
s(:args, :a, nil),
|
|
2089
|
-
s(:lvar, :a)))
|
|
2090
|
-
|
|
2091
|
-
add_tests("lambda_args_norm_comma2",
|
|
2092
|
-
"Ruby" => "lambda { |a, b,| a }",
|
|
2093
|
-
"ParseTree" => s(:iter,
|
|
2094
|
-
s(:call, nil, :lambda),
|
|
2095
|
-
s(:args, :a, :b, nil),
|
|
2096
|
-
s(:lvar, :a)))
|
|
2097
|
-
|
|
2098
|
-
add_tests("lambda_args_norm_star",
|
|
2099
|
-
"Ruby" => "lambda { |a, *star| star }",
|
|
2100
|
-
"ParseTree" => s(:iter,
|
|
2101
|
-
s(:call, nil, :lambda),
|
|
2102
|
-
s(:args, :a, :"*star"),
|
|
2103
|
-
s(:lvar, :star)))
|
|
2104
|
-
|
|
2105
|
-
add_tests("lambda_args_norm_star_block",
|
|
2106
|
-
"Ruby" => "lambda { |a, *star, &block| block }",
|
|
2107
|
-
"ParseTree" => s(:iter,
|
|
2108
|
-
s(:call, nil, :lambda),
|
|
2109
|
-
s(:args, :a, :"*star", :"&block"),
|
|
2110
|
-
s(:lvar, :block)))
|
|
2111
|
-
|
|
2112
|
-
add_tests("lambda_args_star",
|
|
2113
|
-
"Ruby" => "lambda { |*star| star }",
|
|
2114
|
-
"ParseTree" => s(:iter,
|
|
2115
|
-
s(:call, nil, :lambda),
|
|
2116
|
-
s(:args, :"*star"),
|
|
2117
|
-
s(:lvar, :star)))
|
|
2118
|
-
|
|
2119
|
-
add_tests("lambda_args_star_block",
|
|
2120
|
-
"Ruby" => "lambda { |*star, &block| block }",
|
|
2121
|
-
"ParseTree" => s(:iter,
|
|
2122
|
-
s(:call, nil, :lambda),
|
|
2123
|
-
s(:args, :"*star", :"&block"),
|
|
2124
|
-
s(:lvar, :block)))
|
|
2125
|
-
|
|
2126
|
-
add_tests("lasgn_array",
|
|
2127
|
-
"Ruby" => "var = [\"foo\", \"bar\"]",
|
|
2128
|
-
"ParseTree" => s(:lasgn, :var,
|
|
2129
|
-
s(:array,
|
|
2130
|
-
s(:str, "foo"),
|
|
2131
|
-
s(:str, "bar"))))
|
|
2132
|
-
|
|
2133
|
-
add_tests("lasgn_call",
|
|
2134
|
-
"Ruby" => "c = (2 + 3)",
|
|
2135
|
-
"ParseTree" => s(:lasgn, :c,
|
|
2136
|
-
s(:call, s(:lit, 2), :+, s(:lit, 3))))
|
|
2137
|
-
|
|
2138
|
-
add_tests("lit_bool_false",
|
|
2139
|
-
"Ruby" => "false",
|
|
2140
|
-
"ParseTree" => s(:false))
|
|
2141
|
-
|
|
2142
|
-
add_tests("lit_bool_true",
|
|
2143
|
-
"Ruby" => "true",
|
|
2144
|
-
"ParseTree" => s(:true))
|
|
2145
|
-
|
|
2146
|
-
add_tests("lit_float",
|
|
2147
|
-
"Ruby" => "1.1",
|
|
2148
|
-
"ParseTree" => s(:lit, 1.1))
|
|
2149
|
-
|
|
2150
|
-
add_tests("lit_long",
|
|
2151
|
-
"Ruby" => "1",
|
|
2152
|
-
"ParseTree" => s(:lit, 1))
|
|
2153
|
-
|
|
2154
|
-
add_tests("lit_long_negative",
|
|
2155
|
-
"Ruby" => "-1",
|
|
2156
|
-
"ParseTree" => s(:lit, -1))
|
|
2157
|
-
|
|
2158
|
-
add_tests("lit_range2",
|
|
2159
|
-
"Ruby" => "(1..10)",
|
|
2160
|
-
"ParseTree" => s(:lit, 1..10))
|
|
2161
|
-
|
|
2162
|
-
add_tests("lit_range3",
|
|
2163
|
-
"Ruby" => "(1...10)",
|
|
2164
|
-
"ParseTree" => s(:lit, 1...10))
|
|
2165
|
-
|
|
2166
|
-
add_tests("lit_regexp",
|
|
2167
|
-
"Ruby" => "/x/",
|
|
2168
|
-
"ParseTree" => s(:lit, /x/))
|
|
2169
|
-
|
|
2170
|
-
add_tests("lit_regexp_i_wwtt",
|
|
2171
|
-
"Ruby" => "str.split(//i)",
|
|
2172
|
-
"ParseTree" => s(:call,
|
|
2173
|
-
s(:call, nil, :str),
|
|
2174
|
-
:split,
|
|
2175
|
-
s(:lit, //i)))
|
|
2176
|
-
|
|
2177
|
-
add_tests("lit_regexp_n",
|
|
2178
|
-
"Ruby" => "/x/n", # HACK differs on 1.9 - this is easiest
|
|
2179
|
-
"ParseTree" => s(:lit, /x/n),
|
|
2180
|
-
"Ruby2Ruby" => /x/n.inspect)
|
|
2181
|
-
|
|
2182
|
-
add_tests("lit_regexp_once",
|
|
2183
|
-
"Ruby" => "/x/o",
|
|
2184
|
-
"ParseTree" => s(:lit, /x/),
|
|
2185
|
-
"Ruby2Ruby" => "/x/")
|
|
2186
|
-
|
|
2187
|
-
add_tests("lit_sym",
|
|
2188
|
-
"Ruby" => ":x",
|
|
2189
|
-
"ParseTree" => s(:lit, :x))
|
|
2190
|
-
|
|
2191
|
-
add_tests("lit_sym_splat",
|
|
2192
|
-
"Ruby" => ":\"*args\"",
|
|
2193
|
-
"ParseTree" => s(:lit, :"*args"))
|
|
2194
|
-
|
|
2195
|
-
add_tests("lvar_def_boundary",
|
|
2196
|
-
"Ruby" => "b = 42\ndef a\n c do\n begin\n do_stuff\n rescue RuntimeError => b\n puts(b)\n end\n end\nend\n",
|
|
2197
|
-
"ParseTree" => s(:block,
|
|
2198
|
-
s(:lasgn, :b, s(:lit, 42)),
|
|
2199
|
-
s(:defn, :a, s(:args),
|
|
2200
|
-
s(:iter,
|
|
2201
|
-
s(:call, nil, :c),
|
|
2202
|
-
0,
|
|
2203
|
-
s(:rescue,
|
|
2204
|
-
s(:call, nil, :do_stuff),
|
|
2205
|
-
s(:resbody,
|
|
2206
|
-
s(:array,
|
|
2207
|
-
s(:const, :RuntimeError),
|
|
2208
|
-
s(:lasgn, :b, s(:gvar, :$!))),
|
|
2209
|
-
s(:call, nil, :puts,
|
|
2210
|
-
s(:lvar, :b))))))))
|
|
2211
|
-
|
|
2212
|
-
add_tests("masgn",
|
|
2213
|
-
"Ruby" => "a, b = c, d",
|
|
2214
|
-
"ParseTree" => s(:masgn,
|
|
2215
|
-
s(:array, s(:lasgn, :a), s(:lasgn, :b)),
|
|
2216
|
-
s(:array, s(:call, nil, :c),
|
|
2217
|
-
s(:call, nil, :d))))
|
|
2218
|
-
|
|
2219
|
-
add_tests("masgn_argscat",
|
|
2220
|
-
"Ruby" => "a, b, *c = 1, 2, *[3, 4]",
|
|
2221
|
-
"ParseTree" => s(:masgn,
|
|
2222
|
-
s(:array,
|
|
2223
|
-
s(:lasgn, :a),
|
|
2224
|
-
s(:lasgn, :b),
|
|
2225
|
-
s(:splat, s(:lasgn, :c))),
|
|
2226
|
-
s(:array,
|
|
2227
|
-
s(:lit, 1), s(:lit, 2),
|
|
2228
|
-
s(:splat,
|
|
2229
|
-
s(:array, s(:lit, 3), s(:lit, 4))))))
|
|
2230
|
-
|
|
2231
|
-
add_tests("masgn_attrasgn",
|
|
2232
|
-
"Ruby" => "a, b.c = d, e",
|
|
2233
|
-
"ParseTree" => s(:masgn,
|
|
2234
|
-
s(:array,
|
|
2235
|
-
s(:lasgn, :a),
|
|
2236
|
-
s(:attrasgn,
|
|
2237
|
-
s(:call, nil, :b),
|
|
2238
|
-
:c=)),
|
|
2239
|
-
s(:array,
|
|
2240
|
-
s(:call, nil, :d),
|
|
2241
|
-
s(:call, nil, :e))))
|
|
2242
|
-
|
|
2243
|
-
add_tests("masgn_attrasgn_array_rhs",
|
|
2244
|
-
"Ruby" => "a.b, a.c, _ = q",
|
|
2245
|
-
"ParseTree" => s(:masgn,
|
|
2246
|
-
s(:array,
|
|
2247
|
-
s(:attrasgn,
|
|
2248
|
-
s(:call, nil, :a),
|
|
2249
|
-
:b=),
|
|
2250
|
-
s(:attrasgn,
|
|
2251
|
-
s(:call, nil, :a),
|
|
2252
|
-
:c=),
|
|
2253
|
-
s(:lasgn, :_)),
|
|
2254
|
-
s(:to_ary,
|
|
2255
|
-
s(:call, nil, :q))))
|
|
2256
|
-
|
|
2257
|
-
add_tests("masgn_attrasgn_idx",
|
|
2258
|
-
"Ruby" => "a, i, j = [], 1, 2\na[i], a[j] = a[j], a[i]\n",
|
|
2259
|
-
"ParseTree" => s(:block,
|
|
2260
|
-
s(:masgn,
|
|
2261
|
-
s(:array,
|
|
2262
|
-
s(:lasgn, :a),
|
|
2263
|
-
s(:lasgn, :i), s(:lasgn, :j)),
|
|
2264
|
-
s(:array, s(:array), s(:lit, 1), s(:lit, 2))),
|
|
2265
|
-
s(:masgn,
|
|
2266
|
-
s(:array,
|
|
2267
|
-
s(:attrasgn,
|
|
2268
|
-
s(:lvar, :a), :[]=, s(:lvar, :i)),
|
|
2269
|
-
s(:attrasgn,
|
|
2270
|
-
s(:lvar, :a), :[]=, s(:lvar, :j))),
|
|
2271
|
-
s(:array,
|
|
2272
|
-
s(:call,
|
|
2273
|
-
s(:lvar, :a), :[], s(:lvar, :j)),
|
|
2274
|
-
s(:call,
|
|
2275
|
-
s(:lvar, :a), :[], s(:lvar, :i))))))
|
|
2276
|
-
|
|
2277
|
-
add_tests("masgn_cdecl",
|
|
2278
|
-
"Ruby" => "A, B, C = 1, 2, 3",
|
|
2279
|
-
"ParseTree" => s(:masgn,
|
|
2280
|
-
s(:array, s(:cdecl, :A), s(:cdecl, :B),
|
|
2281
|
-
s(:cdecl, :C)),
|
|
2282
|
-
s(:array, s(:lit, 1), s(:lit, 2), s(:lit, 3))))
|
|
2283
|
-
|
|
2284
|
-
add_tests("masgn_iasgn",
|
|
2285
|
-
"Ruby" => "a, @b = c, d",
|
|
2286
|
-
"ParseTree" => s(:masgn,
|
|
2287
|
-
s(:array, s(:lasgn, :a), s(:iasgn, :"@b")),
|
|
2288
|
-
s(:array,
|
|
2289
|
-
s(:call, nil, :c),
|
|
2290
|
-
s(:call, nil, :d))))
|
|
2291
|
-
|
|
2292
|
-
add_tests("masgn_masgn",
|
|
2293
|
-
"Ruby" => "a, (b, c) = [1, [2, 3]]",
|
|
2294
|
-
"ParseTree" => s(:masgn,
|
|
2295
|
-
s(:array,
|
|
2296
|
-
s(:lasgn, :a),
|
|
2297
|
-
s(:masgn,
|
|
2298
|
-
s(:array,
|
|
2299
|
-
s(:lasgn, :b),
|
|
2300
|
-
s(:lasgn, :c)))),
|
|
2301
|
-
s(:to_ary,
|
|
2302
|
-
s(:array,
|
|
2303
|
-
s(:lit, 1),
|
|
2304
|
-
s(:array,
|
|
2305
|
-
s(:lit, 2),
|
|
2306
|
-
s(:lit, 3))))))
|
|
2307
|
-
|
|
2308
|
-
add_tests("masgn_splat_lhs",
|
|
2309
|
-
"Ruby" => "a, b, *c = d, e, f, g",
|
|
2310
|
-
"ParseTree" => s(:masgn,
|
|
2311
|
-
s(:array,
|
|
2312
|
-
s(:lasgn, :a),
|
|
2313
|
-
s(:lasgn, :b),
|
|
2314
|
-
s(:splat, s(:lasgn, :c))),
|
|
2315
|
-
s(:array,
|
|
2316
|
-
s(:call, nil, :d),
|
|
2317
|
-
s(:call, nil, :e),
|
|
2318
|
-
s(:call, nil, :f),
|
|
2319
|
-
s(:call, nil, :g))))
|
|
2320
|
-
|
|
2321
|
-
add_tests("masgn_splat_no_name_to_ary",
|
|
2322
|
-
"Ruby" => "a, b, * = c",
|
|
2323
|
-
"ParseTree" => s(:masgn,
|
|
2324
|
-
s(:array,
|
|
2325
|
-
s(:lasgn, :a),
|
|
2326
|
-
s(:lasgn, :b),
|
|
2327
|
-
s(:splat)),
|
|
2328
|
-
s(:to_ary, s(:call, nil, :c))))
|
|
2329
|
-
|
|
2330
|
-
add_tests("masgn_splat_no_name_trailing",
|
|
2331
|
-
"Ruby" => "a, b, = c",
|
|
2332
|
-
"ParseTree" => s(:masgn,
|
|
2333
|
-
s(:array, s(:lasgn, :a), s(:lasgn, :b)),
|
|
2334
|
-
s(:to_ary, s(:call, nil, :c))),
|
|
2335
|
-
"Ruby2Ruby" => "a, b = c") # TODO: check this is right
|
|
2336
|
-
|
|
2337
|
-
add_tests("masgn_splat_rhs_1",
|
|
2338
|
-
"Ruby" => "a, b = *c",
|
|
2339
|
-
"ParseTree" => s(:masgn,
|
|
2340
|
-
s(:array,
|
|
2341
|
-
s(:lasgn, :a),
|
|
2342
|
-
s(:lasgn, :b)),
|
|
2343
|
-
s(:splat, s(:call, nil, :c))))
|
|
2344
|
-
|
|
2345
|
-
add_tests("masgn_splat_rhs_n",
|
|
2346
|
-
"Ruby" => "a, b = c, d, *e",
|
|
2347
|
-
"ParseTree" => s(:masgn,
|
|
2348
|
-
s(:array,
|
|
2349
|
-
s(:lasgn, :a),
|
|
2350
|
-
s(:lasgn, :b)),
|
|
2351
|
-
s(:array,
|
|
2352
|
-
s(:call, nil, :c),
|
|
2353
|
-
s(:call, nil, :d),
|
|
2354
|
-
s(:splat, s(:call, nil, :e)))))
|
|
2355
|
-
|
|
2356
|
-
add_tests("masgn_splat_to_ary",
|
|
2357
|
-
"Ruby" => "a, b, *c = d",
|
|
2358
|
-
"ParseTree" => s(:masgn,
|
|
2359
|
-
s(:array,
|
|
2360
|
-
s(:lasgn, :a),
|
|
2361
|
-
s(:lasgn, :b),
|
|
2362
|
-
s(:splat, s(:lasgn, :c))),
|
|
2363
|
-
s(:to_ary, s(:call, nil, :d))))
|
|
2364
|
-
|
|
2365
|
-
add_tests("masgn_splat_to_ary2",
|
|
2366
|
-
"Ruby" => "a, b, *c = d.e(\"f\")",
|
|
2367
|
-
"ParseTree" => s(:masgn,
|
|
2368
|
-
s(:array,
|
|
2369
|
-
s(:lasgn, :a),
|
|
2370
|
-
s(:lasgn, :b),
|
|
2371
|
-
s(:splat, s(:lasgn, :c))),
|
|
2372
|
-
s(:to_ary,
|
|
2373
|
-
s(:call,
|
|
2374
|
-
s(:call, nil, :d),
|
|
2375
|
-
:e,
|
|
2376
|
-
s(:str, "f")))))
|
|
2377
|
-
|
|
2378
|
-
add_tests("match",
|
|
2379
|
-
"Ruby" => "1 if /x/",
|
|
2380
|
-
"ParseTree" => s(:if, s(:match, s(:lit, /x/)), s(:lit, 1), nil))
|
|
2381
|
-
|
|
2382
|
-
add_tests("match2",
|
|
2383
|
-
"Ruby" => "/x/ =~ \"blah\"",
|
|
2384
|
-
"ParseTree" => s(:match2, s(:lit, /x/), s(:str, "blah")))
|
|
2385
|
-
|
|
2386
|
-
add_tests("match3",
|
|
2387
|
-
"Ruby" => "\"blah\" =~ /x/",
|
|
2388
|
-
"ParseTree" => s(:match3, s(:lit, /x/), s(:str, "blah")))
|
|
2389
|
-
|
|
2390
|
-
add_tests("module",
|
|
2391
|
-
"Ruby" => "module X\n def y\n # do nothing\n end\nend",
|
|
2392
|
-
"ParseTree" => s(:module, :X,
|
|
2393
|
-
s(:defn, :y, s(:args), s(:nil))))
|
|
2394
|
-
|
|
2395
|
-
add_tests("module2",
|
|
2396
|
-
"Ruby" => "module X\n def y\n # do nothing\n end\n \n def z\n # do nothing\n end\nend",
|
|
2397
|
-
"ParseTree" => s(:module, :X,
|
|
2398
|
-
s(:defn, :y, s(:args), s(:nil)),
|
|
2399
|
-
s(:defn, :z, s(:args), s(:nil))))
|
|
2400
|
-
|
|
2401
|
-
add_tests("module_scoped",
|
|
2402
|
-
"Ruby" => "module X::Y\n c\nend",
|
|
2403
|
-
"ParseTree" => s(:module, s(:colon2, s(:const, :X), :Y),
|
|
2404
|
-
s(:call, nil, :c)))
|
|
2405
|
-
|
|
2406
|
-
add_tests("module_scoped3",
|
|
2407
|
-
"Ruby" => "module ::Y\n c\nend",
|
|
2408
|
-
"ParseTree" => s(:module, s(:colon3, :Y),
|
|
2409
|
-
s(:call, nil, :c)))
|
|
2410
|
-
|
|
2411
|
-
add_tests("next",
|
|
2412
|
-
"Ruby" => "loop { next if false }",
|
|
2413
|
-
"ParseTree" => s(:iter,
|
|
2414
|
-
s(:call, nil, :loop),
|
|
2415
|
-
0,
|
|
2416
|
-
s(:if, s(:false), s(:next), nil)))
|
|
2417
|
-
|
|
2418
|
-
add_tests("next_arg",
|
|
2419
|
-
"Ruby" => "loop { next 42 if false }",
|
|
2420
|
-
"ParseTree" => s(:iter,
|
|
2421
|
-
s(:call, nil, :loop),
|
|
2422
|
-
0,
|
|
2423
|
-
s(:if, s(:false), s(:next, s(:lit, 42)), nil)))
|
|
2424
|
-
|
|
2425
|
-
add_tests("nth_ref",
|
|
2426
|
-
"Ruby" => "$1",
|
|
2427
|
-
"ParseTree" => s(:nth_ref, 1))
|
|
2428
|
-
|
|
2429
|
-
add_tests("op_asgn1",
|
|
2430
|
-
"Ruby" => "b = []\nb[1] ||= 10\nb[2] &&= 11\nb[3] += 12\n",
|
|
2431
|
-
"ParseTree" => s(:block,
|
|
2432
|
-
s(:lasgn, :b, s(:array)),
|
|
2433
|
-
s(:op_asgn1, s(:lvar, :b),
|
|
2434
|
-
s(:arglist, s(:lit, 1)), :"||", s(:lit, 10)),
|
|
2435
|
-
s(:op_asgn1, s(:lvar, :b),
|
|
2436
|
-
s(:arglist, s(:lit, 2)), :"&&", s(:lit, 11)),
|
|
2437
|
-
s(:op_asgn1, s(:lvar, :b),
|
|
2438
|
-
s(:arglist, s(:lit, 3)), :+, s(:lit, 12))))
|
|
2439
|
-
|
|
2440
|
-
add_tests("op_asgn1_ivar",
|
|
2441
|
-
"Ruby" => "@b = []\n@b[1] ||= 10\n@b[2] &&= 11\n@b[3] += 12\n",
|
|
2442
|
-
"ParseTree" => s(:block,
|
|
2443
|
-
s(:iasgn, :@b, s(:array)),
|
|
2444
|
-
s(:op_asgn1, s(:ivar, :@b),
|
|
2445
|
-
s(:arglist, s(:lit, 1)), :"||", s(:lit, 10)),
|
|
2446
|
-
s(:op_asgn1, s(:ivar, :@b),
|
|
2447
|
-
s(:arglist, s(:lit, 2)), :"&&", s(:lit, 11)),
|
|
2448
|
-
s(:op_asgn1, s(:ivar, :@b),
|
|
2449
|
-
s(:arglist, s(:lit, 3)), :+, s(:lit, 12))))
|
|
2450
|
-
|
|
2451
|
-
add_tests("op_asgn2",
|
|
2452
|
-
"Ruby" => "s = Struct.new(:var)\nc = s.new(nil)\nc.var ||= 20\nc.var &&= 21\nc.var += 22\nc.d.e.f ||= 42\n",
|
|
2453
|
-
"ParseTree" => s(:block,
|
|
2454
|
-
s(:lasgn, :s,
|
|
2455
|
-
s(:call,
|
|
2456
|
-
s(:const, :Struct),
|
|
2457
|
-
:new,
|
|
2458
|
-
s(:lit, :var))),
|
|
2459
|
-
s(:lasgn, :c,
|
|
2460
|
-
s(:call, s(:lvar, :s), :new, s(:nil))),
|
|
2461
|
-
s(:op_asgn2, s(:lvar, :c),
|
|
2462
|
-
:var=, :"||", s(:lit, 20)),
|
|
2463
|
-
s(:op_asgn2, s(:lvar, :c),
|
|
2464
|
-
:var=, :"&&", s(:lit, 21)),
|
|
2465
|
-
s(:op_asgn2, s(:lvar, :c),
|
|
2466
|
-
:var=, :+, s(:lit, 22)),
|
|
2467
|
-
s(:op_asgn2,
|
|
2468
|
-
s(:call,
|
|
2469
|
-
s(:call, s(:lvar, :c), :d),
|
|
2470
|
-
:e),
|
|
2471
|
-
:f=, :"||", s(:lit, 42))))
|
|
2472
|
-
|
|
2473
|
-
add_tests("op_asgn2_self",
|
|
2474
|
-
"Ruby" => "self.Bag ||= Bag.new",
|
|
2475
|
-
"ParseTree" => s(:op_asgn2, s(:self), :"Bag=", :"||",
|
|
2476
|
-
s(:call, s(:const, :Bag), :new)))
|
|
2477
|
-
|
|
2478
|
-
add_tests("op_asgn_and",
|
|
2479
|
-
"Ruby" => "a = 0\na &&= 2\n",
|
|
2480
|
-
"ParseTree" => s(:block,
|
|
2481
|
-
s(:lasgn, :a, s(:lit, 0)),
|
|
2482
|
-
s(:op_asgn_and,
|
|
2483
|
-
s(:lvar, :a), s(:lasgn, :a, s(:lit, 2)))))
|
|
2484
|
-
|
|
2485
|
-
add_tests("op_asgn_and_ivar2",
|
|
2486
|
-
"Ruby" => "@fetcher &&= new(Gem.configuration[:http_proxy])",
|
|
2487
|
-
"ParseTree" => s(:op_asgn_and,
|
|
2488
|
-
s(:ivar, :@fetcher),
|
|
2489
|
-
s(:iasgn,
|
|
2490
|
-
:@fetcher,
|
|
2491
|
-
s(:call, nil,
|
|
2492
|
-
:new,
|
|
2493
|
-
s(:call,
|
|
2494
|
-
s(:call, s(:const, :Gem), :configuration),
|
|
2495
|
-
:[],
|
|
2496
|
-
s(:lit, :http_proxy))))))
|
|
2497
|
-
|
|
2498
|
-
add_tests("op_asgn_or",
|
|
2499
|
-
"Ruby" => "a = 0\na ||= 1\n",
|
|
2500
|
-
"ParseTree" => s(:block,
|
|
2501
|
-
s(:lasgn, :a, s(:lit, 0)),
|
|
2502
|
-
s(:op_asgn_or,
|
|
2503
|
-
s(:lvar, :a), s(:lasgn, :a, s(:lit, 1)))))
|
|
2504
|
-
|
|
2505
|
-
add_tests("op_asgn_or_block",
|
|
2506
|
-
"Ruby" => "a ||= begin\n b\n rescue\n c\n end",
|
|
2507
|
-
"ParseTree" => s(:op_asgn_or,
|
|
2508
|
-
s(:lvar, :a),
|
|
2509
|
-
s(:lasgn, :a,
|
|
2510
|
-
s(:rescue,
|
|
2511
|
-
s(:call, nil, :b),
|
|
2512
|
-
s(:resbody, s(:array),
|
|
2513
|
-
s(:call, nil, :c))))),
|
|
2514
|
-
"Ruby2Ruby" => "a ||= b rescue c")
|
|
2515
|
-
|
|
2516
|
-
add_tests("op_asgn_or_ivar",
|
|
2517
|
-
"Ruby" => "@v ||= {}",
|
|
2518
|
-
"ParseTree" => s(:op_asgn_or,
|
|
2519
|
-
s(:ivar, :@v),
|
|
2520
|
-
s(:iasgn, :@v, s(:hash))))
|
|
2521
|
-
|
|
2522
|
-
add_tests("op_asgn_or_ivar2",
|
|
2523
|
-
"Ruby" => "@fetcher ||= new(Gem.configuration[:http_proxy])",
|
|
2524
|
-
"ParseTree" => s(:op_asgn_or,
|
|
2525
|
-
s(:ivar, :@fetcher),
|
|
2526
|
-
s(:iasgn,
|
|
2527
|
-
:@fetcher,
|
|
2528
|
-
s(:call, nil, :new,
|
|
2529
|
-
s(:call,
|
|
2530
|
-
s(:call, s(:const, :Gem), :configuration),
|
|
2531
|
-
:[],
|
|
2532
|
-
s(:lit, :http_proxy))))))
|
|
2533
|
-
|
|
2534
|
-
add_tests("or",
|
|
2535
|
-
"Ruby" => "(a or b)",
|
|
2536
|
-
"ParseTree" => s(:or,
|
|
2537
|
-
s(:call, nil, :a),
|
|
2538
|
-
s(:call, nil, :b)))
|
|
2539
|
-
|
|
2540
|
-
add_tests("or_big",
|
|
2541
|
-
"Ruby" => "((a or b) or (c and d))",
|
|
2542
|
-
"ParseTree" => s(:or,
|
|
2543
|
-
s(:or,
|
|
2544
|
-
s(:call, nil, :a),
|
|
2545
|
-
s(:call, nil, :b)),
|
|
2546
|
-
s(:and,
|
|
2547
|
-
s(:call, nil, :c),
|
|
2548
|
-
s(:call, nil, :d))))
|
|
2549
|
-
|
|
2550
|
-
add_tests("or_big2",
|
|
2551
|
-
"Ruby" => "((a || b) || (c && d))",
|
|
2552
|
-
"ParseTree" => s(:or,
|
|
2553
|
-
s(:or,
|
|
2554
|
-
s(:call, nil, :a),
|
|
2555
|
-
s(:call, nil, :b)),
|
|
2556
|
-
s(:and,
|
|
2557
|
-
s(:call, nil, :c),
|
|
2558
|
-
s(:call, nil, :d))),
|
|
2559
|
-
"Ruby2Ruby" => "((a or b) or (c and d))")
|
|
2560
|
-
|
|
2561
|
-
add_tests("parse_floats_as_args",
|
|
2562
|
-
"Ruby" => "def x(a=0.0,b=0.0)\n a+b\nend",
|
|
2563
|
-
"ParseTree" => s(:defn, :x,
|
|
2564
|
-
s(:args,
|
|
2565
|
-
s(:lasgn, :a, s(:lit, 0.0)),
|
|
2566
|
-
s(:lasgn, :b, s(:lit, 0.0))),
|
|
2567
|
-
s(:call, s(:lvar, :a), :+, s(:lvar, :b))),
|
|
2568
|
-
"Ruby2Ruby" => "def x(a = 0.0, b = 0.0)\n (a + b)\nend")
|
|
2569
|
-
|
|
2570
|
-
add_tests("postexe",
|
|
2571
|
-
"Ruby" => "END { 1 }",
|
|
2572
|
-
"ParseTree" => s(:iter, s(:postexe), 0, s(:lit, 1)))
|
|
2573
|
-
|
|
2574
|
-
add_tests("proc_args_0",
|
|
2575
|
-
"Ruby" => "proc { || (x + 1) }",
|
|
2576
|
-
"ParseTree" => s(:iter,
|
|
2577
|
-
s(:call, nil, :proc),
|
|
2578
|
-
s(:args),
|
|
2579
|
-
s(:call, s(:call, nil, :x), :+, s(:lit, 1))))
|
|
2580
|
-
|
|
2581
|
-
add_tests("proc_args_1",
|
|
2582
|
-
"Ruby" => "proc { |x| (x + 1) }",
|
|
2583
|
-
"ParseTree" => s(:iter,
|
|
2584
|
-
s(:call, nil, :proc),
|
|
2585
|
-
s(:args, :x),
|
|
2586
|
-
s(:call, s(:lvar, :x), :+, s(:lit, 1))))
|
|
2587
|
-
|
|
2588
|
-
add_tests("proc_args_2",
|
|
2589
|
-
"Ruby" => "proc { |x, y| (x + y) }",
|
|
2590
|
-
"ParseTree" => s(:iter,
|
|
2591
|
-
s(:call, nil, :proc),
|
|
2592
|
-
s(:args, :x, :y),
|
|
2593
|
-
s(:call, s(:lvar, :x), :+, s(:lvar, :y))))
|
|
2594
|
-
|
|
2595
|
-
add_tests("proc_args_no",
|
|
2596
|
-
"Ruby" => "proc { (x + 1) }",
|
|
2597
|
-
"ParseTree" => s(:iter,
|
|
2598
|
-
s(:call, nil, :proc),
|
|
2599
|
-
0,
|
|
2600
|
-
s(:call, s(:call, nil, :x), :+, s(:lit, 1))))
|
|
2601
|
-
|
|
2602
|
-
add_tests("redo",
|
|
2603
|
-
"Ruby" => "loop { redo if false }",
|
|
2604
|
-
"ParseTree" => s(:iter,
|
|
2605
|
-
s(:call, nil, :loop),
|
|
2606
|
-
0,
|
|
2607
|
-
s(:if, s(:false), s(:redo), nil)))
|
|
2608
|
-
|
|
2609
|
-
add_tests("rescue", # TODO: need a resbody w/ multiple classes and a splat
|
|
2610
|
-
"Ruby" => "blah rescue nil",
|
|
2611
|
-
"ParseTree" => s(:rescue,
|
|
2612
|
-
s(:call, nil, :blah),
|
|
2613
|
-
s(:resbody, s(:array), s(:nil))))
|
|
2614
|
-
|
|
2615
|
-
add_tests("rescue_block_body",
|
|
2616
|
-
"Ruby" => "begin\n a\nrescue => e\n c\n d\nend",
|
|
2617
|
-
"ParseTree" => s(:rescue,
|
|
2618
|
-
s(:call, nil, :a),
|
|
2619
|
-
s(:resbody,
|
|
2620
|
-
s(:array, s(:lasgn, :e, s(:gvar, :$!))),
|
|
2621
|
-
s(:call, nil, :c),
|
|
2622
|
-
s(:call, nil, :d))))
|
|
2623
|
-
|
|
2624
|
-
add_tests("rescue_block_body_3",
|
|
2625
|
-
"Ruby" => "begin\n a\nrescue A\n b\nrescue B\n c\nrescue C\n d\nend",
|
|
2626
|
-
"ParseTree" => s(:rescue,
|
|
2627
|
-
s(:call, nil, :a),
|
|
2628
|
-
s(:resbody, s(:array, s(:const, :A)),
|
|
2629
|
-
s(:call, nil, :b)),
|
|
2630
|
-
s(:resbody, s(:array, s(:const, :B)),
|
|
2631
|
-
s(:call, nil, :c)),
|
|
2632
|
-
s(:resbody, s(:array, s(:const, :C)),
|
|
2633
|
-
s(:call, nil, :d))))
|
|
2634
|
-
|
|
2635
|
-
add_tests("rescue_block_body_ivar",
|
|
2636
|
-
"Ruby" => "begin\n a\nrescue => @e\n c\n d\nend",
|
|
2637
|
-
"ParseTree" => s(:rescue,
|
|
2638
|
-
s(:call, nil, :a),
|
|
2639
|
-
s(:resbody,
|
|
2640
|
-
s(:array, s(:iasgn, :@e, s(:gvar, :$!))),
|
|
2641
|
-
s(:call, nil, :c),
|
|
2642
|
-
s(:call, nil, :d))))
|
|
2643
|
-
|
|
2644
|
-
add_tests("rescue_block_nada",
|
|
2645
|
-
"Ruby" => "begin\n blah\nrescue\n # do nothing\nend",
|
|
2646
|
-
"ParseTree" => s(:rescue,
|
|
2647
|
-
s(:call, nil, :blah),
|
|
2648
|
-
s(:resbody, s(:array), nil)))
|
|
2649
|
-
|
|
2650
|
-
add_tests("rescue_exceptions",
|
|
2651
|
-
"Ruby" => "begin\n blah\nrescue RuntimeError => r\n # do nothing\nend",
|
|
2652
|
-
"ParseTree" => s(:rescue,
|
|
2653
|
-
s(:call, nil, :blah),
|
|
2654
|
-
s(:resbody,
|
|
2655
|
-
s(:array,
|
|
2656
|
-
s(:const, :RuntimeError),
|
|
2657
|
-
s(:lasgn, :r, s(:gvar, :$!))),
|
|
2658
|
-
nil)))
|
|
2659
|
-
|
|
2660
|
-
add_tests("rescue_iasgn_var_empty",
|
|
2661
|
-
"Ruby" => "begin\n 1\nrescue => @e\n # do nothing\nend",
|
|
2662
|
-
"ParseTree" => s(:rescue,
|
|
2663
|
-
s(:lit, 1),
|
|
2664
|
-
s(:resbody,
|
|
2665
|
-
s(:array, s(:iasgn, :@e, s(:gvar, :$!))),
|
|
2666
|
-
nil)))
|
|
2667
|
-
|
|
2668
|
-
add_tests("rescue_lasgn",
|
|
2669
|
-
"Ruby" => "begin\n 1\nrescue\n var = 2\nend",
|
|
2670
|
-
"ParseTree" => s(:rescue,
|
|
2671
|
-
s(:lit, 1),
|
|
2672
|
-
s(:resbody,
|
|
2673
|
-
s(:array),
|
|
2674
|
-
s(:lasgn, :var, s(:lit, 2)))),
|
|
2675
|
-
"Ruby2Ruby" => "1 rescue var = 2")
|
|
2676
|
-
|
|
2677
|
-
add_tests("rescue_lasgn_var",
|
|
2678
|
-
"Ruby" => "begin\n 1\nrescue => e\n var = 2\nend",
|
|
2679
|
-
"ParseTree" => s(:rescue,
|
|
2680
|
-
s(:lit, 1),
|
|
2681
|
-
s(:resbody,
|
|
2682
|
-
s(:array, s(:lasgn, :e, s(:gvar, :$!))),
|
|
2683
|
-
s(:lasgn, :var, s(:lit, 2)))))
|
|
2684
|
-
|
|
2685
|
-
add_tests("rescue_lasgn_var_empty",
|
|
2686
|
-
"Ruby" => "begin\n 1\nrescue => e\n # do nothing\nend",
|
|
2687
|
-
"ParseTree" => s(:rescue,
|
|
2688
|
-
s(:lit, 1),
|
|
2689
|
-
s(:resbody,
|
|
2690
|
-
s(:array, s(:lasgn, :e, s(:gvar, :$!))),
|
|
2691
|
-
nil)))
|
|
2692
|
-
|
|
2693
|
-
add_tests("retry",
|
|
2694
|
-
"Ruby" => "retry",
|
|
2695
|
-
"ParseTree" => s(:retry))
|
|
2696
|
-
|
|
2697
|
-
add_tests("return_0",
|
|
2698
|
-
"Ruby" => "return",
|
|
2699
|
-
"ParseTree" => s(:return))
|
|
2700
|
-
|
|
2701
|
-
add_tests("return_1",
|
|
2702
|
-
"Ruby" => "return 1",
|
|
2703
|
-
"ParseTree" => s(:return, s(:lit, 1)))
|
|
2704
|
-
|
|
2705
|
-
add_tests("return_1_splatted",
|
|
2706
|
-
"Ruby" => "return *1",
|
|
2707
|
-
"ParseTree" => s(:return, s(:svalue, s(:splat, s(:lit, 1)))))
|
|
2708
|
-
|
|
2709
|
-
add_tests("return_n",
|
|
2710
|
-
"Ruby" => "return 1, 2, 3",
|
|
2711
|
-
"ParseTree" => s(:return, s(:array,
|
|
2712
|
-
s(:lit, 1), s(:lit, 2), s(:lit, 3))),
|
|
2713
|
-
"Ruby2Ruby" => "return [1, 2, 3]")
|
|
2714
|
-
|
|
2715
|
-
add_tests("sclass",
|
|
2716
|
-
"Ruby" => "class << self\n 42\nend",
|
|
2717
|
-
"ParseTree" => s(:sclass, s(:self), s(:lit, 42)))
|
|
2718
|
-
|
|
2719
|
-
add_tests("sclass_multiple",
|
|
2720
|
-
"Ruby" => "class << self\n x\n y\nend",
|
|
2721
|
-
"ParseTree" => s(:sclass, s(:self),
|
|
2722
|
-
s(:call, nil, :x), s(:call, nil, :y)))
|
|
2723
|
-
|
|
2724
|
-
add_tests("sclass_trailing_class",
|
|
2725
|
-
"Ruby" => "class A\n class << self\n a\n end\n \n class B\n end\nend",
|
|
2726
|
-
"ParseTree" => s(:class, :A, nil,
|
|
2727
|
-
s(:sclass, s(:self),
|
|
2728
|
-
s(:call, nil, :a)),
|
|
2729
|
-
s(:class, :B, nil)))
|
|
2730
|
-
|
|
2731
|
-
add_tests("splat",
|
|
2732
|
-
"Ruby" => "def x(*b)\n a(*b)\nend",
|
|
2733
|
-
"ParseTree" => s(:defn, :x,
|
|
2734
|
-
s(:args, :"*b"),
|
|
2735
|
-
s(:call, nil, :a, s(:splat, s(:lvar, :b)))))
|
|
2736
|
-
|
|
2737
|
-
add_tests("splat_array",
|
|
2738
|
-
"Ruby" => "[*[1]]",
|
|
2739
|
-
"ParseTree" => s(:array, s(:splat, s(:array, s(:lit, 1)))))
|
|
2740
|
-
|
|
2741
|
-
add_tests("splat_break",
|
|
2742
|
-
"Ruby" => "break *[1]",
|
|
2743
|
-
"ParseTree" => s(:break, s(:svalue, s(:splat, s(:array, s(:lit, 1))))))
|
|
2744
|
-
|
|
2745
|
-
add_tests("splat_break_array",
|
|
2746
|
-
"Ruby" => "break [*[1]]",
|
|
2747
|
-
"ParseTree" => s(:break, s(:array, s(:splat, s(:array, s(:lit, 1))))))
|
|
2748
|
-
|
|
2749
|
-
add_tests("splat_fcall",
|
|
2750
|
-
"Ruby" => "meth(*[1])",
|
|
2751
|
-
"ParseTree" => s(:call,
|
|
2752
|
-
nil,
|
|
2753
|
-
:meth,
|
|
2754
|
-
s(:splat, s(:array, s(:lit, 1)))))
|
|
2755
|
-
|
|
2756
|
-
add_tests("splat_fcall_array",
|
|
2757
|
-
"Ruby" => "meth([*[1]])",
|
|
2758
|
-
"ParseTree" => s(:call, nil, :meth,
|
|
2759
|
-
s(:array, s(:splat, s(:array, s(:lit, 1))))))
|
|
2760
|
-
|
|
2761
|
-
add_tests("splat_lasgn",
|
|
2762
|
-
"Ruby" => "x = *[1]",
|
|
2763
|
-
"ParseTree" => s(:lasgn, :x, s(:svalue, s(:splat, s(:array, s(:lit, 1))))))
|
|
2764
|
-
|
|
2765
|
-
add_tests("splat_lasgn_array",
|
|
2766
|
-
"Ruby" => "x = [*[1]]",
|
|
2767
|
-
"ParseTree" => s(:lasgn, :x, s(:array, s(:splat, s(:array, s(:lit, 1))))))
|
|
2768
|
-
|
|
2769
|
-
add_tests("splat_lit_1",
|
|
2770
|
-
"Ruby" => "[*1]",
|
|
2771
|
-
# UGH - damn MRI
|
|
2772
|
-
"ParseTree" => s(:array, s(:splat, s(:lit, 1))))
|
|
2773
|
-
|
|
2774
|
-
add_tests("splat_lit_n",
|
|
2775
|
-
"Ruby" => "[1, *2]",
|
|
2776
|
-
"ParseTree" => s(:array, s(:lit, 1), s(:splat, s(:lit, 2))))
|
|
2777
|
-
|
|
2778
|
-
add_tests("splat_next",
|
|
2779
|
-
"Ruby" => "next *[1]",
|
|
2780
|
-
"ParseTree" => s(:next, s(:svalue, s(:splat, s(:array, s(:lit, 1))))))
|
|
2781
|
-
|
|
2782
|
-
add_tests("splat_next_array",
|
|
2783
|
-
"Ruby" => "next [*[1]]",
|
|
2784
|
-
"ParseTree" => s(:next, s(:array, s(:splat, s(:array, s(:lit, 1))))))
|
|
2785
|
-
|
|
2786
|
-
add_tests("splat_return",
|
|
2787
|
-
"Ruby" => "return *[1]",
|
|
2788
|
-
"ParseTree" => s(:return, s(:svalue, s(:splat, s(:array, s(:lit, 1))))))
|
|
2789
|
-
|
|
2790
|
-
add_tests("splat_return_array",
|
|
2791
|
-
"Ruby" => "return [*[1]]",
|
|
2792
|
-
"ParseTree" => s(:return, s(:array, s(:splat, s(:array, s(:lit, 1))))))
|
|
2793
|
-
|
|
2794
|
-
add_tests("splat_super",
|
|
2795
|
-
"Ruby" => "super(*[1])",
|
|
2796
|
-
"ParseTree" => s(:super, s(:splat, s(:array, s(:lit, 1)))))
|
|
2797
|
-
|
|
2798
|
-
add_tests("splat_super_array",
|
|
2799
|
-
"Ruby" => "super([*[1]])",
|
|
2800
|
-
"ParseTree" => s(:super, s(:array, s(:splat, s(:array, s(:lit, 1))))))
|
|
2801
|
-
|
|
2802
|
-
add_tests("splat_yield",
|
|
2803
|
-
"Ruby" => "yield(*[1])",
|
|
2804
|
-
"ParseTree" => s(:yield, s(:splat, s(:array, s(:lit, 1)))))
|
|
2805
|
-
|
|
2806
|
-
add_tests("splat_yield_array",
|
|
2807
|
-
"Ruby" => "yield([*[1]])",
|
|
2808
|
-
"ParseTree" => s(:yield, s(:array, s(:splat, s(:array, s(:lit, 1))))))
|
|
2809
|
-
|
|
2810
|
-
add_tests("str",
|
|
2811
|
-
"Ruby" => '"x"',
|
|
2812
|
-
"ParseTree" => s(:str, "x"))
|
|
2813
|
-
|
|
2814
|
-
add_tests("str_concat_newline", # FIX? make prettier? possible?
|
|
2815
|
-
"Ruby" => '"before" \\
|
|
2816
|
-
" after"',
|
|
2817
|
-
"ParseTree" => s(:str, "before after"),
|
|
2818
|
-
"Ruby2Ruby" => '"before after"')
|
|
2819
|
-
|
|
2820
|
-
add_tests("str_concat_space",
|
|
2821
|
-
"Ruby" => '"before" " after"',
|
|
2822
|
-
"ParseTree" => s(:str, "before after"),
|
|
2823
|
-
"Ruby2Ruby" => '"before after"')
|
|
2824
|
-
|
|
2825
|
-
add_tests("str_heredoc",
|
|
2826
|
-
"Ruby" => "<<'EOM'\n blah\nblah\nEOM",
|
|
2827
|
-
"ParseTree" => s(:str, " blah\nblah\n"),
|
|
2828
|
-
"Ruby2Ruby" => "\" blah\\nblah\\n\"")
|
|
2829
|
-
|
|
2830
|
-
add_tests("str_heredoc_call",
|
|
2831
|
-
"Ruby" => "<<'EOM'.strip\n blah\nblah\nEOM",
|
|
2832
|
-
"ParseTree" => s(:call, s(:str, " blah\nblah\n"),
|
|
2833
|
-
:strip),
|
|
2834
|
-
"Ruby2Ruby" => "\" blah\\nblah\\n\".strip")
|
|
2835
|
-
|
|
2836
|
-
add_tests("str_heredoc_double",
|
|
2837
|
-
"Ruby" => "a += <<-H1 + b + <<-H2\n first\nH1\n second\nH2",
|
|
2838
|
-
"ParseTree" => s(:lasgn, :a,
|
|
2839
|
-
s(:call,
|
|
2840
|
-
s(:lvar, :a),
|
|
2841
|
-
:+,
|
|
2842
|
-
s(:call,
|
|
2843
|
-
s(:call,
|
|
2844
|
-
s(:str, " first\n"),
|
|
2845
|
-
:+,
|
|
2846
|
-
s(:call, nil, :b)),
|
|
2847
|
-
:+,
|
|
2848
|
-
s(:str, " second\n")))),
|
|
2849
|
-
"Ruby2Ruby" => "a = (a + ((\" first\\n\" + b) + \" second\\n\"))")
|
|
2850
|
-
|
|
2851
|
-
add_tests("str_heredoc_empty", # yes... tarded
|
|
2852
|
-
"Ruby" => "<<'EOM'\nEOM",
|
|
2853
|
-
"ParseTree" => s(:str, ""),
|
|
2854
|
-
"Ruby2Ruby" => '""')
|
|
2855
|
-
|
|
2856
|
-
add_tests("str_heredoc_indent",
|
|
2857
|
-
"Ruby" => "<<-EOM\n blah\nblah\n\n EOM",
|
|
2858
|
-
"ParseTree" => s(:str, " blah\nblah\n\n"),
|
|
2859
|
-
"Ruby2Ruby" => "\" blah\\nblah\\n\\n\"")
|
|
2860
|
-
|
|
2861
|
-
add_tests("str_interp_file",
|
|
2862
|
-
"Ruby" => '"file = #{__FILE__}\n"',
|
|
2863
|
-
"ParseTree" => s(:str, "file = (string)\n"),
|
|
2864
|
-
"Ruby2Ruby" => '"file = (string)\\n"')
|
|
2865
|
-
|
|
2866
|
-
add_tests("structure_extra_block_for_dvar_scoping",
|
|
2867
|
-
"Ruby" => "a.b do |c, d|\n unless e.f(c) then\n g = false\n d.h { |x, i| g = true }\n end\nend",
|
|
2868
|
-
"ParseTree" => s(:iter,
|
|
2869
|
-
s(:call, s(:call, nil, :a), :b),
|
|
2870
|
-
s(:args, :c, :d),
|
|
2871
|
-
s(:if,
|
|
2872
|
-
s(:call, s(:call, nil, :e), :f, s(:lvar, :c)),
|
|
2873
|
-
nil,
|
|
2874
|
-
s(:block,
|
|
2875
|
-
s(:lasgn, :g, s(:false)),
|
|
2876
|
-
s(:iter,
|
|
2877
|
-
s(:call, s(:lvar, :d), :h),
|
|
2878
|
-
s(:args, :x, :i),
|
|
2879
|
-
s(:lasgn, :g, s(:true)))))))
|
|
2880
|
-
|
|
2881
|
-
add_tests("structure_remove_begin_1",
|
|
2882
|
-
"Ruby" => "a << begin\n b\n rescue\n c\n end",
|
|
2883
|
-
"ParseTree" => s(:call, s(:call, nil, :a), :<<,
|
|
2884
|
-
s(:rescue,
|
|
2885
|
-
s(:call, nil, :b),
|
|
2886
|
-
s(:resbody, s(:array),
|
|
2887
|
-
s(:call, nil, :c)))),
|
|
2888
|
-
"Ruby2Ruby" => "(a << (b rescue c))")
|
|
2889
|
-
|
|
2890
|
-
add_tests("structure_remove_begin_2",
|
|
2891
|
-
"Ruby" => "a = if c\n begin\n b\n rescue\n nil\n end\n end\na",
|
|
2892
|
-
"ParseTree" => s(:block,
|
|
2893
|
-
s(:lasgn,
|
|
2894
|
-
:a,
|
|
2895
|
-
s(:if, s(:call, nil, :c),
|
|
2896
|
-
s(:rescue, s(:call, nil, :b),
|
|
2897
|
-
s(:resbody,
|
|
2898
|
-
s(:array), s(:nil))),
|
|
2899
|
-
nil)),
|
|
2900
|
-
s(:lvar, :a)),
|
|
2901
|
-
"Ruby2Ruby" => "a = b rescue nil if c\na\n") # OMG that's awesome
|
|
2902
|
-
|
|
2903
|
-
add_tests("super_0",
|
|
2904
|
-
"Ruby" => "def x\n super()\nend",
|
|
2905
|
-
"ParseTree" => s(:defn, :x, s(:args), s(:super)))
|
|
2906
|
-
|
|
2907
|
-
add_tests("super_1",
|
|
2908
|
-
"Ruby" => "def x\n super(4)\nend",
|
|
2909
|
-
"ParseTree" => s(:defn, :x, s(:args),
|
|
2910
|
-
s(:super, s(:lit, 4))))
|
|
2911
|
-
|
|
2912
|
-
add_tests("super_1_array",
|
|
2913
|
-
"Ruby" => "def x\n super([24, 42])\nend",
|
|
2914
|
-
"ParseTree" => s(:defn, :x, s(:args),
|
|
2915
|
-
s(:super, s(:array, s(:lit, 24), s(:lit, 42)))))
|
|
2916
|
-
|
|
2917
|
-
add_tests("super_block_pass",
|
|
2918
|
-
"Ruby" => "super(a, &b)",
|
|
2919
|
-
"ParseTree" => s(:super,
|
|
2920
|
-
s(:call, nil, :a),
|
|
2921
|
-
s(:block_pass,
|
|
2922
|
-
s(:call, nil, :b))))
|
|
2923
|
-
|
|
2924
|
-
add_tests("super_block_splat",
|
|
2925
|
-
"Ruby" => "super(a, *b)",
|
|
2926
|
-
"ParseTree" => s(:super,
|
|
2927
|
-
s(:call, nil, :a),
|
|
2928
|
-
s(:splat, s(:call, nil, :b))))
|
|
2929
|
-
|
|
2930
|
-
add_tests("super_n",
|
|
2931
|
-
"Ruby" => "def x\n super(24, 42)\nend",
|
|
2932
|
-
"ParseTree" => s(:defn, :x, s(:args),
|
|
2933
|
-
s(:super, s(:lit, 24), s(:lit, 42))))
|
|
2934
|
-
|
|
2935
|
-
add_tests("svalue",
|
|
2936
|
-
"Ruby" => "a = *b",
|
|
2937
|
-
"ParseTree" => s(:lasgn, :a,
|
|
2938
|
-
s(:svalue,
|
|
2939
|
-
s(:splat, s(:call, nil, :b)))))
|
|
2940
|
-
|
|
2941
|
-
add_tests("ternary_nil_no_space",
|
|
2942
|
-
"Ruby" => "1 ? nil: 1",
|
|
2943
|
-
"ParseTree" => s(:if, s(:lit, 1), s(:nil), s(:lit, 1)),
|
|
2944
|
-
"Ruby2Ruby" => "1 ? (nil) : (1)")
|
|
2945
|
-
|
|
2946
|
-
add_tests("ternary_symbol_no_spaces",
|
|
2947
|
-
"Ruby" => "1?:x:1",
|
|
2948
|
-
"ParseTree" => s(:if, s(:lit, 1), s(:lit, :x), s(:lit, 1)),
|
|
2949
|
-
"Ruby2Ruby" => "1 ? (:x) : (1)")
|
|
2950
|
-
|
|
2951
|
-
add_tests("to_ary",
|
|
2952
|
-
"Ruby" => "a, b = c",
|
|
2953
|
-
"ParseTree" => s(:masgn,
|
|
2954
|
-
s(:array, s(:lasgn, :a), s(:lasgn, :b)),
|
|
2955
|
-
s(:to_ary, s(:call, nil, :c))))
|
|
2956
|
-
|
|
2957
|
-
add_tests("true",
|
|
2958
|
-
"Ruby" => "true",
|
|
2959
|
-
"ParseTree" => s(:true))
|
|
2960
|
-
|
|
2961
|
-
add_tests("undef",
|
|
2962
|
-
"Ruby" => "undef :x",
|
|
2963
|
-
"ParseTree" => s(:undef, s(:lit, :x)))
|
|
2964
|
-
|
|
2965
|
-
add_tests("undef_2",
|
|
2966
|
-
"Ruby" => "undef :x, :y",
|
|
2967
|
-
"ParseTree" => s(:block,
|
|
2968
|
-
s(:undef, s(:lit, :x)),
|
|
2969
|
-
s(:undef, s(:lit, :y))),
|
|
2970
|
-
"Ruby2Ruby" => "undef :x\nundef :y\n")
|
|
2971
|
-
|
|
2972
|
-
add_tests("undef_3",
|
|
2973
|
-
"Ruby" => "undef :x, :y, :z",
|
|
2974
|
-
"ParseTree" => s(:block,
|
|
2975
|
-
s(:undef, s(:lit, :x)),
|
|
2976
|
-
s(:undef, s(:lit, :y)),
|
|
2977
|
-
s(:undef, s(:lit, :z))),
|
|
2978
|
-
"Ruby2Ruby" => "undef :x\nundef :y\nundef :z\n")
|
|
2979
|
-
|
|
2980
|
-
add_tests("undef_block_1",
|
|
2981
|
-
"Ruby" => "f1\nundef :x\n", # TODO: don't like the extra return
|
|
2982
|
-
"ParseTree" => s(:block,
|
|
2983
|
-
s(:call, nil, :f1),
|
|
2984
|
-
s(:undef, s(:lit, :x))))
|
|
2985
|
-
|
|
2986
|
-
add_tests("undef_block_2",
|
|
2987
|
-
"Ruby" => "f1\nundef :x, :y",
|
|
2988
|
-
"ParseTree" => s(:block,
|
|
2989
|
-
s(:call, nil, :f1),
|
|
2990
|
-
s(:block,
|
|
2991
|
-
s(:undef, s(:lit, :x)),
|
|
2992
|
-
s(:undef, s(:lit, :y)))),
|
|
2993
|
-
"Ruby2Ruby" => "f1\n(undef :x\nundef :y)\n")
|
|
2994
|
-
|
|
2995
|
-
add_tests("undef_block_3",
|
|
2996
|
-
"Ruby" => "f1\nundef :x, :y, :z",
|
|
2997
|
-
"ParseTree" => s(:block,
|
|
2998
|
-
s(:call, nil, :f1),
|
|
2999
|
-
s(:block,
|
|
3000
|
-
s(:undef, s(:lit, :x)),
|
|
3001
|
-
s(:undef, s(:lit, :y)),
|
|
3002
|
-
s(:undef, s(:lit, :z)))),
|
|
3003
|
-
"Ruby2Ruby" => "f1\n(undef :x\nundef :y\nundef :z)\n")
|
|
3004
|
-
|
|
3005
|
-
add_tests("undef_block_3_post",
|
|
3006
|
-
"Ruby" => "undef :x, :y, :z\nf2",
|
|
3007
|
-
"ParseTree" => s(:block,
|
|
3008
|
-
s(:undef, s(:lit, :x)),
|
|
3009
|
-
s(:undef, s(:lit, :y)),
|
|
3010
|
-
s(:undef, s(:lit, :z)),
|
|
3011
|
-
s(:call, nil, :f2)),
|
|
3012
|
-
"Ruby2Ruby" => "undef :x\nundef :y\nundef :z\nf2\n")
|
|
3013
|
-
|
|
3014
|
-
add_tests("undef_block_wtf",
|
|
3015
|
-
"Ruby" => "f1\nundef :x, :y, :z\nf2",
|
|
3016
|
-
"ParseTree" => s(:block,
|
|
3017
|
-
s(:call, nil, :f1),
|
|
3018
|
-
s(:block,
|
|
3019
|
-
s(:undef, s(:lit, :x)),
|
|
3020
|
-
s(:undef, s(:lit, :y)),
|
|
3021
|
-
s(:undef, s(:lit, :z))),
|
|
3022
|
-
s(:call, nil, :f2)),
|
|
3023
|
-
"Ruby2Ruby" => "f1\n(undef :x\nundef :y\nundef :z)\nf2\n")
|
|
3024
|
-
|
|
3025
|
-
add_tests("unless_post",
|
|
3026
|
-
"Ruby" => "a unless b",
|
|
3027
|
-
"ParseTree" => s(:if, s(:call, nil, :b), nil,
|
|
3028
|
-
s(:call, nil, :a)))
|
|
3029
|
-
|
|
3030
|
-
add_tests("unless_pre",
|
|
3031
|
-
"Ruby" => "unless b then a end",
|
|
3032
|
-
"ParseTree" => s(:if, s(:call, nil, :b), nil,
|
|
3033
|
-
s(:call, nil, :a)),
|
|
3034
|
-
"Ruby2Ruby" => "a unless b")
|
|
3035
|
-
|
|
3036
|
-
add_tests("until_post",
|
|
3037
|
-
"Ruby" => "begin\n (1 + 1)\nend until false",
|
|
3038
|
-
"ParseTree" => s(:until, s(:false),
|
|
3039
|
-
s(:call, s(:lit, 1), :+, s(:lit, 1)), false))
|
|
3040
|
-
|
|
3041
|
-
add_tests("until_pre",
|
|
3042
|
-
"Ruby" => "until false do\n (1 + 1)\nend",
|
|
3043
|
-
"ParseTree" => s(:until, s(:false),
|
|
3044
|
-
s(:call, s(:lit, 1), :+, s(:lit, 1)), true))
|
|
3045
|
-
|
|
3046
|
-
add_tests("until_pre_mod",
|
|
3047
|
-
"Ruby" => "(1 + 1) until false",
|
|
3048
|
-
"ParseTree" => s(:until, s(:false),
|
|
3049
|
-
s(:call, s(:lit, 1), :+, s(:lit, 1)), true),
|
|
3050
|
-
"Ruby2Ruby" => "until false do\n (1 + 1)\nend")
|
|
3051
|
-
|
|
3052
|
-
add_tests("valias",
|
|
3053
|
-
"Ruby" => "alias $y $x",
|
|
3054
|
-
"ParseTree" => s(:valias, :$y, :$x))
|
|
3055
|
-
|
|
3056
|
-
add_tests("vcall",
|
|
3057
|
-
"Ruby" => "method",
|
|
3058
|
-
"ParseTree" => s(:call, nil, :method))
|
|
3059
|
-
|
|
3060
|
-
add_tests("while_post",
|
|
3061
|
-
"Ruby" => "begin\n (1 + 1)\nend while false",
|
|
3062
|
-
"ParseTree" => s(:while, s(:false),
|
|
3063
|
-
s(:call, s(:lit, 1), :+, s(:lit, 1)), false))
|
|
3064
|
-
|
|
3065
|
-
add_tests("while_post2",
|
|
3066
|
-
"Ruby" => "begin\n (1 + 2)\n (3 + 4)\nend while false",
|
|
3067
|
-
"ParseTree" => s(:while, s(:false),
|
|
3068
|
-
s(:block,
|
|
3069
|
-
s(:call, s(:lit, 1), :+, s(:lit, 2)),
|
|
3070
|
-
s(:call, s(:lit, 3), :+, s(:lit, 4))),
|
|
3071
|
-
false))
|
|
3072
|
-
|
|
3073
|
-
add_tests("while_pre",
|
|
3074
|
-
"Ruby" => "while false do\n (1 + 1)\nend",
|
|
3075
|
-
"ParseTree" => s(:while, s(:false),
|
|
3076
|
-
s(:call, s(:lit, 1), :+, s(:lit, 1)), true))
|
|
3077
|
-
|
|
3078
|
-
add_tests("while_pre_mod",
|
|
3079
|
-
"Ruby" => "(1 + 1) while false",
|
|
3080
|
-
"ParseTree" => s(:while, s(:false),
|
|
3081
|
-
s(:call, s(:lit, 1), :+, s(:lit, 1)), true),
|
|
3082
|
-
"Ruby2Ruby" => "while false do\n (1 + 1)\nend") # FIX can be one liner
|
|
3083
|
-
|
|
3084
|
-
add_tests("while_pre_nil",
|
|
3085
|
-
"Ruby" => "while false do\nend",
|
|
3086
|
-
"ParseTree" => s(:while, s(:false), nil, true))
|
|
3087
|
-
|
|
3088
|
-
add_tests("xstr",
|
|
3089
|
-
"Ruby" => "`touch 5`",
|
|
3090
|
-
"ParseTree" => s(:xstr, "touch 5"))
|
|
3091
|
-
|
|
3092
|
-
add_tests("yield_0",
|
|
3093
|
-
"Ruby" => "yield",
|
|
3094
|
-
"ParseTree" => s(:yield))
|
|
3095
|
-
|
|
3096
|
-
add_tests("yield_1",
|
|
3097
|
-
"Ruby" => "yield(42)",
|
|
3098
|
-
"ParseTree" => s(:yield, s(:lit, 42)))
|
|
3099
|
-
|
|
3100
|
-
add_tests("yield_array_0",
|
|
3101
|
-
"Ruby" => "yield([])",
|
|
3102
|
-
"ParseTree" => s(:yield, s(:array)))
|
|
3103
|
-
|
|
3104
|
-
add_tests("yield_array_1",
|
|
3105
|
-
"Ruby" => "yield([42])",
|
|
3106
|
-
"ParseTree" => s(:yield, s(:array, s(:lit, 42))))
|
|
3107
|
-
|
|
3108
|
-
add_tests("yield_array_n",
|
|
3109
|
-
"Ruby" => "yield([42, 24])",
|
|
3110
|
-
"ParseTree" => s(:yield, s(:array, s(:lit, 42), s(:lit, 24))))
|
|
3111
|
-
|
|
3112
|
-
add_tests("yield_n",
|
|
3113
|
-
"Ruby" => "yield(42, 24)",
|
|
3114
|
-
"ParseTree" => s(:yield, s(:lit, 42), s(:lit, 24)))
|
|
3115
|
-
|
|
3116
|
-
add_tests("zarray",
|
|
3117
|
-
"Ruby" => "a = []",
|
|
3118
|
-
"ParseTree" => s(:lasgn, :a, s(:array)))
|
|
3119
|
-
|
|
3120
|
-
add_tests("zsuper",
|
|
3121
|
-
"Ruby" => "def x\n super\nend",
|
|
3122
|
-
"ParseTree" => s(:defn, :x, s(:args), s(:zsuper)))
|
|
3123
|
-
|
|
3124
|
-
# TODO: discuss and decide which lit we like
|
|
3125
|
-
# it "converts a regexp to an sexp" do
|
|
3126
|
-
# "/blah/".to_sexp.should == s(:regex, "blah", 0)
|
|
3127
|
-
# "/blah/i".to_sexp.should == s(:regex, "blah", 1)
|
|
3128
|
-
# "/blah/u".to_sexp.should == s(:regex, "blah", 64)
|
|
3129
|
-
# end
|
|
3130
|
-
|
|
3131
|
-
end
|
|
3132
|
-
|
|
3133
|
-
# :startdoc:
|