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,1865 +0,0 @@
|
|
|
1
|
-
# encoding: ASCII-8BIT
|
|
2
|
-
# frozen_string_literal: true
|
|
3
|
-
# TODO: remove encoding comment
|
|
4
|
-
|
|
5
|
-
require "sexp"
|
|
6
|
-
require "ruby_lexer"
|
|
7
|
-
require "timeout"
|
|
8
|
-
require "rp_extensions"
|
|
9
|
-
require "rp_stringscanner"
|
|
10
|
-
|
|
11
|
-
class Sexp
|
|
12
|
-
def check_line_numbers
|
|
13
|
-
raise "bad nil line for:\n%s" % [self.pretty_inspect] if nil_line?
|
|
14
|
-
raise "bad line number for:\n%s" % [self.pretty_inspect] unless
|
|
15
|
-
Integer === self.line &&
|
|
16
|
-
self.line >= 1 &&
|
|
17
|
-
self.line <= self.line_min
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
##
|
|
21
|
-
# Returns the maximum line number of the children of self.
|
|
22
|
-
|
|
23
|
-
def line_min
|
|
24
|
-
@line_min ||= [self.deep_each.map(&:line).min, self.line].compact.min
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
def nil_line?
|
|
28
|
-
self.deep_each.map(&:line).any?(&:nil?)
|
|
29
|
-
end
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
module RubyParserStuff
|
|
33
|
-
VERSION = "3.19.1"
|
|
34
|
-
|
|
35
|
-
attr_accessor :lexer, :in_def, :in_single, :file
|
|
36
|
-
attr_accessor :in_kwarg
|
|
37
|
-
attr_reader :env, :comments
|
|
38
|
-
|
|
39
|
-
##
|
|
40
|
-
# Canonicalize conditionals. Eg:
|
|
41
|
-
#
|
|
42
|
-
# not x ? a : b
|
|
43
|
-
#
|
|
44
|
-
# becomes:
|
|
45
|
-
#
|
|
46
|
-
# x ? b : a
|
|
47
|
-
|
|
48
|
-
attr_accessor :canonicalize_conditions
|
|
49
|
-
|
|
50
|
-
##
|
|
51
|
-
# The last token type returned from #next_token
|
|
52
|
-
|
|
53
|
-
attr_accessor :last_token_type
|
|
54
|
-
|
|
55
|
-
$good20 = []
|
|
56
|
-
|
|
57
|
-
%w[
|
|
58
|
-
].map(&:to_i).each do |n|
|
|
59
|
-
$good20[n] = n
|
|
60
|
-
end
|
|
61
|
-
|
|
62
|
-
def debug20 n, v = nil, r = nil
|
|
63
|
-
raise "not yet #{n} #{v.inspect} => #{r.inspect}" unless $good20[n]
|
|
64
|
-
end
|
|
65
|
-
|
|
66
|
-
def self.deprecate old, new
|
|
67
|
-
define_method old do |*args|
|
|
68
|
-
warn "DEPRECATED: #{old} -> #{new} from #{caller.first}"
|
|
69
|
-
send new, *args
|
|
70
|
-
end
|
|
71
|
-
end
|
|
72
|
-
|
|
73
|
-
##
|
|
74
|
-
# for pure ruby systems only
|
|
75
|
-
|
|
76
|
-
def do_parse
|
|
77
|
-
_racc_do_parse_rb(_racc_setup, false)
|
|
78
|
-
end if ENV["PURE_RUBY"] || ENV["CHECK_LINE_NUMS"]
|
|
79
|
-
|
|
80
|
-
if ENV["CHECK_LINE_NUMS"] then
|
|
81
|
-
def _racc_do_reduce arg, act
|
|
82
|
-
x = super
|
|
83
|
-
|
|
84
|
-
@racc_vstack.grep(Sexp).each do |sexp|
|
|
85
|
-
sexp.check_line_numbers
|
|
86
|
-
end
|
|
87
|
-
x
|
|
88
|
-
end
|
|
89
|
-
end
|
|
90
|
-
|
|
91
|
-
ARG_TYPES = [:arglist, :call_args, :array, :args].map { |k|
|
|
92
|
-
[k, true]
|
|
93
|
-
}.to_h
|
|
94
|
-
|
|
95
|
-
has_enc = "".respond_to? :encoding
|
|
96
|
-
|
|
97
|
-
# This is in sorted order of occurrence according to
|
|
98
|
-
# charlock_holmes against 500k files, with UTF_8 forced
|
|
99
|
-
# to the top.
|
|
100
|
-
#
|
|
101
|
-
# Overwrite this contstant if you need something different.
|
|
102
|
-
ENCODING_ORDER = [
|
|
103
|
-
Encoding::UTF_8, # moved to top to reflect default in 2.0
|
|
104
|
-
Encoding::ISO_8859_1,
|
|
105
|
-
Encoding::ISO_8859_2,
|
|
106
|
-
Encoding::ISO_8859_9,
|
|
107
|
-
Encoding::SHIFT_JIS,
|
|
108
|
-
Encoding::WINDOWS_1252,
|
|
109
|
-
Encoding::EUC_JP
|
|
110
|
-
] if has_enc
|
|
111
|
-
|
|
112
|
-
JUMP_TYPE = [:return, :next, :break, :yield].map { |k| [k, true] }.to_h
|
|
113
|
-
|
|
114
|
-
TAB_WIDTH = 8
|
|
115
|
-
|
|
116
|
-
def initialize(options = {})
|
|
117
|
-
super()
|
|
118
|
-
|
|
119
|
-
v = self.class.name[/[23]\d/]
|
|
120
|
-
raise "Bad Class name #{self.class}" unless v
|
|
121
|
-
|
|
122
|
-
self.lexer = RubyLexer.new v && v.to_i
|
|
123
|
-
self.lexer.parser = self
|
|
124
|
-
self.in_kwarg = false
|
|
125
|
-
|
|
126
|
-
@env = RubyParserStuff::Environment.new
|
|
127
|
-
@comments = []
|
|
128
|
-
|
|
129
|
-
@canonicalize_conditions = true
|
|
130
|
-
|
|
131
|
-
self.reset
|
|
132
|
-
end
|
|
133
|
-
|
|
134
|
-
def arg_concat node1, node2 # TODO: nuke
|
|
135
|
-
raise "huh" unless node2
|
|
136
|
-
|
|
137
|
-
splat = s(:splat, node2)
|
|
138
|
-
splat.line node2.line
|
|
139
|
-
|
|
140
|
-
node1 << splat
|
|
141
|
-
end
|
|
142
|
-
|
|
143
|
-
def argl x
|
|
144
|
-
x = s(:arglist, x) if x and x.sexp_type == :array
|
|
145
|
-
x
|
|
146
|
-
end
|
|
147
|
-
|
|
148
|
-
def args args
|
|
149
|
-
result = s(:args)
|
|
150
|
-
|
|
151
|
-
ss = args.grep Sexp
|
|
152
|
-
if ss.empty? then
|
|
153
|
-
result.line lexer.lineno
|
|
154
|
-
else
|
|
155
|
-
result.line ss.first.line
|
|
156
|
-
end
|
|
157
|
-
|
|
158
|
-
args.each do |arg|
|
|
159
|
-
if arg.instance_of? Array and arg.size == 2 and arg.last.is_a? Numeric then
|
|
160
|
-
arg = arg.first
|
|
161
|
-
end
|
|
162
|
-
|
|
163
|
-
case arg
|
|
164
|
-
when Sexp then
|
|
165
|
-
case arg.sexp_type
|
|
166
|
-
when :args, :block, :array, :call_args then # HACK call_args mismatch
|
|
167
|
-
rest = arg.sexp_body
|
|
168
|
-
|
|
169
|
-
rest.map! { |x|
|
|
170
|
-
if x.instance_of? Array and x.size == 2 and Numeric === x.last then
|
|
171
|
-
x.first
|
|
172
|
-
else
|
|
173
|
-
x
|
|
174
|
-
end
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
result.concat rest
|
|
178
|
-
when :forward_args then
|
|
179
|
-
self.env[:*] = :lvar # TODO: arg_var(p, idFWD_REST) ?
|
|
180
|
-
self.env[:**] = :lvar
|
|
181
|
-
self.env[:&] = :lvar
|
|
182
|
-
|
|
183
|
-
result << arg
|
|
184
|
-
when :block_arg then
|
|
185
|
-
result << :"&#{arg.last}"
|
|
186
|
-
when :shadow then
|
|
187
|
-
name = arg.last
|
|
188
|
-
self.env[name] = :lvar
|
|
189
|
-
if Sexp === result.last and result.last.sexp_type == :shadow then
|
|
190
|
-
result.last << name
|
|
191
|
-
else
|
|
192
|
-
result << arg
|
|
193
|
-
end
|
|
194
|
-
when :masgn, :block_pass, :hash then # HACK: remove. prolly call_args
|
|
195
|
-
result << arg
|
|
196
|
-
else
|
|
197
|
-
raise "unhandled: #{arg.sexp_type} in #{args.inspect}"
|
|
198
|
-
end
|
|
199
|
-
when Symbol then
|
|
200
|
-
name = arg.to_s.delete("&*")
|
|
201
|
-
self.env[name.to_sym] = :lvar unless name.empty?
|
|
202
|
-
result << arg
|
|
203
|
-
when true, false then
|
|
204
|
-
self.in_kwarg = arg
|
|
205
|
-
when ",", "|", ";", "(", ")", nil then
|
|
206
|
-
# ignore
|
|
207
|
-
else
|
|
208
|
-
raise "unhandled: #{arg.inspect} in #{args.inspect}"
|
|
209
|
-
end
|
|
210
|
-
end
|
|
211
|
-
|
|
212
|
-
result
|
|
213
|
-
end
|
|
214
|
-
|
|
215
|
-
def end_args args
|
|
216
|
-
lexer.lex_state = RubyLexer::State::Values::EXPR_BEG
|
|
217
|
-
lexer.command_start = true
|
|
218
|
-
self.args args
|
|
219
|
-
end
|
|
220
|
-
|
|
221
|
-
def attrset_id? id
|
|
222
|
-
id =~ /^\[\]=$|^\w+=$/
|
|
223
|
-
end
|
|
224
|
-
|
|
225
|
-
def endless_method_name defn_or_defs
|
|
226
|
-
name = defn_or_defs[1]
|
|
227
|
-
name = defn_or_defs[2] unless Symbol === name
|
|
228
|
-
|
|
229
|
-
if attrset_id? name then
|
|
230
|
-
yyerror "setter method cannot be defined in an endless method definition"
|
|
231
|
-
end
|
|
232
|
-
|
|
233
|
-
# TODO? token_info_drop(p, "def", loc->beg_pos);
|
|
234
|
-
end
|
|
235
|
-
|
|
236
|
-
def array_to_hash array
|
|
237
|
-
case array.sexp_type
|
|
238
|
-
when :kwsplat then
|
|
239
|
-
array
|
|
240
|
-
else
|
|
241
|
-
s(:hash, *array.sexp_body).line array.line
|
|
242
|
-
end
|
|
243
|
-
end
|
|
244
|
-
|
|
245
|
-
def aryset receiver, index
|
|
246
|
-
index ||= s()
|
|
247
|
-
l = receiver.line
|
|
248
|
-
result = s(:attrasgn, receiver, :"[]=",
|
|
249
|
-
*index.sexp_body).compact # [].sexp_body => nil
|
|
250
|
-
result.line = l
|
|
251
|
-
result
|
|
252
|
-
end
|
|
253
|
-
|
|
254
|
-
def assignable(lhs, value = nil)
|
|
255
|
-
id, line = lhs
|
|
256
|
-
id = id.to_sym
|
|
257
|
-
|
|
258
|
-
result = case id
|
|
259
|
-
when /^@@/ then
|
|
260
|
-
asgn = in_def || in_single > 0
|
|
261
|
-
s((asgn ? :cvasgn : :cvdecl), id)
|
|
262
|
-
when /^@/ then
|
|
263
|
-
s(:iasgn, id)
|
|
264
|
-
when /^\$/ then
|
|
265
|
-
s(:gasgn, id)
|
|
266
|
-
when /^[A-Z]/ then
|
|
267
|
-
s(:cdecl, id)
|
|
268
|
-
else
|
|
269
|
-
case self.env[id]
|
|
270
|
-
when :lvar, :dvar, nil then
|
|
271
|
-
s(:lasgn, id)
|
|
272
|
-
else
|
|
273
|
-
raise "wtf? unknown type: #{self.env[id]}"
|
|
274
|
-
end
|
|
275
|
-
end
|
|
276
|
-
|
|
277
|
-
self.env[id] ||= :lvar if result.sexp_type == :lasgn
|
|
278
|
-
|
|
279
|
-
result << value if value
|
|
280
|
-
result.line line
|
|
281
|
-
result
|
|
282
|
-
end
|
|
283
|
-
|
|
284
|
-
def backref_assign_error ref
|
|
285
|
-
# TODO: need a test for this... obviously
|
|
286
|
-
case ref.sexp_type
|
|
287
|
-
when :nth_ref then
|
|
288
|
-
raise "write a test 2"
|
|
289
|
-
raise SyntaxError, "Can't set variable %p" % ref.last
|
|
290
|
-
when :back_ref then
|
|
291
|
-
raise "write a test 3"
|
|
292
|
-
raise SyntaxError, "Can't set back reference %p" % ref.last
|
|
293
|
-
else
|
|
294
|
-
raise "Unknown backref type: #{ref.inspect}"
|
|
295
|
-
end
|
|
296
|
-
end
|
|
297
|
-
|
|
298
|
-
def block_append(head, tail)
|
|
299
|
-
return head if tail.nil?
|
|
300
|
-
return tail if head.nil?
|
|
301
|
-
|
|
302
|
-
line = [head.line, tail.line].compact.min
|
|
303
|
-
|
|
304
|
-
head = remove_begin(head)
|
|
305
|
-
head = s(:block, head).line(line) unless head.sexp_type == :block
|
|
306
|
-
|
|
307
|
-
# head.line = line
|
|
308
|
-
head << tail
|
|
309
|
-
end
|
|
310
|
-
|
|
311
|
-
def block_dup_check call_or_args, block
|
|
312
|
-
syntax_error "Both block arg and actual block given." if
|
|
313
|
-
block and call_or_args.block_pass?
|
|
314
|
-
end
|
|
315
|
-
|
|
316
|
-
def block_var *args
|
|
317
|
-
result = self.args args
|
|
318
|
-
result.sexp_type = :masgn
|
|
319
|
-
result
|
|
320
|
-
end
|
|
321
|
-
|
|
322
|
-
def call_args args
|
|
323
|
-
result = s(:call_args)
|
|
324
|
-
|
|
325
|
-
a = args.grep(Sexp).first
|
|
326
|
-
if a then
|
|
327
|
-
result.line a.line
|
|
328
|
-
else
|
|
329
|
-
result.line lexer.lineno
|
|
330
|
-
end
|
|
331
|
-
|
|
332
|
-
args.each do |arg|
|
|
333
|
-
if arg.instance_of? Array and arg.size == 2 and arg.last.is_a? Numeric then
|
|
334
|
-
arg = arg.first
|
|
335
|
-
end
|
|
336
|
-
|
|
337
|
-
case arg
|
|
338
|
-
when Sexp then
|
|
339
|
-
case arg.sexp_type
|
|
340
|
-
when :array, :args, :call_args then # HACK? remove array at some point
|
|
341
|
-
result.concat arg.sexp_body
|
|
342
|
-
else
|
|
343
|
-
result << arg
|
|
344
|
-
end
|
|
345
|
-
when Symbol then
|
|
346
|
-
result << arg
|
|
347
|
-
when Array then
|
|
348
|
-
id, _line = arg
|
|
349
|
-
result << id
|
|
350
|
-
when ",", nil, "(" then
|
|
351
|
-
# ignore
|
|
352
|
-
else
|
|
353
|
-
raise "unhandled: #{arg.inspect} in #{args.inspect}"
|
|
354
|
-
end
|
|
355
|
-
end
|
|
356
|
-
|
|
357
|
-
result
|
|
358
|
-
end
|
|
359
|
-
|
|
360
|
-
def clean_mlhs sexp
|
|
361
|
-
case sexp.sexp_type
|
|
362
|
-
when :masgn then
|
|
363
|
-
if sexp.size == 2 and sexp[1].sexp_type == :array then
|
|
364
|
-
s(:masgn, *sexp[1].sexp_body.map { |sub| clean_mlhs sub })
|
|
365
|
-
else
|
|
366
|
-
debug20 5
|
|
367
|
-
sexp
|
|
368
|
-
end
|
|
369
|
-
when :gasgn, :iasgn, :lasgn, :cvasgn then
|
|
370
|
-
if sexp.size == 2 then
|
|
371
|
-
sexp.last
|
|
372
|
-
else
|
|
373
|
-
debug20 7
|
|
374
|
-
sexp # optional value
|
|
375
|
-
end
|
|
376
|
-
else
|
|
377
|
-
raise "unsupported type: #{sexp.inspect}"
|
|
378
|
-
end
|
|
379
|
-
end
|
|
380
|
-
|
|
381
|
-
def cond node
|
|
382
|
-
return nil if node.nil?
|
|
383
|
-
node = value_expr node
|
|
384
|
-
|
|
385
|
-
case node.sexp_type
|
|
386
|
-
when :lit then
|
|
387
|
-
if Regexp === node.last then
|
|
388
|
-
s(:match, node)
|
|
389
|
-
else
|
|
390
|
-
node
|
|
391
|
-
end
|
|
392
|
-
when :and then
|
|
393
|
-
_, lhs, rhs = node
|
|
394
|
-
s(:and, cond(lhs), cond(rhs))
|
|
395
|
-
when :or then
|
|
396
|
-
_, lhs, rhs = node
|
|
397
|
-
s(:or, cond(lhs), cond(rhs))
|
|
398
|
-
when :dot2 then
|
|
399
|
-
label = "flip#{node.hash}"
|
|
400
|
-
env[label] = :lvar
|
|
401
|
-
_, lhs, rhs = node
|
|
402
|
-
s(:flip2, lhs, rhs) # TODO: recurse?
|
|
403
|
-
when :dot3 then
|
|
404
|
-
label = "flip#{node.hash}"
|
|
405
|
-
env[label] = :lvar
|
|
406
|
-
_, lhs, rhs = node
|
|
407
|
-
s(:flip3, lhs, rhs)
|
|
408
|
-
else
|
|
409
|
-
node
|
|
410
|
-
end.line node.line
|
|
411
|
-
end
|
|
412
|
-
|
|
413
|
-
def dedent sexp
|
|
414
|
-
dedent_count = dedent_size sexp
|
|
415
|
-
|
|
416
|
-
skip_one = false
|
|
417
|
-
sexp.map { |obj|
|
|
418
|
-
case obj
|
|
419
|
-
when Symbol then
|
|
420
|
-
obj
|
|
421
|
-
when String then
|
|
422
|
-
obj.lines.map { |l| remove_whitespace_width l, dedent_count }.join
|
|
423
|
-
when Sexp then
|
|
424
|
-
case obj.sexp_type
|
|
425
|
-
when :evstr then
|
|
426
|
-
skip_one = true
|
|
427
|
-
obj
|
|
428
|
-
when :str then
|
|
429
|
-
_, str = obj
|
|
430
|
-
str = if skip_one then
|
|
431
|
-
skip_one = false
|
|
432
|
-
s1, *rest = str.lines
|
|
433
|
-
s1 + rest.map { |l| remove_whitespace_width l, dedent_count }.join
|
|
434
|
-
else
|
|
435
|
-
str.lines.map { |l| remove_whitespace_width l, dedent_count }.join
|
|
436
|
-
end
|
|
437
|
-
|
|
438
|
-
s(:str, str).line obj.line
|
|
439
|
-
else
|
|
440
|
-
warn "unprocessed sexp %p" % [obj]
|
|
441
|
-
end
|
|
442
|
-
else
|
|
443
|
-
warn "unprocessed: %p" % [obj]
|
|
444
|
-
end
|
|
445
|
-
}
|
|
446
|
-
end
|
|
447
|
-
|
|
448
|
-
def dedent_size sexp
|
|
449
|
-
skip_one = false
|
|
450
|
-
sexp.flat_map { |s|
|
|
451
|
-
case s
|
|
452
|
-
when Symbol then
|
|
453
|
-
next
|
|
454
|
-
when String then
|
|
455
|
-
s.lines
|
|
456
|
-
when Sexp then
|
|
457
|
-
case s.sexp_type
|
|
458
|
-
when :evstr then
|
|
459
|
-
skip_one = true
|
|
460
|
-
next
|
|
461
|
-
when :str then
|
|
462
|
-
_, str = s
|
|
463
|
-
lines = str.lines
|
|
464
|
-
if skip_one then
|
|
465
|
-
skip_one = false
|
|
466
|
-
lines.shift
|
|
467
|
-
end
|
|
468
|
-
lines
|
|
469
|
-
else
|
|
470
|
-
warn "unprocessed sexp %p" % [s]
|
|
471
|
-
end
|
|
472
|
-
else
|
|
473
|
-
warn "unprocessed: %p" % [s]
|
|
474
|
-
end.map { |l| whitespace_width l.chomp }
|
|
475
|
-
}.compact.min
|
|
476
|
-
end
|
|
477
|
-
|
|
478
|
-
def dedent_string string, width
|
|
479
|
-
characters_skipped = 0
|
|
480
|
-
indentation_skipped = 0
|
|
481
|
-
|
|
482
|
-
string.chars.each do |char|
|
|
483
|
-
break if indentation_skipped >= width
|
|
484
|
-
if char == " "
|
|
485
|
-
characters_skipped += 1
|
|
486
|
-
indentation_skipped += 1
|
|
487
|
-
elsif char == "\t"
|
|
488
|
-
proposed = TAB_WIDTH * (indentation_skipped / TAB_WIDTH + 1)
|
|
489
|
-
break if proposed > width
|
|
490
|
-
characters_skipped += 1
|
|
491
|
-
indentation_skipped = proposed
|
|
492
|
-
end
|
|
493
|
-
end
|
|
494
|
-
string[characters_skipped..-1]
|
|
495
|
-
end
|
|
496
|
-
|
|
497
|
-
def gettable(id)
|
|
498
|
-
id = id.to_sym if String === id
|
|
499
|
-
|
|
500
|
-
result = case id.to_s
|
|
501
|
-
when /^@@/ then
|
|
502
|
-
s(:cvar, id)
|
|
503
|
-
when /^@/ then
|
|
504
|
-
s(:ivar, id)
|
|
505
|
-
when /^\$/ then
|
|
506
|
-
s(:gvar, id)
|
|
507
|
-
when /^[A-Z]/ then
|
|
508
|
-
s(:const, id)
|
|
509
|
-
else
|
|
510
|
-
type = env[id]
|
|
511
|
-
if type then
|
|
512
|
-
s(type, id)
|
|
513
|
-
else
|
|
514
|
-
new_call(nil, id)
|
|
515
|
-
end
|
|
516
|
-
end
|
|
517
|
-
|
|
518
|
-
raise "identifier #{id.inspect} is not valid" unless result
|
|
519
|
-
|
|
520
|
-
result
|
|
521
|
-
end
|
|
522
|
-
|
|
523
|
-
def hack_encoding str, extra = nil
|
|
524
|
-
encodings = ENCODING_ORDER.dup
|
|
525
|
-
encodings.unshift(extra) unless extra.nil?
|
|
526
|
-
|
|
527
|
-
# terrible, horrible, no good, very bad, last ditch effort.
|
|
528
|
-
encodings.each do |enc|
|
|
529
|
-
begin
|
|
530
|
-
str.force_encoding enc
|
|
531
|
-
if str.valid_encoding? then
|
|
532
|
-
str.encode! Encoding::UTF_8
|
|
533
|
-
break
|
|
534
|
-
end
|
|
535
|
-
rescue ArgumentError # unknown encoding name
|
|
536
|
-
# do nothing
|
|
537
|
-
rescue Encoding::InvalidByteSequenceError
|
|
538
|
-
# do nothing
|
|
539
|
-
rescue Encoding::UndefinedConversionError
|
|
540
|
-
# do nothing
|
|
541
|
-
end
|
|
542
|
-
end
|
|
543
|
-
|
|
544
|
-
# no amount of pain is enough for you.
|
|
545
|
-
raise "Bad encoding. Need a magic encoding comment." unless
|
|
546
|
-
str.encoding.name == "UTF-8"
|
|
547
|
-
end
|
|
548
|
-
|
|
549
|
-
##
|
|
550
|
-
# Returns a UTF-8 encoded string after processing BOMs and magic
|
|
551
|
-
# encoding comments.
|
|
552
|
-
#
|
|
553
|
-
# Holy crap... ok. Here goes:
|
|
554
|
-
#
|
|
555
|
-
# Ruby's file handling and encoding support is insane. We need to be
|
|
556
|
-
# able to lex a file. The lexer file is explicitly UTF-8 to make
|
|
557
|
-
# things cleaner. This allows us to deal with extended chars in
|
|
558
|
-
# class and method names. In order to do this, we need to encode all
|
|
559
|
-
# input source files as UTF-8. First, we look for a UTF-8 BOM by
|
|
560
|
-
# looking at the first line while forcing its encoding to
|
|
561
|
-
# ASCII-8BIT. If we find a BOM, we strip it and set the expected
|
|
562
|
-
# encoding to UTF-8. Then, we search for a magic encoding comment.
|
|
563
|
-
# If found, it overrides the BOM. Finally, we force the encoding of
|
|
564
|
-
# the input string to whatever was found, and then encode that to
|
|
565
|
-
# UTF-8 for compatibility with the lexer.
|
|
566
|
-
|
|
567
|
-
def handle_encoding str
|
|
568
|
-
str = str.dup
|
|
569
|
-
has_enc = str.respond_to? :encoding
|
|
570
|
-
encoding = nil
|
|
571
|
-
|
|
572
|
-
header = str.each_line.first(2)
|
|
573
|
-
header.map! { |s| s.force_encoding "ASCII-8BIT" } if has_enc
|
|
574
|
-
|
|
575
|
-
first = header.first || ""
|
|
576
|
-
encoding, str = +"utf-8", str.b[3..-1] if first =~ /\A\xEF\xBB\xBF/
|
|
577
|
-
|
|
578
|
-
encoding = $1.strip if header.find { |s|
|
|
579
|
-
s[/^#.*?-\*-.*?coding:\s*([^ ;]+).*?-\*-/, 1] ||
|
|
580
|
-
s[/^#.*(?:en)?coding(?:\s*[:=])\s*([\w-]+)/, 1]
|
|
581
|
-
}
|
|
582
|
-
|
|
583
|
-
if encoding then
|
|
584
|
-
if has_enc then
|
|
585
|
-
encoding.sub!(/utf-8-.+$/, "utf-8") # HACK for stupid emacs formats
|
|
586
|
-
hack_encoding str, encoding
|
|
587
|
-
else
|
|
588
|
-
warn "Skipping magic encoding comment"
|
|
589
|
-
end
|
|
590
|
-
else
|
|
591
|
-
# nothing specified... ugh. try to encode as utf-8
|
|
592
|
-
hack_encoding str if has_enc
|
|
593
|
-
end
|
|
594
|
-
|
|
595
|
-
str
|
|
596
|
-
end
|
|
597
|
-
|
|
598
|
-
def invert_block_call val
|
|
599
|
-
ret, iter = val
|
|
600
|
-
type, call = ret
|
|
601
|
-
|
|
602
|
-
iter.insert 1, call
|
|
603
|
-
|
|
604
|
-
ret = s(type).line ret.line
|
|
605
|
-
|
|
606
|
-
[iter, ret]
|
|
607
|
-
end
|
|
608
|
-
|
|
609
|
-
def inverted? val
|
|
610
|
-
JUMP_TYPE[val[0].sexp_type]
|
|
611
|
-
end
|
|
612
|
-
|
|
613
|
-
def list_append list, item # TODO: nuke me *sigh*
|
|
614
|
-
return s(:array, item) unless list
|
|
615
|
-
list = s(:array, list) unless Sexp === list && list.sexp_type == :array
|
|
616
|
-
list << item
|
|
617
|
-
end
|
|
618
|
-
|
|
619
|
-
def list_prepend item, list # TODO: nuke me *sigh*
|
|
620
|
-
list = s(:array, list) unless Sexp === list && list.sexp_type == :array
|
|
621
|
-
list.insert 1, item
|
|
622
|
-
list
|
|
623
|
-
end
|
|
624
|
-
|
|
625
|
-
def literal_concat head, tail # TODO: ugh. rewrite
|
|
626
|
-
return tail unless head
|
|
627
|
-
return head unless tail
|
|
628
|
-
|
|
629
|
-
htype, ttype = head.sexp_type, tail.sexp_type
|
|
630
|
-
|
|
631
|
-
head = s(:dstr, "", head).line head.line if htype == :evstr
|
|
632
|
-
|
|
633
|
-
case ttype
|
|
634
|
-
when :str then
|
|
635
|
-
if htype == :str
|
|
636
|
-
a, b = head.last, tail.last
|
|
637
|
-
b = b.dup.force_encoding a.encoding unless Encoding.compatible?(a, b)
|
|
638
|
-
a << b
|
|
639
|
-
elsif htype == :dstr and head.size == 2 then
|
|
640
|
-
head.last << tail.last
|
|
641
|
-
else
|
|
642
|
-
head << tail
|
|
643
|
-
end
|
|
644
|
-
when :dstr then
|
|
645
|
-
if htype == :str then
|
|
646
|
-
lineno = head.line
|
|
647
|
-
tail[1] = head.last + tail[1]
|
|
648
|
-
head = tail
|
|
649
|
-
head.line = lineno
|
|
650
|
-
else
|
|
651
|
-
tail.sexp_type = :array
|
|
652
|
-
tail[1] = s(:str, tail[1]).line tail.line
|
|
653
|
-
tail.delete_at 1 if tail[1] == s(:str, "")
|
|
654
|
-
|
|
655
|
-
head.push(*tail.sexp_body)
|
|
656
|
-
end
|
|
657
|
-
when :evstr then
|
|
658
|
-
if htype == :str then
|
|
659
|
-
f, l = head.file, head.line
|
|
660
|
-
head = s(:dstr, *head.sexp_body)
|
|
661
|
-
head.file = f
|
|
662
|
-
head.line = l
|
|
663
|
-
end
|
|
664
|
-
|
|
665
|
-
if head.size == 2 and tail.size > 1 and tail[1].sexp_type == :str then
|
|
666
|
-
head.last << tail[1].last
|
|
667
|
-
head.sexp_type = :str if head.size == 2 # HACK ?
|
|
668
|
-
else
|
|
669
|
-
head.push(tail)
|
|
670
|
-
end
|
|
671
|
-
else
|
|
672
|
-
x = [head, tail]
|
|
673
|
-
raise "unknown type: #{x.inspect}"
|
|
674
|
-
end
|
|
675
|
-
|
|
676
|
-
return head
|
|
677
|
-
end
|
|
678
|
-
|
|
679
|
-
def local_pop in_def
|
|
680
|
-
lexer.cond.pop # group = local_pop
|
|
681
|
-
lexer.cmdarg.pop
|
|
682
|
-
self.env.unextend
|
|
683
|
-
self.in_def = in_def
|
|
684
|
-
end
|
|
685
|
-
|
|
686
|
-
def logical_op type, left, right
|
|
687
|
-
left = value_expr left
|
|
688
|
-
|
|
689
|
-
if left and left.sexp_type == type and not left.paren then
|
|
690
|
-
node, rhs = left, nil
|
|
691
|
-
|
|
692
|
-
loop do
|
|
693
|
-
_, _lhs, rhs = node
|
|
694
|
-
break unless rhs && rhs.sexp_type == type and not rhs.paren
|
|
695
|
-
node = rhs
|
|
696
|
-
end
|
|
697
|
-
|
|
698
|
-
node.pop
|
|
699
|
-
node << s(type, rhs, right).line(rhs.line)
|
|
700
|
-
|
|
701
|
-
return left
|
|
702
|
-
end
|
|
703
|
-
|
|
704
|
-
result = s(type, left, right)
|
|
705
|
-
result.line left.line if left.line
|
|
706
|
-
result
|
|
707
|
-
end
|
|
708
|
-
|
|
709
|
-
def new_aref val
|
|
710
|
-
val[2] ||= s(:arglist)
|
|
711
|
-
val[2].sexp_type = :arglist if val[2].sexp_type == :array # REFACTOR
|
|
712
|
-
new_call val[0], :"[]", val[2]
|
|
713
|
-
end
|
|
714
|
-
|
|
715
|
-
def new_arg val
|
|
716
|
-
arg, = val
|
|
717
|
-
|
|
718
|
-
case arg
|
|
719
|
-
when Symbol then
|
|
720
|
-
result = s(:args, arg).line line
|
|
721
|
-
when Sexp then
|
|
722
|
-
result = arg
|
|
723
|
-
when Array then
|
|
724
|
-
(arg, line), = val
|
|
725
|
-
result = s(:args, arg).line line
|
|
726
|
-
else
|
|
727
|
-
debug20 32
|
|
728
|
-
raise "Unknown f_arg type: #{val.inspect}"
|
|
729
|
-
end
|
|
730
|
-
|
|
731
|
-
result
|
|
732
|
-
end
|
|
733
|
-
|
|
734
|
-
def new_array_pattern const, pre_arg, arypat, loc
|
|
735
|
-
result = s(:array_pat, const).line loc
|
|
736
|
-
result << pre_arg if pre_arg
|
|
737
|
-
|
|
738
|
-
if arypat && arypat.sexp_type == :array_TAIL then
|
|
739
|
-
result.concat arypat.sexp_body
|
|
740
|
-
else
|
|
741
|
-
raise "NO?: %p" % [arypat]
|
|
742
|
-
end
|
|
743
|
-
|
|
744
|
-
result
|
|
745
|
-
end
|
|
746
|
-
|
|
747
|
-
def array_pat_concat lhs, rhs
|
|
748
|
-
case lhs.sexp_type
|
|
749
|
-
when :PATTERN then
|
|
750
|
-
lhs.sexp_type = :array_pat
|
|
751
|
-
end
|
|
752
|
-
|
|
753
|
-
if rhs then
|
|
754
|
-
case rhs.sexp_type
|
|
755
|
-
when :array_pat, :array_TAIL, :PATTERN then
|
|
756
|
-
lhs.concat rhs.sexp_body
|
|
757
|
-
else
|
|
758
|
-
lhs << rhs
|
|
759
|
-
end
|
|
760
|
-
end
|
|
761
|
-
end
|
|
762
|
-
|
|
763
|
-
def new_array_pattern_tail pre_args, has_rest, rest_arg, post_args
|
|
764
|
-
# TODO: remove has_rest once all tests pass !!!
|
|
765
|
-
rest_arg = if has_rest then
|
|
766
|
-
:"*#{rest_arg}"
|
|
767
|
-
else
|
|
768
|
-
nil
|
|
769
|
-
end
|
|
770
|
-
|
|
771
|
-
result = s(:array_TAIL).line 666
|
|
772
|
-
|
|
773
|
-
array_pat_concat result, pre_args
|
|
774
|
-
|
|
775
|
-
result << rest_arg if rest_arg
|
|
776
|
-
|
|
777
|
-
array_pat_concat result, post_args
|
|
778
|
-
|
|
779
|
-
result
|
|
780
|
-
end
|
|
781
|
-
|
|
782
|
-
def new_assign lhs, rhs
|
|
783
|
-
return nil unless lhs
|
|
784
|
-
|
|
785
|
-
rhs = value_expr rhs
|
|
786
|
-
|
|
787
|
-
case lhs.sexp_type
|
|
788
|
-
when :lasgn, :iasgn, :cdecl, :cvdecl, :gasgn, :cvasgn, :attrasgn, :safe_attrasgn then
|
|
789
|
-
lhs << rhs
|
|
790
|
-
when :const then
|
|
791
|
-
lhs.sexp_type = :cdecl
|
|
792
|
-
lhs << rhs
|
|
793
|
-
else
|
|
794
|
-
raise "unknown lhs #{lhs.inspect} w/ #{rhs.inspect}"
|
|
795
|
-
end
|
|
796
|
-
|
|
797
|
-
lhs
|
|
798
|
-
end
|
|
799
|
-
|
|
800
|
-
def new_attrasgn recv, meth, call_op = :"."
|
|
801
|
-
call_op = call_op.first if Array === call_op
|
|
802
|
-
|
|
803
|
-
meth = :"#{meth}="
|
|
804
|
-
|
|
805
|
-
result = case call_op.to_sym
|
|
806
|
-
when :"."
|
|
807
|
-
s(:attrasgn, recv, meth)
|
|
808
|
-
when :"&."
|
|
809
|
-
s(:safe_attrasgn, recv, meth)
|
|
810
|
-
else
|
|
811
|
-
raise "unknown call operator: `#{type.inspect}`"
|
|
812
|
-
end
|
|
813
|
-
|
|
814
|
-
result.line = recv.line
|
|
815
|
-
result
|
|
816
|
-
end
|
|
817
|
-
|
|
818
|
-
def new_begin val
|
|
819
|
-
_, lineno, body, _ = val
|
|
820
|
-
|
|
821
|
-
result = body ? s(:begin, body) : s(:nil)
|
|
822
|
-
result.line lineno
|
|
823
|
-
|
|
824
|
-
result
|
|
825
|
-
end
|
|
826
|
-
|
|
827
|
-
def new_body val
|
|
828
|
-
body, resbody, elsebody, ensurebody = val
|
|
829
|
-
|
|
830
|
-
result = body
|
|
831
|
-
|
|
832
|
-
if resbody then
|
|
833
|
-
result = s(:rescue)
|
|
834
|
-
result << body if body
|
|
835
|
-
|
|
836
|
-
res = resbody
|
|
837
|
-
|
|
838
|
-
while res do
|
|
839
|
-
result << res
|
|
840
|
-
res = res.resbody(true)
|
|
841
|
-
end
|
|
842
|
-
|
|
843
|
-
result << elsebody if elsebody
|
|
844
|
-
|
|
845
|
-
result.line = (body || resbody).line
|
|
846
|
-
end
|
|
847
|
-
|
|
848
|
-
if elsebody and not resbody then
|
|
849
|
-
warning("else without rescue is useless")
|
|
850
|
-
result = s(:begin, result).line result.line if result
|
|
851
|
-
result = block_append(result, elsebody)
|
|
852
|
-
end
|
|
853
|
-
|
|
854
|
-
if ensurebody
|
|
855
|
-
lineno = (result || ensurebody).line
|
|
856
|
-
result = s(:ensure, result, ensurebody).compact.line lineno
|
|
857
|
-
end
|
|
858
|
-
|
|
859
|
-
result
|
|
860
|
-
end
|
|
861
|
-
|
|
862
|
-
def new_brace_body args, body, lineno
|
|
863
|
-
new_iter(nil, args, body).line lineno
|
|
864
|
-
end
|
|
865
|
-
|
|
866
|
-
def new_call recv, meth, args = nil, call_op = :"."
|
|
867
|
-
call_op = call_op.first if Array === call_op
|
|
868
|
-
|
|
869
|
-
result = case call_op.to_sym
|
|
870
|
-
when :"."
|
|
871
|
-
s(:call, recv, meth)
|
|
872
|
-
when :"&."
|
|
873
|
-
s(:safe_call, recv, meth)
|
|
874
|
-
else
|
|
875
|
-
raise "unknown call operator: `#{type.inspect}`"
|
|
876
|
-
end
|
|
877
|
-
|
|
878
|
-
# TODO: need a test with f(&b) to produce block_pass
|
|
879
|
-
# TODO: need a test with f(&b) { } to produce warning
|
|
880
|
-
|
|
881
|
-
if args
|
|
882
|
-
if ARG_TYPES[args.sexp_type] then
|
|
883
|
-
result.concat args.sexp_body
|
|
884
|
-
else
|
|
885
|
-
result << args
|
|
886
|
-
end
|
|
887
|
-
end
|
|
888
|
-
|
|
889
|
-
# line = result.grep(Sexp).map(&:line).compact.min
|
|
890
|
-
result.line = recv.line if recv
|
|
891
|
-
result.line ||= lexer.lineno
|
|
892
|
-
|
|
893
|
-
result
|
|
894
|
-
end
|
|
895
|
-
|
|
896
|
-
def new_in pat, body, cases, line
|
|
897
|
-
s(:in, pat, body, cases).line line
|
|
898
|
-
end
|
|
899
|
-
|
|
900
|
-
def new_case expr, body, line
|
|
901
|
-
result = s(:case, expr)
|
|
902
|
-
|
|
903
|
-
while body and [:when, :in].include? body.sexp_type
|
|
904
|
-
result << body
|
|
905
|
-
body = body.delete_at 3
|
|
906
|
-
end
|
|
907
|
-
|
|
908
|
-
result[2..-1].each do |node|
|
|
909
|
-
block = node.block(:delete)
|
|
910
|
-
node.concat block.sexp_body if block
|
|
911
|
-
end
|
|
912
|
-
|
|
913
|
-
# else
|
|
914
|
-
body = nil if body == s(:block)
|
|
915
|
-
result << body
|
|
916
|
-
|
|
917
|
-
result.line = line
|
|
918
|
-
result
|
|
919
|
-
end
|
|
920
|
-
|
|
921
|
-
def new_class val
|
|
922
|
-
# TODO: get line from class keyword
|
|
923
|
-
line, path, superclass, body = val[1], val[2], val[3], val[5]
|
|
924
|
-
|
|
925
|
-
path = path.first if path.instance_of? Array
|
|
926
|
-
|
|
927
|
-
result = s(:class, path, superclass)
|
|
928
|
-
|
|
929
|
-
if body then
|
|
930
|
-
if body.sexp_type == :block then
|
|
931
|
-
result.push(*body.sexp_body)
|
|
932
|
-
else
|
|
933
|
-
result.push body
|
|
934
|
-
end
|
|
935
|
-
end
|
|
936
|
-
|
|
937
|
-
result.line = line
|
|
938
|
-
result.comments = self.comments.pop
|
|
939
|
-
result
|
|
940
|
-
end
|
|
941
|
-
|
|
942
|
-
def new_compstmt val
|
|
943
|
-
result = void_stmts(val.grep(Sexp)[0])
|
|
944
|
-
result = remove_begin(result) if result
|
|
945
|
-
result
|
|
946
|
-
end
|
|
947
|
-
|
|
948
|
-
def new_const_op_asgn val
|
|
949
|
-
lhs, (asgn_op, _), rhs = val
|
|
950
|
-
asgn_op = asgn_op.to_sym
|
|
951
|
-
|
|
952
|
-
result = case asgn_op
|
|
953
|
-
when :"||" then
|
|
954
|
-
s(:op_asgn_or, lhs, rhs)
|
|
955
|
-
when :"&&" then
|
|
956
|
-
s(:op_asgn_and, lhs, rhs)
|
|
957
|
-
else
|
|
958
|
-
s(:op_asgn, lhs, asgn_op, rhs)
|
|
959
|
-
end
|
|
960
|
-
|
|
961
|
-
result.line = lhs.line
|
|
962
|
-
result
|
|
963
|
-
end
|
|
964
|
-
|
|
965
|
-
def new_defn val
|
|
966
|
-
_, (name, line), in_def, args, body, _ = val
|
|
967
|
-
|
|
968
|
-
body ||= s(:nil).line line
|
|
969
|
-
|
|
970
|
-
args.line line
|
|
971
|
-
|
|
972
|
-
result = s(:defn, name.to_sym, args).line line
|
|
973
|
-
|
|
974
|
-
if body.sexp_type == :block then
|
|
975
|
-
result.push(*body.sexp_body)
|
|
976
|
-
else
|
|
977
|
-
result.push body
|
|
978
|
-
end
|
|
979
|
-
|
|
980
|
-
result.comments = self.comments.pop
|
|
981
|
-
|
|
982
|
-
[result, in_def]
|
|
983
|
-
end
|
|
984
|
-
|
|
985
|
-
def new_endless_defn val
|
|
986
|
-
(name, line, in_def), args, _, body, _, resbody = val
|
|
987
|
-
|
|
988
|
-
result =
|
|
989
|
-
if resbody then
|
|
990
|
-
s(:defn, name, args,
|
|
991
|
-
new_rescue(body,
|
|
992
|
-
new_resbody(s(:array).line(line),
|
|
993
|
-
resbody))).line line
|
|
994
|
-
else
|
|
995
|
-
s(:defn, name, args, body).line line
|
|
996
|
-
end
|
|
997
|
-
|
|
998
|
-
local_pop in_def
|
|
999
|
-
endless_method_name result
|
|
1000
|
-
|
|
1001
|
-
result.comments = self.comments.pop
|
|
1002
|
-
|
|
1003
|
-
result
|
|
1004
|
-
end
|
|
1005
|
-
|
|
1006
|
-
def new_endless_defs val
|
|
1007
|
-
(recv, (name, line, in_def)), args, _, body, _, resbody = val
|
|
1008
|
-
|
|
1009
|
-
result =
|
|
1010
|
-
if resbody then
|
|
1011
|
-
s(:defs, recv, name, args,
|
|
1012
|
-
new_rescue(body,
|
|
1013
|
-
new_resbody(s(:array).line(line),
|
|
1014
|
-
resbody))).line line
|
|
1015
|
-
else
|
|
1016
|
-
s(:defs, recv, name, args, body).line(line)
|
|
1017
|
-
end
|
|
1018
|
-
|
|
1019
|
-
self.in_single -= 1
|
|
1020
|
-
local_pop in_def
|
|
1021
|
-
endless_method_name result
|
|
1022
|
-
|
|
1023
|
-
result.comments = self.comments.pop
|
|
1024
|
-
|
|
1025
|
-
result
|
|
1026
|
-
end
|
|
1027
|
-
|
|
1028
|
-
def new_defs val
|
|
1029
|
-
_, recv, (name, line), in_def, args, body, _ = val
|
|
1030
|
-
|
|
1031
|
-
body ||= s(:nil).line line
|
|
1032
|
-
|
|
1033
|
-
args.line line
|
|
1034
|
-
|
|
1035
|
-
result = s(:defs, recv, name.to_sym, args).line line
|
|
1036
|
-
|
|
1037
|
-
# TODO: remove_begin
|
|
1038
|
-
# TODO: reduce_nodes
|
|
1039
|
-
|
|
1040
|
-
if body.sexp_type == :block then
|
|
1041
|
-
result.push(*body.sexp_body)
|
|
1042
|
-
else
|
|
1043
|
-
result.push body
|
|
1044
|
-
end
|
|
1045
|
-
|
|
1046
|
-
result.comments = self.comments.pop
|
|
1047
|
-
|
|
1048
|
-
[result, in_def]
|
|
1049
|
-
end
|
|
1050
|
-
|
|
1051
|
-
def new_do_body args, body, lineno
|
|
1052
|
-
new_iter(nil, args, body).line(lineno)
|
|
1053
|
-
end
|
|
1054
|
-
|
|
1055
|
-
def new_find_pattern const, pat
|
|
1056
|
-
pat.sexp_type = :find_pat
|
|
1057
|
-
pat.insert 1, const
|
|
1058
|
-
end
|
|
1059
|
-
|
|
1060
|
-
def new_find_pattern_tail lhs, mid, rhs
|
|
1061
|
-
lhs_id, line = lhs
|
|
1062
|
-
rhs_id, _line = rhs
|
|
1063
|
-
|
|
1064
|
-
# TODO: fpinfo->pre_rest_arg = pre_rest_arg ? assignable(p, pre_rest_arg, 0, loc) : NODE_SPECIAL_NO_NAME_REST;
|
|
1065
|
-
|
|
1066
|
-
lhs_id = "*#{lhs_id}".to_sym
|
|
1067
|
-
rhs_id = "*#{rhs_id}".to_sym
|
|
1068
|
-
|
|
1069
|
-
mid.sexp_type = :array_pat # HACK?
|
|
1070
|
-
|
|
1071
|
-
s(:find_pat_TAIL, lhs_id, mid, rhs_id).line line
|
|
1072
|
-
end
|
|
1073
|
-
|
|
1074
|
-
def new_for expr, var, body
|
|
1075
|
-
result = s(:for, expr, var).line(var.line)
|
|
1076
|
-
result << body if body
|
|
1077
|
-
result
|
|
1078
|
-
end
|
|
1079
|
-
|
|
1080
|
-
def new_hash val
|
|
1081
|
-
_, line, assocs = val
|
|
1082
|
-
|
|
1083
|
-
s(:hash).line(line).concat assocs.sexp_body
|
|
1084
|
-
end
|
|
1085
|
-
|
|
1086
|
-
def new_hash_pattern const, hash_pat, loc
|
|
1087
|
-
_, pat, kw_args, kw_rest_arg = hash_pat
|
|
1088
|
-
|
|
1089
|
-
line = (const||hash_pat).line
|
|
1090
|
-
|
|
1091
|
-
result = s(:hash_pat, const).line line
|
|
1092
|
-
result.concat pat.sexp_body if pat
|
|
1093
|
-
result << kw_args if kw_args
|
|
1094
|
-
result << kw_rest_arg if kw_rest_arg
|
|
1095
|
-
result
|
|
1096
|
-
end
|
|
1097
|
-
|
|
1098
|
-
def new_hash_pattern_tail kw_args, kw_rest_arg, line # TODO: remove line arg
|
|
1099
|
-
# kw_rest_arg = assignable(kw_rest_arg, nil).line line if kw_rest_arg
|
|
1100
|
-
|
|
1101
|
-
result = s(:hash_pat).line line
|
|
1102
|
-
result << kw_args
|
|
1103
|
-
|
|
1104
|
-
if kw_rest_arg then
|
|
1105
|
-
name = kw_rest_arg.value
|
|
1106
|
-
# TODO: I _hate_ this:
|
|
1107
|
-
assignable [name, kw_rest_arg.line] if name != :**
|
|
1108
|
-
result << kw_rest_arg
|
|
1109
|
-
end
|
|
1110
|
-
|
|
1111
|
-
result
|
|
1112
|
-
end
|
|
1113
|
-
|
|
1114
|
-
def push_pktbl
|
|
1115
|
-
end
|
|
1116
|
-
|
|
1117
|
-
def pop_pktbl
|
|
1118
|
-
end
|
|
1119
|
-
|
|
1120
|
-
def push_pvtbl
|
|
1121
|
-
end
|
|
1122
|
-
|
|
1123
|
-
def pop_pvtbl
|
|
1124
|
-
end
|
|
1125
|
-
|
|
1126
|
-
def new_if c, t, f
|
|
1127
|
-
l = [c.line, t && t.line, f && f.line].compact.min
|
|
1128
|
-
c = cond c
|
|
1129
|
-
c, t, f = c.last, f, t if c.sexp_type == :not and canonicalize_conditions
|
|
1130
|
-
s(:if, c, t, f).line(l)
|
|
1131
|
-
end
|
|
1132
|
-
|
|
1133
|
-
def new_iter call, args, body
|
|
1134
|
-
body ||= nil
|
|
1135
|
-
|
|
1136
|
-
args ||= s(:args)
|
|
1137
|
-
args = s(:args, args) if Symbol === args
|
|
1138
|
-
|
|
1139
|
-
result = s(:iter)
|
|
1140
|
-
result << call if call
|
|
1141
|
-
result << args
|
|
1142
|
-
result << body if body
|
|
1143
|
-
|
|
1144
|
-
result.line call.line if call
|
|
1145
|
-
|
|
1146
|
-
unless args == 0 then
|
|
1147
|
-
args.line call.line if call
|
|
1148
|
-
args.sexp_type = :args
|
|
1149
|
-
end
|
|
1150
|
-
|
|
1151
|
-
result
|
|
1152
|
-
end
|
|
1153
|
-
|
|
1154
|
-
def new_masgn lhs, rhs, wrap = false
|
|
1155
|
-
_, ary = lhs
|
|
1156
|
-
|
|
1157
|
-
line = rhs.line
|
|
1158
|
-
rhs = value_expr(rhs)
|
|
1159
|
-
rhs = ary ? s(:to_ary, rhs) : s(:array, rhs) if wrap
|
|
1160
|
-
rhs.line line if wrap
|
|
1161
|
-
|
|
1162
|
-
lhs.delete_at 1 if ary.nil?
|
|
1163
|
-
lhs << rhs
|
|
1164
|
-
|
|
1165
|
-
lhs
|
|
1166
|
-
end
|
|
1167
|
-
|
|
1168
|
-
def new_masgn_arg rhs, wrap = false
|
|
1169
|
-
rhs = value_expr(rhs)
|
|
1170
|
-
# HACK: could be array if lhs isn't right
|
|
1171
|
-
rhs = s(:to_ary, rhs).line rhs.line if wrap
|
|
1172
|
-
rhs
|
|
1173
|
-
end
|
|
1174
|
-
|
|
1175
|
-
def new_match lhs, rhs
|
|
1176
|
-
if lhs then
|
|
1177
|
-
case lhs.sexp_type
|
|
1178
|
-
when :dregx, :dregx_once then
|
|
1179
|
-
# TODO: no test coverage
|
|
1180
|
-
return s(:match2, lhs, rhs).line(lhs.line)
|
|
1181
|
-
when :lit then
|
|
1182
|
-
return s(:match2, lhs, rhs).line(lhs.line) if Regexp === lhs.last
|
|
1183
|
-
end
|
|
1184
|
-
end
|
|
1185
|
-
|
|
1186
|
-
if rhs then
|
|
1187
|
-
case rhs.sexp_type
|
|
1188
|
-
when :dregx, :dregx_once then
|
|
1189
|
-
# TODO: no test coverage
|
|
1190
|
-
return s(:match3, rhs, lhs).line(lhs.line)
|
|
1191
|
-
when :lit then
|
|
1192
|
-
return s(:match3, rhs, lhs).line(lhs.line) if Regexp === rhs.last
|
|
1193
|
-
end
|
|
1194
|
-
end
|
|
1195
|
-
|
|
1196
|
-
new_call(lhs, :"=~", argl(rhs)).line lhs.line
|
|
1197
|
-
end
|
|
1198
|
-
|
|
1199
|
-
def new_module val
|
|
1200
|
-
# TODO: get line from module keyword
|
|
1201
|
-
line, path, body = val[1], val[2], val[4]
|
|
1202
|
-
|
|
1203
|
-
path = path.first if path.instance_of? Array
|
|
1204
|
-
|
|
1205
|
-
result = s(:module, path).line line
|
|
1206
|
-
|
|
1207
|
-
if body then # REFACTOR?
|
|
1208
|
-
if body.sexp_type == :block then
|
|
1209
|
-
result.push(*body.sexp_body)
|
|
1210
|
-
else
|
|
1211
|
-
result.push body
|
|
1212
|
-
end
|
|
1213
|
-
end
|
|
1214
|
-
|
|
1215
|
-
result.comments = self.comments.pop
|
|
1216
|
-
result
|
|
1217
|
-
end
|
|
1218
|
-
|
|
1219
|
-
def new_op_asgn val
|
|
1220
|
-
lhs, (op, _line), rhs = val
|
|
1221
|
-
op = op.to_sym
|
|
1222
|
-
|
|
1223
|
-
name = gettable(lhs.last).line lhs.line
|
|
1224
|
-
arg = remove_begin rhs
|
|
1225
|
-
result = case op # REFACTOR
|
|
1226
|
-
when :"||" then
|
|
1227
|
-
lhs << arg
|
|
1228
|
-
s(:op_asgn_or, name, lhs).line lhs.line
|
|
1229
|
-
when :"&&" then
|
|
1230
|
-
lhs << arg
|
|
1231
|
-
s(:op_asgn_and, name, lhs).line lhs.line
|
|
1232
|
-
else
|
|
1233
|
-
lhs << new_call(name, op, argl(arg))
|
|
1234
|
-
lhs
|
|
1235
|
-
end
|
|
1236
|
-
|
|
1237
|
-
result
|
|
1238
|
-
end
|
|
1239
|
-
|
|
1240
|
-
def new_op_asgn1 val
|
|
1241
|
-
lhs, _, args, _, (op, _), rhs = val
|
|
1242
|
-
|
|
1243
|
-
args.sexp_type = :arglist if args
|
|
1244
|
-
|
|
1245
|
-
result = s(:op_asgn1, lhs, args, op.to_sym, rhs)
|
|
1246
|
-
result.line lhs.line
|
|
1247
|
-
result
|
|
1248
|
-
end
|
|
1249
|
-
|
|
1250
|
-
def new_op_asgn2 val
|
|
1251
|
-
recv, (call_op, _), (meth, _), (op, _), arg = val
|
|
1252
|
-
meth = :"#{meth}="
|
|
1253
|
-
|
|
1254
|
-
result = case call_op.to_sym
|
|
1255
|
-
when :"."
|
|
1256
|
-
s(:op_asgn2, recv, meth, op.to_sym, arg)
|
|
1257
|
-
when :"&."
|
|
1258
|
-
s(:safe_op_asgn2, recv, meth, op.to_sym, arg)
|
|
1259
|
-
else
|
|
1260
|
-
raise "unknown call operator: `#{type.inspect}`"
|
|
1261
|
-
end
|
|
1262
|
-
|
|
1263
|
-
result.line = recv.line
|
|
1264
|
-
result
|
|
1265
|
-
end
|
|
1266
|
-
|
|
1267
|
-
def new_qsym_list
|
|
1268
|
-
s(:array).line lexer.lineno
|
|
1269
|
-
end
|
|
1270
|
-
|
|
1271
|
-
def new_qsym_list_entry val
|
|
1272
|
-
_, (str, line), _ = val
|
|
1273
|
-
s(:lit, str.to_sym).line line
|
|
1274
|
-
end
|
|
1275
|
-
|
|
1276
|
-
def new_qword_list
|
|
1277
|
-
s(:array).line lexer.lineno
|
|
1278
|
-
end
|
|
1279
|
-
|
|
1280
|
-
def new_qword_list_entry val
|
|
1281
|
-
_, (str, line), _ = val
|
|
1282
|
-
str.force_encoding("ASCII-8BIT") unless str.valid_encoding?
|
|
1283
|
-
s(:str, str).line line
|
|
1284
|
-
end
|
|
1285
|
-
|
|
1286
|
-
def new_regexp val
|
|
1287
|
-
(_, line), node, (options, _) = val
|
|
1288
|
-
|
|
1289
|
-
node ||= s(:str, "").line line
|
|
1290
|
-
|
|
1291
|
-
o, k = 0, nil
|
|
1292
|
-
options.split(//).uniq.each do |c| # FIX: this has a better home
|
|
1293
|
-
v = {
|
|
1294
|
-
"x" => Regexp::EXTENDED,
|
|
1295
|
-
"i" => Regexp::IGNORECASE,
|
|
1296
|
-
"m" => Regexp::MULTILINE,
|
|
1297
|
-
"o" => Regexp::ONCE,
|
|
1298
|
-
"n" => Regexp::ENC_NONE,
|
|
1299
|
-
"e" => Regexp::ENC_EUC,
|
|
1300
|
-
"s" => Regexp::ENC_SJIS,
|
|
1301
|
-
"u" => Regexp::ENC_UTF8,
|
|
1302
|
-
}[c]
|
|
1303
|
-
raise "unknown regexp option: #{c}" unless v
|
|
1304
|
-
o += v
|
|
1305
|
-
end
|
|
1306
|
-
|
|
1307
|
-
case node.sexp_type
|
|
1308
|
-
when :str then
|
|
1309
|
-
node.sexp_type = :lit
|
|
1310
|
-
node[1] = if k then
|
|
1311
|
-
Regexp.new(node[1], o, k)
|
|
1312
|
-
else
|
|
1313
|
-
begin
|
|
1314
|
-
Regexp.new(node[1], o)
|
|
1315
|
-
rescue RegexpError => e
|
|
1316
|
-
warn "WARNING: #{e.message} for #{node[1].inspect} #{options.inspect}"
|
|
1317
|
-
begin
|
|
1318
|
-
warn "WARNING: trying to recover with ENC_UTF8"
|
|
1319
|
-
Regexp.new(node[1], Regexp::ENC_UTF8)
|
|
1320
|
-
rescue RegexpError => e
|
|
1321
|
-
warn "WARNING: trying to recover with ENC_NONE"
|
|
1322
|
-
Regexp.new(node[1], Regexp::ENC_NONE)
|
|
1323
|
-
end
|
|
1324
|
-
end
|
|
1325
|
-
end
|
|
1326
|
-
when :dstr then
|
|
1327
|
-
if options =~ /o/ then
|
|
1328
|
-
node.sexp_type = :dregx_once
|
|
1329
|
-
else
|
|
1330
|
-
node.sexp_type = :dregx
|
|
1331
|
-
end
|
|
1332
|
-
node << o if o and o != 0
|
|
1333
|
-
else
|
|
1334
|
-
node = s(:dregx, "", node).line line
|
|
1335
|
-
node.sexp_type = :dregx_once if options =~ /o/
|
|
1336
|
-
node << o if o and o != 0
|
|
1337
|
-
end
|
|
1338
|
-
|
|
1339
|
-
node
|
|
1340
|
-
end
|
|
1341
|
-
|
|
1342
|
-
def new_resbody cond, body
|
|
1343
|
-
if body && body.sexp_type == :block then
|
|
1344
|
-
body.shift # remove block and splat it in directly
|
|
1345
|
-
else
|
|
1346
|
-
body = [body]
|
|
1347
|
-
end
|
|
1348
|
-
|
|
1349
|
-
s(:resbody, cond, *body).line cond.line
|
|
1350
|
-
end
|
|
1351
|
-
|
|
1352
|
-
def new_rescue body, resbody
|
|
1353
|
-
s(:rescue, body, resbody).line body.line
|
|
1354
|
-
end
|
|
1355
|
-
|
|
1356
|
-
def new_sclass val
|
|
1357
|
-
recv, in_def, in_single, body = val[3], val[4], val[6], val[7]
|
|
1358
|
-
|
|
1359
|
-
result = s(:sclass, recv)
|
|
1360
|
-
|
|
1361
|
-
if body then
|
|
1362
|
-
if body.sexp_type == :block then
|
|
1363
|
-
result.push(*body.sexp_body)
|
|
1364
|
-
else
|
|
1365
|
-
result.push body
|
|
1366
|
-
end
|
|
1367
|
-
end
|
|
1368
|
-
|
|
1369
|
-
result.line = val[2]
|
|
1370
|
-
self.in_def = in_def
|
|
1371
|
-
self.in_single = in_single
|
|
1372
|
-
result
|
|
1373
|
-
end
|
|
1374
|
-
|
|
1375
|
-
def new_string val
|
|
1376
|
-
(str, line), = val
|
|
1377
|
-
|
|
1378
|
-
str.force_encoding("UTF-8")
|
|
1379
|
-
# TODO: remove:
|
|
1380
|
-
str.force_encoding("ASCII-8BIT") unless str.valid_encoding?
|
|
1381
|
-
s(:str, str).line line
|
|
1382
|
-
end
|
|
1383
|
-
|
|
1384
|
-
def new_super args
|
|
1385
|
-
if args && args.sexp_type == :block_pass then
|
|
1386
|
-
s(:super, args).line args.line
|
|
1387
|
-
else
|
|
1388
|
-
args ||= s(:arglist).line lexer.lineno
|
|
1389
|
-
s(:super, *args.sexp_body).line args.line
|
|
1390
|
-
end
|
|
1391
|
-
end
|
|
1392
|
-
|
|
1393
|
-
def new_symbol val
|
|
1394
|
-
name = val.last
|
|
1395
|
-
s(:lit, name.to_sym).line lexer.lineno
|
|
1396
|
-
end
|
|
1397
|
-
|
|
1398
|
-
def new_symbol_list
|
|
1399
|
-
# TODO: hunt down and try to remove ALL lexer.lineno usage!
|
|
1400
|
-
s(:array).line lexer.lineno
|
|
1401
|
-
end
|
|
1402
|
-
|
|
1403
|
-
def new_symbol_list_entry val
|
|
1404
|
-
_, sym, _ = val
|
|
1405
|
-
|
|
1406
|
-
sym ||= s(:str, "").line lexer.lineno
|
|
1407
|
-
|
|
1408
|
-
case sym.sexp_type
|
|
1409
|
-
when :dstr then
|
|
1410
|
-
sym.sexp_type = :dsym
|
|
1411
|
-
when :str then
|
|
1412
|
-
sym = s(:lit, sym.last.to_sym).line sym.line
|
|
1413
|
-
else
|
|
1414
|
-
sym = s(:dsym, "", sym).line sym.line
|
|
1415
|
-
end
|
|
1416
|
-
|
|
1417
|
-
sym
|
|
1418
|
-
end
|
|
1419
|
-
|
|
1420
|
-
def new_undef n, m = nil
|
|
1421
|
-
if m then
|
|
1422
|
-
block_append(n, s(:undef, m).line(m.line))
|
|
1423
|
-
else
|
|
1424
|
-
s(:undef, n).line n.line
|
|
1425
|
-
end
|
|
1426
|
-
end
|
|
1427
|
-
|
|
1428
|
-
def new_until block, expr, pre
|
|
1429
|
-
new_until_or_while :until, block, expr, pre
|
|
1430
|
-
end
|
|
1431
|
-
|
|
1432
|
-
def new_until_or_while type, block, expr, pre
|
|
1433
|
-
other = type == :until ? :while : :until
|
|
1434
|
-
line = [block && block.line, expr.line].compact.min
|
|
1435
|
-
block, pre = block.last, false if block && block.sexp_type == :begin
|
|
1436
|
-
|
|
1437
|
-
expr = cond expr
|
|
1438
|
-
|
|
1439
|
-
result = unless expr.sexp_type == :not and canonicalize_conditions then
|
|
1440
|
-
s(type, expr, block, pre)
|
|
1441
|
-
else
|
|
1442
|
-
s(other, expr.last, block, pre)
|
|
1443
|
-
end
|
|
1444
|
-
|
|
1445
|
-
result.line = line
|
|
1446
|
-
result
|
|
1447
|
-
end
|
|
1448
|
-
|
|
1449
|
-
def new_when cond, body
|
|
1450
|
-
s(:when, cond, body)
|
|
1451
|
-
end
|
|
1452
|
-
|
|
1453
|
-
def new_while block, expr, pre
|
|
1454
|
-
new_until_or_while :while, block, expr, pre
|
|
1455
|
-
end
|
|
1456
|
-
|
|
1457
|
-
def new_word_list
|
|
1458
|
-
s(:array).line lexer.lineno
|
|
1459
|
-
end
|
|
1460
|
-
|
|
1461
|
-
def new_word_list_entry val
|
|
1462
|
-
_, word, _ = val
|
|
1463
|
-
word.sexp_type == :evstr ? s(:dstr, "", word).line(word.line) : word
|
|
1464
|
-
end
|
|
1465
|
-
|
|
1466
|
-
def new_xstring val
|
|
1467
|
-
_, node = val
|
|
1468
|
-
|
|
1469
|
-
node ||= s(:str, "").line lexer.lineno
|
|
1470
|
-
|
|
1471
|
-
if node then
|
|
1472
|
-
case node.sexp_type
|
|
1473
|
-
when :str
|
|
1474
|
-
node.sexp_type = :xstr
|
|
1475
|
-
when :dstr
|
|
1476
|
-
node.sexp_type = :dxstr
|
|
1477
|
-
else
|
|
1478
|
-
node = s(:dxstr, "", node).line node.line
|
|
1479
|
-
end
|
|
1480
|
-
end
|
|
1481
|
-
|
|
1482
|
-
node
|
|
1483
|
-
end
|
|
1484
|
-
|
|
1485
|
-
def new_yield args = nil
|
|
1486
|
-
# TODO: raise args.inspect unless [:arglist].include? args.first # HACK
|
|
1487
|
-
raise "write a test 4" if args && args.sexp_type == :block_pass
|
|
1488
|
-
raise SyntaxError, "Block argument should not be given." if
|
|
1489
|
-
args && args.sexp_type == :block_pass
|
|
1490
|
-
|
|
1491
|
-
args ||= s(:arglist).line lexer.lineno
|
|
1492
|
-
|
|
1493
|
-
args.sexp_type = :arglist if [:call_args, :array].include? args.sexp_type
|
|
1494
|
-
args = s(:arglist, args).line args.line unless args.sexp_type == :arglist
|
|
1495
|
-
|
|
1496
|
-
s(:yield, *args.sexp_body).line args.line
|
|
1497
|
-
end
|
|
1498
|
-
|
|
1499
|
-
def prev_value_to_lineno v
|
|
1500
|
-
s, n = v
|
|
1501
|
-
if String === s then
|
|
1502
|
-
n
|
|
1503
|
-
else
|
|
1504
|
-
lexer.lineno
|
|
1505
|
-
end
|
|
1506
|
-
end
|
|
1507
|
-
|
|
1508
|
-
def next_token
|
|
1509
|
-
token = self.lexer.next_token
|
|
1510
|
-
|
|
1511
|
-
if token and token.first != RubyLexer::EOF then
|
|
1512
|
-
self.last_token_type = token
|
|
1513
|
-
return token
|
|
1514
|
-
elsif !token
|
|
1515
|
-
return self.lexer.next_token
|
|
1516
|
-
else
|
|
1517
|
-
return [false, false]
|
|
1518
|
-
end
|
|
1519
|
-
end
|
|
1520
|
-
|
|
1521
|
-
def on_error(et, ev, values)
|
|
1522
|
-
ev = ev.first if ev.instance_of?(Array) && ev.size == 2 && ev.last.is_a?(Integer)
|
|
1523
|
-
super
|
|
1524
|
-
rescue Racc::ParseError => e
|
|
1525
|
-
# I don't like how the exception obscures the error message
|
|
1526
|
-
e.message.replace "%s:%p :: %s" % [self.file, lexer.lineno, e.message.strip]
|
|
1527
|
-
warn e.message if $DEBUG
|
|
1528
|
-
raise
|
|
1529
|
-
end
|
|
1530
|
-
|
|
1531
|
-
##
|
|
1532
|
-
# Parse +str+ at path +file+ and return a sexp. Raises
|
|
1533
|
-
# Timeout::Error if it runs for more than +time+ seconds.
|
|
1534
|
-
|
|
1535
|
-
def process(str, file = "(string)", time = 10)
|
|
1536
|
-
str.freeze
|
|
1537
|
-
|
|
1538
|
-
Timeout.timeout time do
|
|
1539
|
-
raise "bad val: #{str.inspect}" unless String === str
|
|
1540
|
-
|
|
1541
|
-
self.lexer.string = handle_encoding str
|
|
1542
|
-
|
|
1543
|
-
self.file = file.dup
|
|
1544
|
-
|
|
1545
|
-
@yydebug = ENV.has_key? "DEBUG"
|
|
1546
|
-
|
|
1547
|
-
do_parse
|
|
1548
|
-
end
|
|
1549
|
-
end
|
|
1550
|
-
|
|
1551
|
-
alias parse process
|
|
1552
|
-
|
|
1553
|
-
def remove_begin node
|
|
1554
|
-
line = node.line
|
|
1555
|
-
|
|
1556
|
-
node = node.last while node and node.sexp_type == :begin and node.size == 2
|
|
1557
|
-
|
|
1558
|
-
node = s(:nil) if node == s(:begin)
|
|
1559
|
-
|
|
1560
|
-
node.line ||= line
|
|
1561
|
-
|
|
1562
|
-
node
|
|
1563
|
-
end
|
|
1564
|
-
|
|
1565
|
-
alias value_expr remove_begin # TODO: for now..? could check the tree, but meh?
|
|
1566
|
-
|
|
1567
|
-
def reset
|
|
1568
|
-
lexer.reset
|
|
1569
|
-
self.in_def = false
|
|
1570
|
-
self.in_single = 0
|
|
1571
|
-
self.env.reset
|
|
1572
|
-
self.comments.clear
|
|
1573
|
-
self.last_token_type = nil
|
|
1574
|
-
end
|
|
1575
|
-
|
|
1576
|
-
def ret_args node
|
|
1577
|
-
if node then
|
|
1578
|
-
raise "write a test 5" if node.sexp_type == :block_pass
|
|
1579
|
-
|
|
1580
|
-
raise SyntaxError, "block argument should not be given" if
|
|
1581
|
-
node.sexp_type == :block_pass
|
|
1582
|
-
|
|
1583
|
-
node.sexp_type = :array if node.sexp_type == :call_args
|
|
1584
|
-
node = node.last if node.sexp_type == :array && node.size == 2
|
|
1585
|
-
|
|
1586
|
-
# HACK matz wraps ONE of the FOUR splats in a newline to
|
|
1587
|
-
# distinguish. I use paren for now. ugh
|
|
1588
|
-
node = s(:svalue, node).line node.line if node.sexp_type == :splat and not node.paren
|
|
1589
|
-
node.sexp_type = :svalue if node.sexp_type == :arglist && node[1].sexp_type == :splat
|
|
1590
|
-
end
|
|
1591
|
-
|
|
1592
|
-
node
|
|
1593
|
-
end
|
|
1594
|
-
|
|
1595
|
-
def s(*args)
|
|
1596
|
-
result = Sexp.new(*args)
|
|
1597
|
-
# result.line ||= lexer.lineno if lexer.ss unless ENV["CHECK_LINE_NUMS"] # otherwise...
|
|
1598
|
-
result.file = self.file
|
|
1599
|
-
result
|
|
1600
|
-
end
|
|
1601
|
-
|
|
1602
|
-
def debug n
|
|
1603
|
-
if ENV["PRY"] then
|
|
1604
|
-
require "pry"; binding.pry
|
|
1605
|
-
end
|
|
1606
|
-
|
|
1607
|
-
raise RubyParser::SyntaxError, "debug #{n}"
|
|
1608
|
-
end
|
|
1609
|
-
|
|
1610
|
-
def syntax_error msg
|
|
1611
|
-
raise RubyParser::SyntaxError, msg
|
|
1612
|
-
end
|
|
1613
|
-
|
|
1614
|
-
alias yyerror syntax_error
|
|
1615
|
-
|
|
1616
|
-
def void_stmts node
|
|
1617
|
-
return nil unless node
|
|
1618
|
-
return node unless node.sexp_type == :block
|
|
1619
|
-
|
|
1620
|
-
if node.respond_to? :sexp_body= then
|
|
1621
|
-
node.sexp_body = node.sexp_body.map { |n| remove_begin n }
|
|
1622
|
-
else
|
|
1623
|
-
node[1..-1] = node[1..-1].map { |n| remove_begin(n) }
|
|
1624
|
-
end
|
|
1625
|
-
|
|
1626
|
-
node
|
|
1627
|
-
end
|
|
1628
|
-
|
|
1629
|
-
def warning s
|
|
1630
|
-
# do nothing for now
|
|
1631
|
-
end
|
|
1632
|
-
|
|
1633
|
-
def whitespace_width line, remove_width = nil
|
|
1634
|
-
col = 0
|
|
1635
|
-
idx = 0
|
|
1636
|
-
|
|
1637
|
-
line.chars.each do |c|
|
|
1638
|
-
break if remove_width && col >= remove_width
|
|
1639
|
-
case c
|
|
1640
|
-
when " " then
|
|
1641
|
-
col += 1
|
|
1642
|
-
when "\t" then
|
|
1643
|
-
n = TAB_WIDTH * (col / TAB_WIDTH + 1)
|
|
1644
|
-
break if remove_width && n > remove_width
|
|
1645
|
-
col = n
|
|
1646
|
-
else
|
|
1647
|
-
break
|
|
1648
|
-
end
|
|
1649
|
-
idx += 1
|
|
1650
|
-
end
|
|
1651
|
-
|
|
1652
|
-
if remove_width then
|
|
1653
|
-
line[idx..-1]
|
|
1654
|
-
elsif line[idx].nil?
|
|
1655
|
-
nil
|
|
1656
|
-
else
|
|
1657
|
-
col
|
|
1658
|
-
end
|
|
1659
|
-
end
|
|
1660
|
-
|
|
1661
|
-
alias remove_whitespace_width whitespace_width
|
|
1662
|
-
|
|
1663
|
-
def wrap type, node
|
|
1664
|
-
value, line = node
|
|
1665
|
-
value = value.to_sym if value.respond_to? :to_sym
|
|
1666
|
-
s(type, value).line line
|
|
1667
|
-
end
|
|
1668
|
-
|
|
1669
|
-
class Keyword
|
|
1670
|
-
include RubyLexer::State::Values
|
|
1671
|
-
|
|
1672
|
-
class KWtable
|
|
1673
|
-
attr_accessor :name, :state, :id0, :id1
|
|
1674
|
-
def initialize(name, id=[], state=nil)
|
|
1675
|
-
@name = name
|
|
1676
|
-
@id0, @id1 = id
|
|
1677
|
-
@state = state
|
|
1678
|
-
end
|
|
1679
|
-
end
|
|
1680
|
-
|
|
1681
|
-
##
|
|
1682
|
-
# :stopdoc:
|
|
1683
|
-
#
|
|
1684
|
-
# :expr_beg = ignore newline, +/- is a sign.
|
|
1685
|
-
# :expr_end = newline significant, +/- is an operator.
|
|
1686
|
-
# :expr_endarg = ditto, and unbound braces.
|
|
1687
|
-
# :expr_endfn = ditto, and unbound braces.
|
|
1688
|
-
# :expr_arg = newline significant, +/- is an operator.
|
|
1689
|
-
# :expr_cmdarg = ditto
|
|
1690
|
-
# :expr_mid = ditto
|
|
1691
|
-
# :expr_fname = ignore newline, no reserved words.
|
|
1692
|
-
# :expr_dot = right after . or ::, no reserved words.
|
|
1693
|
-
# :expr_class = immediate after class, no here document.
|
|
1694
|
-
# :expr_label = flag bit, label is allowed.
|
|
1695
|
-
# :expr_labeled = flag bit, just after a label.
|
|
1696
|
-
# :expr_fitem = symbol literal as FNAME.
|
|
1697
|
-
# :expr_value = :expr_beg -- work to remove. Need multi-state support.
|
|
1698
|
-
|
|
1699
|
-
expr_woot = EXPR_FNAME|EXPR_FITEM
|
|
1700
|
-
|
|
1701
|
-
wordlist = [
|
|
1702
|
-
["alias", [:kALIAS, :kALIAS ], expr_woot ],
|
|
1703
|
-
["and", [:kAND, :kAND ], EXPR_BEG ],
|
|
1704
|
-
["begin", [:kBEGIN, :kBEGIN ], EXPR_BEG ],
|
|
1705
|
-
["break", [:kBREAK, :kBREAK ], EXPR_MID ],
|
|
1706
|
-
["case", [:kCASE, :kCASE ], EXPR_BEG ],
|
|
1707
|
-
["class", [:kCLASS, :kCLASS ], EXPR_CLASS ],
|
|
1708
|
-
["def", [:kDEF, :kDEF ], EXPR_FNAME ],
|
|
1709
|
-
["defined?", [:kDEFINED, :kDEFINED ], EXPR_ARG ],
|
|
1710
|
-
["do", [:kDO, :kDO ], EXPR_BEG ],
|
|
1711
|
-
["else", [:kELSE, :kELSE ], EXPR_BEG ],
|
|
1712
|
-
["elsif", [:kELSIF, :kELSIF ], EXPR_BEG ],
|
|
1713
|
-
["end", [:kEND, :kEND ], EXPR_END ],
|
|
1714
|
-
["ensure", [:kENSURE, :kENSURE ], EXPR_BEG ],
|
|
1715
|
-
["false", [:kFALSE, :kFALSE ], EXPR_END ],
|
|
1716
|
-
["for", [:kFOR, :kFOR ], EXPR_BEG ],
|
|
1717
|
-
["if", [:kIF, :kIF_MOD ], EXPR_BEG ],
|
|
1718
|
-
["in", [:kIN, :kIN ], EXPR_BEG ],
|
|
1719
|
-
["module", [:kMODULE, :kMODULE ], EXPR_BEG ],
|
|
1720
|
-
["next", [:kNEXT, :kNEXT ], EXPR_MID ],
|
|
1721
|
-
["nil", [:kNIL, :kNIL ], EXPR_END ],
|
|
1722
|
-
["not", [:kNOT, :kNOT ], EXPR_ARG ],
|
|
1723
|
-
["or", [:kOR, :kOR ], EXPR_BEG ],
|
|
1724
|
-
["redo", [:kREDO, :kREDO ], EXPR_END ],
|
|
1725
|
-
["rescue", [:kRESCUE, :kRESCUE_MOD ], EXPR_MID ],
|
|
1726
|
-
["retry", [:kRETRY, :kRETRY ], EXPR_END ],
|
|
1727
|
-
["return", [:kRETURN, :kRETURN ], EXPR_MID ],
|
|
1728
|
-
["self", [:kSELF, :kSELF ], EXPR_END ],
|
|
1729
|
-
["super", [:kSUPER, :kSUPER ], EXPR_ARG ],
|
|
1730
|
-
["then", [:kTHEN, :kTHEN ], EXPR_BEG ],
|
|
1731
|
-
["true", [:kTRUE, :kTRUE ], EXPR_END ],
|
|
1732
|
-
["undef", [:kUNDEF, :kUNDEF ], expr_woot ],
|
|
1733
|
-
["unless", [:kUNLESS, :kUNLESS_MOD ], EXPR_BEG ],
|
|
1734
|
-
["until", [:kUNTIL, :kUNTIL_MOD ], EXPR_BEG ],
|
|
1735
|
-
["when", [:kWHEN, :kWHEN ], EXPR_BEG ],
|
|
1736
|
-
["while", [:kWHILE, :kWHILE_MOD ], EXPR_BEG ],
|
|
1737
|
-
["yield", [:kYIELD, :kYIELD ], EXPR_ARG ],
|
|
1738
|
-
["BEGIN", [:klBEGIN, :klBEGIN ], EXPR_END ],
|
|
1739
|
-
["END", [:klEND, :klEND ], EXPR_END ],
|
|
1740
|
-
["__FILE__", [:k__FILE__, :k__FILE__ ], EXPR_END ],
|
|
1741
|
-
["__LINE__", [:k__LINE__, :k__LINE__ ], EXPR_END ],
|
|
1742
|
-
["__ENCODING__", [:k__ENCODING__, :k__ENCODING__], EXPR_END],
|
|
1743
|
-
].map { |args|
|
|
1744
|
-
KWtable.new(*args)
|
|
1745
|
-
}
|
|
1746
|
-
|
|
1747
|
-
# :startdoc:
|
|
1748
|
-
|
|
1749
|
-
WORDLIST = Hash[*wordlist.map { |o| [o.name, o] }.flatten]
|
|
1750
|
-
|
|
1751
|
-
def self.keyword str
|
|
1752
|
-
WORDLIST[str]
|
|
1753
|
-
end
|
|
1754
|
-
end
|
|
1755
|
-
|
|
1756
|
-
class Environment
|
|
1757
|
-
attr_reader :env, :dyn
|
|
1758
|
-
|
|
1759
|
-
def [] k
|
|
1760
|
-
self.all[k]
|
|
1761
|
-
end
|
|
1762
|
-
|
|
1763
|
-
def []= k, v
|
|
1764
|
-
raise "no" if v == true
|
|
1765
|
-
self.current[k] = v
|
|
1766
|
-
end
|
|
1767
|
-
|
|
1768
|
-
def all
|
|
1769
|
-
idx = @dyn.index(false) || 0
|
|
1770
|
-
@env[0..idx].reverse.inject { |env, scope| env.merge scope }
|
|
1771
|
-
end
|
|
1772
|
-
|
|
1773
|
-
def current
|
|
1774
|
-
@env.first
|
|
1775
|
-
end
|
|
1776
|
-
|
|
1777
|
-
def extend dyn = false
|
|
1778
|
-
@dyn.unshift dyn
|
|
1779
|
-
@env.unshift({})
|
|
1780
|
-
end
|
|
1781
|
-
|
|
1782
|
-
def initialize dyn = false
|
|
1783
|
-
@dyn = []
|
|
1784
|
-
@env = []
|
|
1785
|
-
self.reset
|
|
1786
|
-
end
|
|
1787
|
-
|
|
1788
|
-
def reset
|
|
1789
|
-
@dyn.clear
|
|
1790
|
-
@env.clear
|
|
1791
|
-
self.extend
|
|
1792
|
-
end
|
|
1793
|
-
|
|
1794
|
-
def unextend
|
|
1795
|
-
@dyn.shift
|
|
1796
|
-
@env.shift
|
|
1797
|
-
raise "You went too far unextending env" if @env.empty?
|
|
1798
|
-
end
|
|
1799
|
-
end
|
|
1800
|
-
|
|
1801
|
-
class StackState
|
|
1802
|
-
attr_reader :name
|
|
1803
|
-
attr_reader :stack
|
|
1804
|
-
attr_accessor :debug
|
|
1805
|
-
|
|
1806
|
-
def initialize name, debug=false
|
|
1807
|
-
@name = name
|
|
1808
|
-
@stack = [false]
|
|
1809
|
-
@debug = debug
|
|
1810
|
-
end
|
|
1811
|
-
|
|
1812
|
-
def inspect
|
|
1813
|
-
"StackState(#{@name}, #{@stack.inspect})"
|
|
1814
|
-
end
|
|
1815
|
-
|
|
1816
|
-
def is_in_state
|
|
1817
|
-
log :is_in_state if debug
|
|
1818
|
-
@stack.last
|
|
1819
|
-
end
|
|
1820
|
-
|
|
1821
|
-
def lexpop
|
|
1822
|
-
raise if @stack.size == 0
|
|
1823
|
-
a = @stack.pop
|
|
1824
|
-
b = @stack.pop
|
|
1825
|
-
@stack.push(a || b)
|
|
1826
|
-
log :lexpop if debug
|
|
1827
|
-
end
|
|
1828
|
-
|
|
1829
|
-
def log action
|
|
1830
|
-
c = caller[1]
|
|
1831
|
-
c = caller[2] if c =~ /expr_result/
|
|
1832
|
-
warn "%s_stack.%s: %p at %s" % [name, action, @stack, c.clean_caller]
|
|
1833
|
-
nil
|
|
1834
|
-
end
|
|
1835
|
-
|
|
1836
|
-
def pop
|
|
1837
|
-
r = @stack.pop
|
|
1838
|
-
@stack.push false if @stack.empty?
|
|
1839
|
-
log :pop if debug
|
|
1840
|
-
r
|
|
1841
|
-
end
|
|
1842
|
-
|
|
1843
|
-
def push val
|
|
1844
|
-
@stack.push val
|
|
1845
|
-
log :push if debug
|
|
1846
|
-
end
|
|
1847
|
-
|
|
1848
|
-
def reset
|
|
1849
|
-
@stack = [false]
|
|
1850
|
-
log :reset if debug
|
|
1851
|
-
end
|
|
1852
|
-
|
|
1853
|
-
def restore oldstate
|
|
1854
|
-
@stack.replace oldstate
|
|
1855
|
-
log :restore if debug
|
|
1856
|
-
end
|
|
1857
|
-
|
|
1858
|
-
def store base = false
|
|
1859
|
-
result = @stack.dup
|
|
1860
|
-
@stack.replace [base]
|
|
1861
|
-
log :store if debug
|
|
1862
|
-
result
|
|
1863
|
-
end
|
|
1864
|
-
end
|
|
1865
|
-
end
|