brakeman 4.4.0 → 4.5.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of brakeman might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGES.md +17 -0
- data/bundle/load.rb +7 -8
- data/bundle/ruby/2.5.0/gems/{ruby2ruby-2.4.1 → ruby2ruby-2.4.2}/History.rdoc +8 -0
- data/bundle/ruby/2.5.0/gems/{ruby2ruby-2.4.1 → ruby2ruby-2.4.2}/Manifest.txt +0 -0
- data/bundle/ruby/2.5.0/gems/{ruby2ruby-2.4.1 → ruby2ruby-2.4.2}/README.rdoc +0 -0
- data/bundle/ruby/2.5.0/gems/{ruby2ruby-2.4.1 → ruby2ruby-2.4.2}/lib/ruby2ruby.rb +34 -36
- data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0 → ruby_parser-3.13.0}/History.rdoc +47 -0
- data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0 → ruby_parser-3.13.0}/Manifest.txt +5 -4
- data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0 → ruby_parser-3.13.0}/README.rdoc +0 -0
- data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0 → ruby_parser-3.13.0}/compare/normalize.rb +29 -2
- data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.0/debugging.md +18 -0
- data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0 → ruby_parser-3.13.0}/lib/rp_extensions.rb +0 -7
- data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0 → ruby_parser-3.13.0}/lib/rp_stringscanner.rb +0 -0
- data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.0/lib/ruby20_parser.rb +6874 -0
- data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0 → ruby_parser-3.13.0}/lib/ruby20_parser.y +284 -201
- data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.0/lib/ruby21_parser.rb +6952 -0
- data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0 → ruby_parser-3.13.0}/lib/ruby21_parser.y +281 -197
- data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.0/lib/ruby22_parser.rb +6983 -0
- data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0/lib/ruby_parser.yy → ruby_parser-3.13.0/lib/ruby22_parser.y} +280 -306
- data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.0/lib/ruby23_parser.rb +6982 -0
- data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0 → ruby_parser-3.13.0}/lib/ruby23_parser.y +282 -203
- data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.0/lib/ruby24_parser.rb +6982 -0
- data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0 → ruby_parser-3.13.0}/lib/ruby24_parser.y +282 -203
- data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.0/lib/ruby25_parser.rb +6981 -0
- data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0 → ruby_parser-3.13.0}/lib/ruby25_parser.y +282 -203
- data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.0/lib/ruby26_parser.rb +6999 -0
- data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.0/lib/ruby26_parser.y +2469 -0
- data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0 → ruby_parser-3.13.0}/lib/ruby_lexer.rb +116 -118
- data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0 → ruby_parser-3.13.0}/lib/ruby_lexer.rex +10 -8
- data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0 → ruby_parser-3.13.0}/lib/ruby_lexer.rex.rb +8 -8
- data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0 → ruby_parser-3.13.0}/lib/ruby_parser.rb +5 -7
- data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.0/lib/ruby_parser.yy +2571 -0
- data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.0/lib/ruby_parser_extras.rb +1360 -0
- data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.0/tools/munge.rb +216 -0
- data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.0/tools/ripper.rb +23 -0
- data/bundle/ruby/2.5.0/gems/ruby_parser-legacy-1.0.0/History.rdoc +6 -0
- data/bundle/ruby/2.5.0/gems/ruby_parser-legacy-1.0.0/Manifest.txt +19 -0
- data/bundle/ruby/2.5.0/gems/ruby_parser-legacy-1.0.0/README.rdoc +54 -0
- data/bundle/ruby/2.5.0/gems/ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy.rb +5 -0
- data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0/lib → ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy}/ruby18_parser.rb +7 -6
- data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0/lib → ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy}/ruby18_parser.y +5 -4
- data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0/lib → ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy}/ruby19_parser.rb +7 -6
- data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0/lib → ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy}/ruby19_parser.y +5 -4
- data/bundle/ruby/2.5.0/gems/ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy/ruby_lexer.rb +1412 -0
- data/bundle/ruby/2.5.0/gems/ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy/ruby_lexer.rex +179 -0
- data/bundle/ruby/2.5.0/gems/ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy/ruby_lexer.rex.rb +323 -0
- data/bundle/ruby/2.5.0/gems/ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy/ruby_parser.rb +30 -0
- data/bundle/ruby/2.5.0/gems/{ruby_parser-3.12.0/lib → ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy}/ruby_parser_extras.rb +43 -33
- data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/CHANGES.md +5 -0
- data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/Gemfile +0 -0
- data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/LICENSE.txt +0 -0
- data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/README.md +0 -0
- data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/bundle_install_all_ruby_versions.sh +0 -0
- data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/deep.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/libyaml_checker.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/load.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/parse/date.rb +2 -0
- data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/parse/hexadecimal.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/parse/sexagesimal.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/psych_handler.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/psych_resolver.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/resolver.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/safe_to_ruby_visitor.rb +0 -0
- data/bundle/ruby/2.5.0/gems/safe_yaml-1.0.5/lib/safe_yaml/store.rb +39 -0
- data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/syck_hack.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/syck_node_monkeypatch.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/syck_resolver.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/transform.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/transform/to_boolean.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/transform/to_date.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/transform/to_float.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/transform/to_integer.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/transform/to_nil.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/transform/to_symbol.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/transform/transformation_map.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/lib/safe_yaml/version.rb +1 -1
- data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/run_specs_all_ruby_versions.sh +0 -0
- data/bundle/ruby/2.5.0/gems/{safe_yaml-1.0.4 → safe_yaml-1.0.5}/safe_yaml.gemspec +0 -0
- data/bundle/ruby/2.5.0/gems/{sexp_processor-4.11.0 → sexp_processor-4.12.0}/History.rdoc +8 -0
- data/bundle/ruby/2.5.0/gems/{sexp_processor-4.11.0 → sexp_processor-4.12.0}/Manifest.txt +0 -0
- data/bundle/ruby/2.5.0/gems/{sexp_processor-4.11.0 → sexp_processor-4.12.0}/README.rdoc +0 -0
- data/bundle/ruby/2.5.0/gems/{sexp_processor-4.11.0 → sexp_processor-4.12.0}/lib/composite_sexp_processor.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{sexp_processor-4.11.0 → sexp_processor-4.12.0}/lib/pt_testcase.rb +2 -2
- data/bundle/ruby/2.5.0/gems/{sexp_processor-4.11.0 → sexp_processor-4.12.0}/lib/sexp.rb +4 -4
- data/bundle/ruby/2.5.0/gems/{sexp_processor-4.11.0 → sexp_processor-4.12.0}/lib/sexp_processor.rb +1 -1
- data/bundle/ruby/2.5.0/gems/{sexp_processor-4.11.0 → sexp_processor-4.12.0}/lib/strict_sexp.rb +3 -3
- data/bundle/ruby/2.5.0/gems/{sexp_processor-4.11.0 → sexp_processor-4.12.0}/lib/unique.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/CHANGES +6 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/EXPRESSIONS.md +1 -1
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/Gemfile +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/LICENSE +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/README.md +1 -1
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/engine.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/erb/engine.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/erb/parser.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/erb/template.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/erb/trimming.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/exceptions.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/filter.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/filters/code_merger.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/filters/control_flow.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/filters/dynamic_inliner.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/filters/encoding.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/filters/eraser.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/filters/escapable.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/filters/multi_flattener.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/filters/remove_bom.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/filters/static_analyzer.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/filters/static_merger.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/filters/string_splitter.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/filters/validator.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/generator.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/generators/array.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/generators/array_buffer.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/generators/erb.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/generators/rails_output_buffer.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/generators/string_buffer.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/grammar.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/html/attribute_merger.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/html/attribute_remover.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/html/attribute_sorter.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/html/dispatcher.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/html/fast.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/html/filter.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/html/pretty.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/html/safe.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/map.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/mixins/dispatcher.rb +2 -1
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/mixins/engine_dsl.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/mixins/grammar_dsl.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/mixins/options.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/mixins/template.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/parser.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/static_analyzer.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/templates.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/templates/rails.rb +2 -2
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/templates/tilt.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/lib/temple/utils.rb +0 -0
- data/bundle/ruby/2.5.0/gems/temple-0.8.1/lib/temple/version.rb +3 -0
- data/bundle/ruby/2.5.0/gems/{temple-0.8.0 → temple-0.8.1}/temple.gemspec +0 -0
- data/bundle/ruby/2.5.0/gems/{unicode-display_width-1.4.1 → unicode-display_width-1.5.0}/CHANGELOG.md +4 -0
- data/bundle/ruby/2.5.0/gems/{unicode-display_width-1.4.1 → unicode-display_width-1.5.0}/MIT-LICENSE.txt +1 -1
- data/bundle/ruby/2.5.0/gems/{unicode-display_width-1.4.1 → unicode-display_width-1.5.0}/README.md +10 -10
- data/bundle/ruby/2.5.0/gems/unicode-display_width-1.5.0/data/display_width.marshal.gz +0 -0
- data/bundle/ruby/2.5.0/gems/{unicode-display_width-1.4.1 → unicode-display_width-1.5.0}/lib/unicode/display_width.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{unicode-display_width-1.4.1 → unicode-display_width-1.5.0}/lib/unicode/display_width/constants.rb +2 -2
- data/bundle/ruby/2.5.0/gems/{unicode-display_width-1.4.1 → unicode-display_width-1.5.0}/lib/unicode/display_width/index.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{unicode-display_width-1.4.1 → unicode-display_width-1.5.0}/lib/unicode/display_width/no_string_ext.rb +0 -0
- data/bundle/ruby/2.5.0/gems/{unicode-display_width-1.4.1 → unicode-display_width-1.5.0}/lib/unicode/display_width/string_ext.rb +0 -0
- data/lib/brakeman/checks/base_check.rb +16 -0
- data/lib/brakeman/checks/check_content_tag.rb +12 -0
- data/lib/brakeman/checks/check_cross_site_scripting.rb +6 -6
- data/lib/brakeman/checks/check_evaluation.rb +0 -1
- data/lib/brakeman/checks/check_execute.rb +18 -0
- data/lib/brakeman/checks/check_send.rb +0 -1
- data/lib/brakeman/checks/check_session_manipulation.rb +0 -1
- data/lib/brakeman/checks/check_sql.rb +12 -3
- data/lib/brakeman/file_parser.rb +8 -4
- data/lib/brakeman/parsers/haml_embedded.rb +44 -0
- data/lib/brakeman/parsers/slim_embedded.rb +44 -0
- data/lib/brakeman/parsers/template_parser.rb +2 -4
- data/lib/brakeman/processors/alias_processor.rb +23 -1
- data/lib/brakeman/processors/lib/call_conversion_helper.rb +4 -0
- data/lib/brakeman/processors/slim_template_processor.rb +16 -0
- data/lib/brakeman/processors/template_alias_processor.rb +2 -2
- data/lib/brakeman/scanner.rb +11 -10
- data/lib/brakeman/tracker.rb +5 -1
- data/lib/brakeman/tracker/config.rb +32 -7
- data/lib/brakeman/util.rb +17 -0
- data/lib/brakeman/version.rb +1 -1
- metadata +157 -320
- data/bundle/ruby/2.5.0/gems/ruby_parser-3.12.0/lib/ruby20_parser.rb +0 -6687
- data/bundle/ruby/2.5.0/gems/ruby_parser-3.12.0/lib/ruby21_parser.rb +0 -6767
- data/bundle/ruby/2.5.0/gems/ruby_parser-3.12.0/lib/ruby22_parser.rb +0 -6803
- data/bundle/ruby/2.5.0/gems/ruby_parser-3.12.0/lib/ruby22_parser.y +0 -2376
- data/bundle/ruby/2.5.0/gems/ruby_parser-3.12.0/lib/ruby23_parser.rb +0 -6818
- data/bundle/ruby/2.5.0/gems/ruby_parser-3.12.0/lib/ruby24_parser.rb +0 -6818
- data/bundle/ruby/2.5.0/gems/ruby_parser-3.12.0/lib/ruby25_parser.rb +0 -6818
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/CODE_OF_CONDUCT.md +0 -10
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/CONTRIBUTING.md +0 -148
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/MIT-LICENSE +0 -20
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/README.md +0 -227
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/REVISION +0 -1
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/VERSION +0 -1
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/VERSION_DATE +0 -1
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/VERSION_NAME +0 -1
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/extra/sass-spec-ref.sh +0 -32
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/extra/update_watch.rb +0 -13
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/init.rb +0 -18
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass.rb +0 -109
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/cache_stores.rb +0 -15
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/cache_stores/base.rb +0 -88
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/cache_stores/chain.rb +0 -34
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/cache_stores/filesystem.rb +0 -60
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/cache_stores/memory.rb +0 -46
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/cache_stores/null.rb +0 -25
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/callbacks.rb +0 -67
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/css.rb +0 -408
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/deprecation.rb +0 -55
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/engine.rb +0 -1226
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/environment.rb +0 -215
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/error.rb +0 -198
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/exec.rb +0 -9
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/exec/base.rb +0 -199
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/exec/sass_convert.rb +0 -283
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/exec/sass_scss.rb +0 -440
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/features.rb +0 -47
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/importers.rb +0 -23
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/importers/base.rb +0 -182
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/importers/deprecated_path.rb +0 -51
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/importers/filesystem.rb +0 -219
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/logger.rb +0 -17
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/logger/base.rb +0 -36
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/logger/delayed.rb +0 -50
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/logger/log_level.rb +0 -45
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/media.rb +0 -210
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/plugin.rb +0 -134
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/plugin/compiler.rb +0 -582
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/plugin/configuration.rb +0 -134
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/plugin/generic.rb +0 -15
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/plugin/merb.rb +0 -48
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/plugin/rack.rb +0 -60
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/plugin/rails.rb +0 -47
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/plugin/staleness_checker.rb +0 -199
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/railtie.rb +0 -10
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/repl.rb +0 -57
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/root.rb +0 -7
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script.rb +0 -66
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/css_lexer.rb +0 -33
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/css_parser.rb +0 -33
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/css_variable_warning.rb +0 -52
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/functions.rb +0 -2693
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/lexer.rb +0 -464
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/parser.rb +0 -832
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/tree.rb +0 -16
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/tree/funcall.rb +0 -313
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/tree/interpolation.rb +0 -223
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/tree/list_literal.rb +0 -104
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/tree/literal.rb +0 -49
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/tree/map_literal.rb +0 -64
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/tree/node.rb +0 -127
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/tree/operation.rb +0 -156
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/tree/selector.rb +0 -26
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/tree/string_interpolation.rb +0 -125
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/tree/unary_operation.rb +0 -69
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/tree/variable.rb +0 -57
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/value.rb +0 -11
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/value/arg_list.rb +0 -36
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/value/base.rb +0 -241
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/value/bool.rb +0 -35
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/value/color.rb +0 -698
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/value/helpers.rb +0 -272
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/value/list.rb +0 -113
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/value/map.rb +0 -70
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/value/null.rb +0 -44
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/value/number.rb +0 -563
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/script/value/string.rb +0 -138
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/scss.rb +0 -14
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/scss/css_parser.rb +0 -56
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/scss/parser.rb +0 -1254
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/scss/rx.rb +0 -140
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/scss/static_parser.rb +0 -373
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/selector.rb +0 -323
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/selector/abstract_sequence.rb +0 -111
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/selector/comma_sequence.rb +0 -191
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/selector/pseudo.rb +0 -266
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/selector/sequence.rb +0 -636
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/selector/simple.rb +0 -117
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/selector/simple_sequence.rb +0 -344
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/shared.rb +0 -76
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/source/map.rb +0 -213
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/source/position.rb +0 -39
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/source/range.rb +0 -41
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/stack.rb +0 -120
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/supports.rb +0 -225
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/at_root_node.rb +0 -83
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/charset_node.rb +0 -22
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/comment_node.rb +0 -82
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/content_node.rb +0 -9
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/css_import_node.rb +0 -68
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/debug_node.rb +0 -18
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/directive_node.rb +0 -59
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/each_node.rb +0 -24
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/error_node.rb +0 -18
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/extend_node.rb +0 -43
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/for_node.rb +0 -36
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/function_node.rb +0 -44
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/if_node.rb +0 -52
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/import_node.rb +0 -75
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/keyframe_rule_node.rb +0 -15
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/media_node.rb +0 -48
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/mixin_def_node.rb +0 -38
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/mixin_node.rb +0 -52
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/node.rb +0 -240
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/prop_node.rb +0 -170
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/return_node.rb +0 -19
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/root_node.rb +0 -44
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/rule_node.rb +0 -155
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/supports_node.rb +0 -38
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/trace_node.rb +0 -33
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/variable_node.rb +0 -36
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/visitors/base.rb +0 -72
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/visitors/check_nesting.rb +0 -173
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/visitors/convert.rb +0 -351
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/visitors/cssize.rb +0 -373
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/visitors/deep_copy.rb +0 -107
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/visitors/extend.rb +0 -70
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/visitors/perform.rb +0 -564
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/visitors/set_options.rb +0 -139
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/visitors/to_css.rb +0 -409
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/warn_node.rb +0 -18
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/tree/while_node.rb +0 -18
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/util.rb +0 -1375
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/util/cross_platform_random.rb +0 -19
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/util/multibyte_string_scanner.rb +0 -155
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/util/normalized_map.rb +0 -129
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/util/ordered_hash.rb +0 -192
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/util/subset_map.rb +0 -109
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/util/test.rb +0 -9
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/lib/sass/version.rb +0 -124
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/rails/init.rb +0 -1
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/CHANGELOG.md +0 -1
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/CONTRIBUTING.md +0 -38
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/Gemfile +0 -20
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/Guardfile +0 -8
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/LICENSE +0 -20
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/README.md +0 -349
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/Rakefile +0 -5
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/Vagrantfile +0 -96
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/lib/listen.rb +0 -54
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/lib/listen/adapter.rb +0 -327
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/lib/listen/adapters/bsd.rb +0 -75
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/lib/listen/adapters/darwin.rb +0 -48
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/lib/listen/adapters/linux.rb +0 -81
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/lib/listen/adapters/polling.rb +0 -58
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/lib/listen/adapters/windows.rb +0 -91
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/lib/listen/directory_record.rb +0 -406
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/lib/listen/listener.rb +0 -323
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/lib/listen/turnstile.rb +0 -32
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/lib/listen/version.rb +0 -3
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/listen.gemspec +0 -28
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/spec/listen/adapter_spec.rb +0 -149
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/spec/listen/adapters/bsd_spec.rb +0 -36
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/spec/listen/adapters/darwin_spec.rb +0 -37
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/spec/listen/adapters/linux_spec.rb +0 -47
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/spec/listen/adapters/polling_spec.rb +0 -68
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/spec/listen/adapters/windows_spec.rb +0 -30
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/spec/listen/directory_record_spec.rb +0 -1250
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/spec/listen/listener_spec.rb +0 -258
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/spec/listen/turnstile_spec.rb +0 -56
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/spec/listen_spec.rb +0 -67
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/spec/spec_helper.rb +0 -25
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/spec/support/adapter_helper.rb +0 -666
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/spec/support/directory_record_helper.rb +0 -57
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/spec/support/fixtures_helper.rb +0 -29
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/spec/support/listeners_helper.rb +0 -179
- data/bundle/ruby/2.5.0/gems/sass-3.4.25/vendor/listen/spec/support/platform_helper.rb +0 -15
- data/bundle/ruby/2.5.0/gems/temple-0.8.0/lib/temple/version.rb +0 -3
- data/bundle/ruby/2.5.0/gems/unicode-display_width-1.4.1/data/display_width.marshal.gz +0 -0
@@ -85,14 +85,35 @@ rule
|
|
85
85
|
end
|
86
86
|
self.env.extend
|
87
87
|
}
|
88
|
-
|
88
|
+
begin_block
|
89
89
|
{
|
90
|
-
|
90
|
+
_, _, block = val
|
91
|
+
result = block
|
92
|
+
}
|
93
|
+
|
94
|
+
begin_block: tLCURLY top_compstmt tRCURLY
|
95
|
+
{
|
96
|
+
_, stmt, _ = val
|
97
|
+
result = new_iter s(:preexe), 0, stmt
|
91
98
|
}
|
92
99
|
|
93
|
-
bodystmt: compstmt opt_rescue
|
100
|
+
bodystmt: compstmt opt_rescue k_else
|
94
101
|
{
|
95
|
-
|
102
|
+
res = _values[-2]
|
103
|
+
yyerror "else without rescue is useless" unless res
|
104
|
+
}
|
105
|
+
compstmt
|
106
|
+
opt_ensure
|
107
|
+
{
|
108
|
+
body, resc, _, _, els, ens = val
|
109
|
+
|
110
|
+
result = new_body [body, resc, els, ens]
|
111
|
+
}
|
112
|
+
| compstmt opt_rescue opt_ensure
|
113
|
+
{
|
114
|
+
body, resc, ens = val
|
115
|
+
|
116
|
+
result = new_body [body, resc, nil, ens]
|
96
117
|
}
|
97
118
|
|
98
119
|
compstmt: stmts opt_terms
|
@@ -101,8 +122,8 @@ rule
|
|
101
122
|
}
|
102
123
|
|
103
124
|
stmts: none
|
104
|
-
|
|
105
|
-
| stmts terms
|
125
|
+
| stmt_or_begin # TODO: newline_node ?
|
126
|
+
| stmts terms stmt_or_begin
|
106
127
|
{
|
107
128
|
result = self.block_append val[0], val[2]
|
108
129
|
}
|
@@ -112,6 +133,21 @@ rule
|
|
112
133
|
debug20 2, val, result
|
113
134
|
}
|
114
135
|
|
136
|
+
stmt_or_begin: stmt
|
137
|
+
| klBEGIN
|
138
|
+
{
|
139
|
+
if (self.in_def || self.in_single > 0) then
|
140
|
+
debug20 1
|
141
|
+
yyerror "BEGIN in method"
|
142
|
+
end
|
143
|
+
self.env.extend
|
144
|
+
}
|
145
|
+
begin_block
|
146
|
+
{
|
147
|
+
_, _, stmt = val
|
148
|
+
result = stmt
|
149
|
+
}
|
150
|
+
|
115
151
|
stmt: kALIAS fitem
|
116
152
|
{
|
117
153
|
lexer.lex_state = :expr_fname
|
@@ -155,7 +191,8 @@ rule
|
|
155
191
|
}
|
156
192
|
| stmt kRESCUE_MOD stmt
|
157
193
|
{
|
158
|
-
|
194
|
+
body, _, resbody = val
|
195
|
+
result = new_rescue body, new_resbody(s(:array), resbody)
|
159
196
|
}
|
160
197
|
| klEND tLCURLY compstmt tRCURLY
|
161
198
|
{
|
@@ -170,15 +207,37 @@ rule
|
|
170
207
|
{
|
171
208
|
result = new_masgn val[0], val[2], :wrap
|
172
209
|
}
|
173
|
-
|
|
210
|
+
| lhs tEQL mrhs
|
211
|
+
{
|
212
|
+
result = new_assign val[0], s(:svalue, val[2])
|
213
|
+
}
|
214
|
+
| mlhs tEQL arg_value
|
215
|
+
{
|
216
|
+
result = new_masgn val[0], val[2], :wrap
|
217
|
+
}
|
218
|
+
| mlhs tEQL mrhs
|
219
|
+
{
|
220
|
+
result = new_masgn val[0], val[2]
|
221
|
+
}
|
222
|
+
| expr
|
223
|
+
|
224
|
+
command_asgn: lhs tEQL command_rhs
|
225
|
+
{
|
226
|
+
result = new_assign val[0], val[2]
|
227
|
+
}
|
228
|
+
# | lhs tEQL command_asgn
|
229
|
+
# {
|
230
|
+
# result = new_assign val[0], val[2]
|
231
|
+
# }
|
232
|
+
| var_lhs tOP_ASGN command_rhs
|
174
233
|
{
|
175
234
|
result = new_op_asgn val
|
176
235
|
}
|
177
|
-
| primary_value tLBRACK2 opt_call_args rbracket tOP_ASGN
|
236
|
+
| primary_value tLBRACK2 opt_call_args rbracket tOP_ASGN command_rhs
|
178
237
|
{
|
179
238
|
result = s(:op_asgn1, val[0], val[2], val[4].to_sym, val[5])
|
180
239
|
}
|
181
|
-
| primary_value call_op tIDENTIFIER tOP_ASGN
|
240
|
+
| primary_value call_op tIDENTIFIER tOP_ASGN command_rhs
|
182
241
|
{
|
183
242
|
result = s(:op_asgn, val[0], val[4], val[2].to_sym, val[3].to_sym)
|
184
243
|
if val[1] == '&.'
|
@@ -186,7 +245,7 @@ rule
|
|
186
245
|
end
|
187
246
|
result.line = val[0].line
|
188
247
|
}
|
189
|
-
| primary_value call_op tCONSTANT tOP_ASGN
|
248
|
+
| primary_value call_op tCONSTANT tOP_ASGN command_rhs
|
190
249
|
{
|
191
250
|
result = s(:op_asgn, val[0], val[4], val[2].to_sym, val[3].to_sym)
|
192
251
|
if val[1] == '&.'
|
@@ -194,42 +253,33 @@ rule
|
|
194
253
|
end
|
195
254
|
result.line = val[0].line
|
196
255
|
}
|
197
|
-
| primary_value tCOLON2 tCONSTANT tOP_ASGN
|
256
|
+
| primary_value tCOLON2 tCONSTANT tOP_ASGN command_rhs
|
198
257
|
{
|
199
258
|
result = s(:op_asgn, val[0], val[4], val[2], val[3])
|
200
259
|
debug20 4, val, result
|
201
260
|
}
|
202
|
-
| primary_value tCOLON2 tIDENTIFIER tOP_ASGN
|
261
|
+
| primary_value tCOLON2 tIDENTIFIER tOP_ASGN command_rhs
|
203
262
|
{
|
204
263
|
result = s(:op_asgn, val[0], val[4], val[2], val[3])
|
205
264
|
debug20 5, val, result
|
206
265
|
}
|
207
|
-
| backref tOP_ASGN
|
266
|
+
| backref tOP_ASGN command_rhs
|
208
267
|
{
|
209
268
|
self.backref_assign_error val[0]
|
210
269
|
}
|
211
|
-
| lhs tEQL mrhs
|
212
|
-
{
|
213
|
-
result = new_assign val[0], s(:svalue, val[2])
|
214
|
-
}
|
215
|
-
| mlhs tEQL arg_value
|
216
|
-
{
|
217
|
-
result = new_masgn val[0], val[2], :wrap
|
218
|
-
}
|
219
|
-
| mlhs tEQL mrhs
|
220
|
-
{
|
221
|
-
result = new_masgn val[0], val[2]
|
222
|
-
}
|
223
|
-
| expr
|
224
270
|
|
225
|
-
|
271
|
+
command_rhs: command_call =tOP_ASGN
|
226
272
|
{
|
227
|
-
|
273
|
+
expr, = val
|
274
|
+
result = value_expr expr
|
228
275
|
}
|
229
|
-
|
|
276
|
+
| command_call kRESCUE_MOD stmt
|
230
277
|
{
|
231
|
-
|
278
|
+
expr, _, resbody = val
|
279
|
+
expr = value_expr expr
|
280
|
+
result = new_rescue(expr, new_resbody(s(:array), resbody))
|
232
281
|
}
|
282
|
+
| command_asgn
|
233
283
|
|
234
284
|
expr: command_call
|
235
285
|
| expr kAND expr
|
@@ -255,30 +305,40 @@ rule
|
|
255
305
|
result = value_expr(val[0])
|
256
306
|
}
|
257
307
|
|
308
|
+
expr_value_do: {
|
309
|
+
lexer.cond.push true
|
310
|
+
}
|
311
|
+
expr_value do
|
312
|
+
{
|
313
|
+
lexer.cond.pop
|
314
|
+
}
|
315
|
+
{
|
316
|
+
_, expr, _, _ = val
|
317
|
+
result = expr
|
318
|
+
}
|
319
|
+
|
258
320
|
command_call: command
|
259
321
|
| block_command
|
260
322
|
|
261
323
|
block_command: block_call
|
262
|
-
| block_call
|
324
|
+
| block_call call_op2 operation2 command_args
|
263
325
|
{
|
264
326
|
result = new_call val[0], val[2].to_sym, val[3]
|
265
327
|
}
|
266
328
|
|
267
329
|
cmd_brace_block: tLBRACE_ARG
|
268
330
|
{
|
269
|
-
self.env.extend(:dynamic)
|
331
|
+
# self.env.extend(:dynamic)
|
270
332
|
result = self.lexer.lineno
|
271
333
|
}
|
272
|
-
|
273
|
-
{
|
274
|
-
result = nil # self.env.dynamic.keys
|
275
|
-
}
|
276
|
-
compstmt tRCURLY
|
334
|
+
brace_body tRCURLY
|
277
335
|
{
|
278
|
-
|
279
|
-
result.line = val[1]
|
336
|
+
_, line, body, _ = val
|
280
337
|
|
281
|
-
|
338
|
+
result = body
|
339
|
+
result.line = line
|
340
|
+
|
341
|
+
# self.env.unextend
|
282
342
|
}
|
283
343
|
|
284
344
|
fcall: operation
|
@@ -336,7 +396,7 @@ rule
|
|
336
396
|
{
|
337
397
|
result = new_yield val[1]
|
338
398
|
}
|
339
|
-
|
|
399
|
+
| k_return call_args
|
340
400
|
{
|
341
401
|
line = val[0].last
|
342
402
|
result = s(:return, ret_args(val[1])).line(line)
|
@@ -560,8 +620,9 @@ rule
|
|
560
620
|
|
561
621
|
| reswords
|
562
622
|
{
|
623
|
+
(sym, _line), = val
|
563
624
|
lexer.lex_state = :expr_end
|
564
|
-
result =
|
625
|
+
result = sym
|
565
626
|
}
|
566
627
|
|
567
628
|
fsym: fname | symbol
|
@@ -603,51 +664,46 @@ rule
|
|
603
664
|
| kWHEN | kYIELD | kIF | kUNLESS | kWHILE
|
604
665
|
| kUNTIL
|
605
666
|
|
606
|
-
arg: lhs tEQL
|
667
|
+
arg: lhs tEQL arg_rhs
|
607
668
|
{
|
608
669
|
result = new_assign val[0], val[2]
|
609
670
|
}
|
610
|
-
|
|
611
|
-
{
|
612
|
-
result = new_assign val[0], s(:rescue, val[2], new_resbody(s(:array), val[4]))
|
613
|
-
}
|
614
|
-
| var_lhs tOP_ASGN arg
|
671
|
+
| var_lhs tOP_ASGN arg_rhs
|
615
672
|
{
|
616
673
|
result = new_op_asgn val
|
617
674
|
}
|
618
|
-
|
|
619
|
-
{
|
620
|
-
result = new_op_asgn val
|
621
|
-
result = s(:rescue, result, new_resbody(s(:array), val[4]))
|
622
|
-
}
|
623
|
-
| primary_value tLBRACK2 opt_call_args rbracket tOP_ASGN arg
|
675
|
+
| primary_value tLBRACK2 opt_call_args rbracket tOP_ASGN arg_rhs
|
624
676
|
{
|
625
677
|
val[2].sexp_type = :arglist if val[2]
|
626
678
|
result = s(:op_asgn1, val[0], val[2], val[4].to_sym, val[5])
|
627
679
|
}
|
628
|
-
| primary_value call_op tIDENTIFIER tOP_ASGN
|
680
|
+
| primary_value call_op tIDENTIFIER tOP_ASGN arg_rhs
|
629
681
|
{
|
630
682
|
result = new_op_asgn2 val
|
631
683
|
}
|
632
|
-
| primary_value call_op tCONSTANT tOP_ASGN
|
684
|
+
| primary_value call_op tCONSTANT tOP_ASGN arg_rhs
|
633
685
|
{
|
634
686
|
result = new_op_asgn2 val
|
635
687
|
}
|
636
|
-
| primary_value tCOLON2 tIDENTIFIER tOP_ASGN
|
688
|
+
| primary_value tCOLON2 tIDENTIFIER tOP_ASGN arg_rhs
|
637
689
|
{
|
638
690
|
result = s(:op_asgn, val[0], val[4], val[2].to_sym, val[3].to_sym)
|
639
691
|
}
|
640
|
-
| primary_value tCOLON2 tCONSTANT tOP_ASGN
|
692
|
+
| primary_value tCOLON2 tCONSTANT tOP_ASGN arg_rhs
|
641
693
|
{
|
642
|
-
|
694
|
+
# TODO: assignment
|
695
|
+
raise "not yet: %p" % [val]
|
643
696
|
}
|
644
|
-
| tCOLON3 tCONSTANT tOP_ASGN
|
697
|
+
| tCOLON3 tCONSTANT tOP_ASGN arg_rhs
|
645
698
|
{
|
646
|
-
|
699
|
+
# TODO: assignment
|
700
|
+
raise "not yet: %p" % [val]
|
647
701
|
}
|
648
|
-
| backref tOP_ASGN
|
702
|
+
| backref tOP_ASGN arg_rhs
|
649
703
|
{
|
650
|
-
|
704
|
+
# TODO: lhs = var_field val[0]
|
705
|
+
asgn = new_op_asgn val
|
706
|
+
result = self.backref_assign_error asgn
|
651
707
|
}
|
652
708
|
| arg tDOT2 arg
|
653
709
|
{
|
@@ -725,22 +781,7 @@ rule
|
|
725
781
|
{
|
726
782
|
result = new_call val[0], :"<=>", argl(val[2])
|
727
783
|
}
|
728
|
-
|
|
729
|
-
{
|
730
|
-
result = new_call val[0], :">", argl(val[2])
|
731
|
-
}
|
732
|
-
| arg tGEQ arg
|
733
|
-
{
|
734
|
-
result = new_call val[0], :">=", argl(val[2])
|
735
|
-
}
|
736
|
-
| arg tLT arg
|
737
|
-
{
|
738
|
-
result = new_call val[0], :"<", argl(val[2])
|
739
|
-
}
|
740
|
-
| arg tLEQ arg
|
741
|
-
{
|
742
|
-
result = new_call val[0], :"<=", argl(val[2])
|
743
|
-
}
|
784
|
+
| rel_expr =tCMP
|
744
785
|
| arg tEQ arg
|
745
786
|
{
|
746
787
|
result = new_call val[0], :"==", argl(val[2])
|
@@ -799,6 +840,23 @@ rule
|
|
799
840
|
}
|
800
841
|
| primary
|
801
842
|
|
843
|
+
relop: tGT
|
844
|
+
| tLT
|
845
|
+
| tGEQ
|
846
|
+
| tLEQ
|
847
|
+
|
848
|
+
rel_expr: arg relop arg =tGT
|
849
|
+
{
|
850
|
+
lhs, op, rhs = val
|
851
|
+
result = new_call lhs, op.to_sym, argl(rhs)
|
852
|
+
}
|
853
|
+
| rel_expr relop arg =tGT
|
854
|
+
{
|
855
|
+
lhs, op, rhs = val
|
856
|
+
warn "comparison '%s' after comparison", op
|
857
|
+
result = new_call lhs, op.to_sym, argl(rhs)
|
858
|
+
}
|
859
|
+
|
802
860
|
arg_value: arg
|
803
861
|
{
|
804
862
|
result = value_expr(val[0])
|
@@ -818,6 +876,15 @@ rule
|
|
818
876
|
result = args [array_to_hash(val[0])]
|
819
877
|
}
|
820
878
|
|
879
|
+
arg_rhs: arg =tOP_ASGN
|
880
|
+
| arg kRESCUE_MOD arg
|
881
|
+
{
|
882
|
+
body, _, resbody = val
|
883
|
+
body = value_expr body
|
884
|
+
resbody = remove_begin resbody
|
885
|
+
result = new_rescue(body, new_resbody(s(:array), resbody))
|
886
|
+
}
|
887
|
+
|
821
888
|
paren_args: tLPAREN2 opt_call_args rparen
|
822
889
|
{
|
823
890
|
result = val[1]
|
@@ -873,12 +940,11 @@ rule
|
|
873
940
|
}
|
874
941
|
|
875
942
|
command_args: {
|
876
|
-
result = lexer.cmdarg.
|
877
|
-
lexer.cmdarg.push true
|
943
|
+
result = lexer.cmdarg.store true
|
878
944
|
}
|
879
945
|
call_args
|
880
946
|
{
|
881
|
-
lexer.cmdarg.
|
947
|
+
lexer.cmdarg.restore val[0]
|
882
948
|
result = val[1]
|
883
949
|
}
|
884
950
|
|
@@ -937,12 +1003,16 @@ rule
|
|
937
1003
|
{
|
938
1004
|
result = new_call nil, val[0].to_sym
|
939
1005
|
}
|
940
|
-
|
|
1006
|
+
| k_begin
|
941
1007
|
{
|
942
1008
|
result = self.lexer.lineno
|
1009
|
+
# TODO:
|
1010
|
+
# $<val>1 = cmdarg_stack;
|
1011
|
+
# CMDARG_SET(0);
|
943
1012
|
}
|
944
|
-
bodystmt
|
1013
|
+
bodystmt k_end
|
945
1014
|
{
|
1015
|
+
# TODO: CMDARG_SET($<val>1);
|
946
1016
|
unless val[2] then
|
947
1017
|
result = s(:nil)
|
948
1018
|
else
|
@@ -953,22 +1023,25 @@ rule
|
|
953
1023
|
}
|
954
1024
|
| tLPAREN_ARG rparen
|
955
1025
|
{
|
1026
|
+
# TODO: lex_state = :expr_endarg in between
|
956
1027
|
debug20 13, val, result
|
957
1028
|
}
|
958
1029
|
| tLPAREN_ARG
|
959
1030
|
{
|
960
|
-
result =
|
961
|
-
lexer.cmdarg.stack.
|
1031
|
+
result = lexer.cmdarg.store false
|
1032
|
+
# result = self.lexer.cmdarg.stack.dup
|
1033
|
+
# lexer.cmdarg.stack.replace [false] # TODO add api for these
|
962
1034
|
}
|
963
|
-
|
1035
|
+
stmt
|
964
1036
|
{
|
965
1037
|
lexer.lex_state = :expr_endarg
|
966
1038
|
}
|
967
1039
|
rparen
|
968
1040
|
{
|
1041
|
+
_, cmdarg, stmt, _, _, = val
|
969
1042
|
warning "(...) interpreted as grouped expression"
|
970
|
-
lexer.cmdarg.
|
971
|
-
result =
|
1043
|
+
lexer.cmdarg.restore cmdarg
|
1044
|
+
result = stmt
|
972
1045
|
}
|
973
1046
|
| tLPAREN compstmt tRPAREN
|
974
1047
|
{
|
@@ -996,7 +1069,7 @@ rule
|
|
996
1069
|
{
|
997
1070
|
result = new_hash val
|
998
1071
|
}
|
999
|
-
|
|
1072
|
+
| k_return
|
1000
1073
|
{
|
1001
1074
|
result = s(:return)
|
1002
1075
|
}
|
@@ -1044,61 +1117,42 @@ rule
|
|
1044
1117
|
{
|
1045
1118
|
result = val[1] # TODO: fix lineno
|
1046
1119
|
}
|
1047
|
-
|
|
1048
|
-
{
|
1049
|
-
result = new_if val[1], val[3], val[4]
|
1050
|
-
}
|
1051
|
-
| kUNLESS expr_value then compstmt opt_else kEND
|
1052
|
-
{
|
1053
|
-
result = new_if val[1], val[4], val[3]
|
1054
|
-
}
|
1055
|
-
| kWHILE
|
1056
|
-
{
|
1057
|
-
lexer.cond.push true
|
1058
|
-
}
|
1059
|
-
expr_value do
|
1060
|
-
{
|
1061
|
-
lexer.cond.pop
|
1062
|
-
}
|
1063
|
-
compstmt kEND
|
1120
|
+
| k_if expr_value then compstmt if_tail k_end
|
1064
1121
|
{
|
1065
|
-
|
1122
|
+
_, c, _, t, f, _ = val
|
1123
|
+
result = new_if c, t, f
|
1066
1124
|
}
|
1067
|
-
|
|
1125
|
+
| k_unless expr_value then compstmt opt_else k_end
|
1068
1126
|
{
|
1069
|
-
|
1127
|
+
_, c, _, t, f, _ = val
|
1128
|
+
result = new_if c, f, t
|
1070
1129
|
}
|
1071
|
-
|
1130
|
+
| k_while expr_value_do compstmt k_end
|
1072
1131
|
{
|
1073
|
-
|
1132
|
+
_, cond, body, _ = val
|
1133
|
+
result = new_while body, cond, true
|
1074
1134
|
}
|
1075
|
-
|
1135
|
+
| k_until expr_value_do compstmt k_end
|
1076
1136
|
{
|
1077
|
-
|
1137
|
+
_, cond, body, _ = val
|
1138
|
+
result = new_until body, cond, true
|
1078
1139
|
}
|
1079
|
-
|
|
1140
|
+
| k_case expr_value opt_terms case_body k_end
|
1080
1141
|
{
|
1081
1142
|
(_, line), expr, _, body, _ = val
|
1082
1143
|
result = new_case expr, body, line
|
1083
1144
|
}
|
1084
|
-
|
|
1145
|
+
| k_case opt_terms case_body k_end
|
1085
1146
|
{
|
1086
1147
|
(_, line), _, body, _ = val
|
1087
1148
|
result = new_case nil, body, line
|
1088
1149
|
}
|
1089
|
-
|
|
1150
|
+
| k_for for_var kIN expr_value_do compstmt k_end
|
1090
1151
|
{
|
1091
|
-
|
1152
|
+
_, var, _, iter, body, _ = val
|
1153
|
+
result = new_for iter, var, body
|
1092
1154
|
}
|
1093
|
-
|
1094
|
-
{
|
1095
|
-
lexer.cond.pop
|
1096
|
-
}
|
1097
|
-
compstmt kEND
|
1098
|
-
{
|
1099
|
-
result = new_for val[4], val[1], val[7]
|
1100
|
-
}
|
1101
|
-
| kCLASS
|
1155
|
+
| k_class
|
1102
1156
|
{
|
1103
1157
|
result = self.lexer.lineno
|
1104
1158
|
}
|
@@ -1110,13 +1164,13 @@ rule
|
|
1110
1164
|
end
|
1111
1165
|
self.env.extend
|
1112
1166
|
}
|
1113
|
-
bodystmt
|
1167
|
+
bodystmt k_end
|
1114
1168
|
{
|
1115
1169
|
result = new_class val
|
1116
1170
|
self.env.unextend
|
1117
1171
|
self.lexer.comments # we don't care about comments in the body
|
1118
1172
|
}
|
1119
|
-
|
|
1173
|
+
| k_class tLSHFT
|
1120
1174
|
{
|
1121
1175
|
result = self.lexer.lineno
|
1122
1176
|
}
|
@@ -1131,13 +1185,13 @@ rule
|
|
1131
1185
|
self.in_single = 0
|
1132
1186
|
self.env.extend
|
1133
1187
|
}
|
1134
|
-
bodystmt
|
1188
|
+
bodystmt k_end
|
1135
1189
|
{
|
1136
1190
|
result = new_sclass val
|
1137
1191
|
self.env.unextend
|
1138
1192
|
self.lexer.comments # we don't care about comments in the body
|
1139
1193
|
}
|
1140
|
-
|
|
1194
|
+
| k_module
|
1141
1195
|
{
|
1142
1196
|
result = self.lexer.lineno
|
1143
1197
|
}
|
@@ -1149,13 +1203,13 @@ rule
|
|
1149
1203
|
|
1150
1204
|
self.env.extend
|
1151
1205
|
}
|
1152
|
-
bodystmt
|
1206
|
+
bodystmt k_end
|
1153
1207
|
{
|
1154
1208
|
result = new_module val
|
1155
1209
|
self.env.unextend
|
1156
1210
|
self.lexer.comments # we don't care about comments in the body
|
1157
1211
|
}
|
1158
|
-
|
|
1212
|
+
| k_def fname
|
1159
1213
|
{
|
1160
1214
|
result = [self.in_def, self.lexer.cmdarg.stack.dup]
|
1161
1215
|
|
@@ -1166,7 +1220,7 @@ rule
|
|
1166
1220
|
# TODO: port local_push_gen and local_pop_gen
|
1167
1221
|
lexer.cmdarg.stack.replace [false]
|
1168
1222
|
}
|
1169
|
-
f_arglist bodystmt
|
1223
|
+
f_arglist bodystmt k_end
|
1170
1224
|
{
|
1171
1225
|
in_def, cmdarg = val[2]
|
1172
1226
|
|
@@ -1177,7 +1231,7 @@ rule
|
|
1177
1231
|
self.in_def = in_def
|
1178
1232
|
self.lexer.comments # we don't care about comments in the body
|
1179
1233
|
}
|
1180
|
-
|
|
1234
|
+
| k_def singleton dot_or_colon
|
1181
1235
|
{
|
1182
1236
|
self.comments.push self.lexer.comments
|
1183
1237
|
lexer.lex_state = :expr_fname
|
@@ -1190,7 +1244,7 @@ rule
|
|
1190
1244
|
result = [lexer.lineno, self.lexer.cmdarg.stack.dup]
|
1191
1245
|
lexer.cmdarg.stack.replace [false]
|
1192
1246
|
}
|
1193
|
-
f_arglist bodystmt
|
1247
|
+
f_arglist bodystmt k_end
|
1194
1248
|
{
|
1195
1249
|
line, cmdarg = val[5]
|
1196
1250
|
result = new_defs val
|
@@ -1235,7 +1289,15 @@ rule
|
|
1235
1289
|
k_class: kCLASS
|
1236
1290
|
k_module: kMODULE
|
1237
1291
|
k_def: kDEF
|
1292
|
+
k_do: kDO
|
1293
|
+
k_do_block: kDO_BLOCK
|
1294
|
+
k_rescue: kRESCUE
|
1295
|
+
k_ensure: kENSURE
|
1296
|
+
k_when: kWHEN
|
1297
|
+
k_else: kELSE
|
1298
|
+
k_elsif: kELSIF
|
1238
1299
|
k_end: kEND
|
1300
|
+
k_return: kRETURN
|
1239
1301
|
|
1240
1302
|
then: term
|
1241
1303
|
| kTHEN
|
@@ -1245,7 +1307,7 @@ rule
|
|
1245
1307
|
| kDO_COND
|
1246
1308
|
|
1247
1309
|
if_tail: opt_else
|
1248
|
-
|
|
1310
|
+
| k_elsif expr_value then compstmt if_tail
|
1249
1311
|
{
|
1250
1312
|
result = s(:if, val[1], val[3], val[4])
|
1251
1313
|
}
|
@@ -1416,18 +1478,22 @@ opt_block_args_tail: tCOMMA block_args_tail
|
|
1416
1478
|
|
1417
1479
|
opt_block_param: none { result = 0 }
|
1418
1480
|
| block_param_def
|
1481
|
+
{
|
1482
|
+
self.lexer.command_start = true
|
1483
|
+
}
|
1419
1484
|
|
1420
1485
|
block_param_def: tPIPE opt_bv_decl tPIPE
|
1421
1486
|
{
|
1487
|
+
# TODO: current_arg = 0
|
1422
1488
|
result = args val
|
1423
1489
|
}
|
1424
1490
|
| tOROP
|
1425
1491
|
{
|
1426
|
-
self.lexer.command_start = true
|
1427
1492
|
result = s(:args)
|
1428
1493
|
}
|
1429
1494
|
| tPIPE block_param opt_bv_decl tPIPE
|
1430
1495
|
{
|
1496
|
+
# TODO: current_arg = 0
|
1431
1497
|
result = args val
|
1432
1498
|
}
|
1433
1499
|
|
@@ -1460,13 +1526,21 @@ opt_block_args_tail: tCOMMA block_args_tail
|
|
1460
1526
|
lexer.paren_nest += 1
|
1461
1527
|
lexer.lpar_beg = lexer.paren_nest
|
1462
1528
|
}
|
1463
|
-
f_larglist
|
1529
|
+
f_larglist
|
1464
1530
|
{
|
1465
|
-
|
1531
|
+
result = [lexer.cmdarg.store(false), self.lexer.lineno]
|
1532
|
+
}
|
1533
|
+
lambda_body
|
1534
|
+
{
|
1535
|
+
lpar, args, (cmdarg, lineno), body = val
|
1466
1536
|
lexer.lpar_beg = lpar
|
1467
1537
|
|
1538
|
+
lexer.cmdarg.restore cmdarg
|
1539
|
+
lexer.cmdarg.lexpop
|
1540
|
+
|
1468
1541
|
call = new_call nil, :lambda
|
1469
1542
|
result = new_iter call, args, body
|
1543
|
+
result.line = lineno
|
1470
1544
|
self.env.unextend
|
1471
1545
|
}
|
1472
1546
|
|
@@ -1484,28 +1558,15 @@ opt_block_args_tail: tCOMMA block_args_tail
|
|
1484
1558
|
{
|
1485
1559
|
result = val[1]
|
1486
1560
|
}
|
1487
|
-
| kDO_LAMBDA
|
1561
|
+
| kDO_LAMBDA bodystmt kEND
|
1488
1562
|
{
|
1489
1563
|
result = val[1]
|
1490
1564
|
}
|
1491
1565
|
|
1492
|
-
do_block:
|
1566
|
+
do_block: k_do_block do_body kEND
|
1493
1567
|
{
|
1494
|
-
|
1495
|
-
result =
|
1496
|
-
}
|
1497
|
-
opt_block_param
|
1498
|
-
{
|
1499
|
-
result = nil # self.env.dynamic.keys
|
1500
|
-
}
|
1501
|
-
compstmt kEND
|
1502
|
-
{
|
1503
|
-
args = val[2]
|
1504
|
-
body = val[4]
|
1505
|
-
result = new_iter nil, args, body
|
1506
|
-
result.line = val[1]
|
1507
|
-
|
1508
|
-
self.env.unextend
|
1568
|
+
# TODO: maybe fix lineno to kDO's lineno?
|
1569
|
+
result = val[1]
|
1509
1570
|
}
|
1510
1571
|
|
1511
1572
|
block_call: command do_block
|
@@ -1522,11 +1583,11 @@ opt_block_args_tail: tCOMMA block_args_tail
|
|
1522
1583
|
result = val[1]
|
1523
1584
|
result.insert 1, val[0]
|
1524
1585
|
}
|
1525
|
-
| block_call
|
1586
|
+
| block_call call_op2 operation2 opt_paren_args
|
1526
1587
|
{
|
1527
1588
|
result = new_call val[0], val[2].to_sym, val[3]
|
1528
1589
|
}
|
1529
|
-
| block_call
|
1590
|
+
| block_call call_op2 operation2 opt_paren_args brace_block
|
1530
1591
|
{
|
1531
1592
|
iter1, _, name, args, iter2 = val
|
1532
1593
|
|
@@ -1535,7 +1596,7 @@ opt_block_args_tail: tCOMMA block_args_tail
|
|
1535
1596
|
|
1536
1597
|
result = iter2
|
1537
1598
|
}
|
1538
|
-
| block_call
|
1599
|
+
| block_call call_op2 operation2 command_args do_block
|
1539
1600
|
{
|
1540
1601
|
iter1, _, name, args, iter2 = val
|
1541
1602
|
|
@@ -1592,39 +1653,55 @@ opt_block_args_tail: tCOMMA block_args_tail
|
|
1592
1653
|
self.env.extend :dynamic
|
1593
1654
|
result = self.lexer.lineno
|
1594
1655
|
}
|
1595
|
-
|
1596
|
-
{
|
1597
|
-
result = nil # self.env.dynamic.keys
|
1598
|
-
}
|
1599
|
-
compstmt tRCURLY
|
1656
|
+
brace_body tRCURLY
|
1600
1657
|
{
|
1601
|
-
_, line,
|
1658
|
+
_, line, body, _ = val
|
1602
1659
|
|
1603
|
-
result =
|
1660
|
+
result = body
|
1604
1661
|
result.line = line
|
1605
1662
|
|
1606
1663
|
self.env.unextend
|
1607
1664
|
}
|
1608
|
-
|
|
1665
|
+
| k_do
|
1609
1666
|
{
|
1610
1667
|
self.env.extend :dynamic
|
1611
1668
|
result = self.lexer.lineno
|
1612
1669
|
}
|
1613
|
-
|
1670
|
+
do_body kEND
|
1614
1671
|
{
|
1615
|
-
|
1672
|
+
_, line, body, _ = val
|
1673
|
+
|
1674
|
+
result = body
|
1675
|
+
result.line = line
|
1676
|
+
|
1677
|
+
self.env.unextend
|
1616
1678
|
}
|
1617
|
-
|
1679
|
+
|
1680
|
+
brace_body: { self.env.extend :dynamic; result = self.lexer.lineno }
|
1681
|
+
{ result = lexer.cmdarg.store(false) }
|
1682
|
+
opt_block_param compstmt
|
1618
1683
|
{
|
1619
|
-
|
1684
|
+
line, cmdarg, param, cmpstmt = val
|
1620
1685
|
|
1621
|
-
result =
|
1622
|
-
|
1686
|
+
result = new_brace_body param, cmpstmt, line
|
1687
|
+
self.env.unextend
|
1688
|
+
lexer.cmdarg.restore cmdarg
|
1689
|
+
lexer.cmdarg.pop # because of: cmdarg_stack >> 1 ?
|
1690
|
+
}
|
1691
|
+
|
1692
|
+
do_body: { self.env.extend :dynamic; result = self.lexer.lineno }
|
1693
|
+
{ result = lexer.cmdarg.store(false) }
|
1694
|
+
opt_block_param
|
1695
|
+
compstmt
|
1696
|
+
{
|
1697
|
+
line, cmdarg, param, cmpstmt = val
|
1623
1698
|
|
1699
|
+
result = new_do_body param, cmpstmt, line
|
1624
1700
|
self.env.unextend
|
1701
|
+
lexer.cmdarg.restore cmdarg
|
1625
1702
|
}
|
1626
1703
|
|
1627
|
-
case_body:
|
1704
|
+
case_body: k_when
|
1628
1705
|
{
|
1629
1706
|
result = self.lexer.lineno
|
1630
1707
|
}
|
@@ -1637,7 +1714,7 @@ opt_block_args_tail: tCOMMA block_args_tail
|
|
1637
1714
|
|
1638
1715
|
cases: opt_else | case_body
|
1639
1716
|
|
1640
|
-
opt_rescue:
|
1717
|
+
opt_rescue: k_rescue exc_list exc_var then compstmt opt_rescue
|
1641
1718
|
{
|
1642
1719
|
(_, line), klasses, var, _, body, rest = val
|
1643
1720
|
|
@@ -1666,7 +1743,7 @@ opt_block_args_tail: tCOMMA block_args_tail
|
|
1666
1743
|
}
|
1667
1744
|
| none
|
1668
1745
|
|
1669
|
-
opt_ensure:
|
1746
|
+
opt_ensure: k_ensure compstmt
|
1670
1747
|
{
|
1671
1748
|
_, body = val
|
1672
1749
|
|
@@ -1833,7 +1910,7 @@ regexp_contents: none
|
|
1833
1910
|
result = lexer.lex_strterm
|
1834
1911
|
|
1835
1912
|
lexer.lex_strterm = nil
|
1836
|
-
lexer.lex_state = :expr_beg
|
1913
|
+
lexer.lex_state = :expr_beg
|
1837
1914
|
}
|
1838
1915
|
string_dvar
|
1839
1916
|
{
|
@@ -1854,11 +1931,11 @@ regexp_contents: none
|
|
1854
1931
|
lexer.brace_nest = 0
|
1855
1932
|
lexer.string_nest = 0
|
1856
1933
|
|
1857
|
-
lexer.lex_state = :
|
1934
|
+
lexer.lex_state = :expr_beg
|
1858
1935
|
}
|
1859
|
-
compstmt
|
1936
|
+
compstmt
|
1937
|
+
tSTRING_DEND
|
1860
1938
|
{
|
1861
|
-
# TODO: tRCURLY -> tSTRING_DEND
|
1862
1939
|
_, memo, stmt, _ = val
|
1863
1940
|
|
1864
1941
|
lex_strterm, brace_nest, string_nest, oldcond, oldcmdarg, oldlex_state = memo
|
@@ -1981,23 +2058,18 @@ keyword_variable: kNIL { result = s(:nil) }
|
|
1981
2058
|
backref: tNTH_REF { result = s(:nth_ref, val[0]) }
|
1982
2059
|
| tBACK_REF { result = s(:back_ref, val[0]) }
|
1983
2060
|
|
1984
|
-
superclass:
|
1985
|
-
{
|
1986
|
-
result = nil
|
1987
|
-
}
|
1988
|
-
| tLT
|
2061
|
+
superclass: tLT
|
1989
2062
|
{
|
1990
2063
|
lexer.lex_state = :expr_beg
|
2064
|
+
lexer.command_start = true
|
1991
2065
|
}
|
1992
2066
|
expr_value term
|
1993
2067
|
{
|
1994
2068
|
result = val[2]
|
1995
2069
|
}
|
1996
|
-
|
|
2070
|
+
| none
|
1997
2071
|
{
|
1998
|
-
yyerrok
|
1999
2072
|
result = nil
|
2000
|
-
debug20 30, val, result
|
2001
2073
|
}
|
2002
2074
|
|
2003
2075
|
f_arglist: tLPAREN2 f_args rparen
|
@@ -2005,16 +2077,20 @@ keyword_variable: kNIL { result = s(:nil) }
|
|
2005
2077
|
result = val[1]
|
2006
2078
|
self.lexer.lex_state = :expr_beg
|
2007
2079
|
self.lexer.command_start = true
|
2008
|
-
# TODO:
|
2009
|
-
# $<num>$ = parser->parser_in_kwarg;
|
2010
|
-
# parser->parser_in_kwarg = 1;
|
2011
2080
|
}
|
2012
|
-
|
|
2081
|
+
| {
|
2082
|
+
result = self.in_kwarg
|
2083
|
+
self.in_kwarg = true
|
2084
|
+
# TODO: self.lexer.lex_state |= :expr_label
|
2085
|
+
}
|
2086
|
+
f_args term
|
2013
2087
|
{
|
2014
|
-
|
2015
|
-
|
2016
|
-
self.
|
2017
|
-
|
2088
|
+
kwarg, args, _ = val
|
2089
|
+
|
2090
|
+
self.in_kwarg = kwarg
|
2091
|
+
result = args
|
2092
|
+
lexer.lex_state = :expr_beg
|
2093
|
+
lexer.command_start = true
|
2018
2094
|
}
|
2019
2095
|
|
2020
2096
|
args_tail: f_kwarg tCOMMA f_kwrest opt_f_block_arg
|
@@ -2197,7 +2273,9 @@ keyword_variable: kNIL { result = s(:nil) }
|
|
2197
2273
|
|
2198
2274
|
f_kwrest: kwrest_mark tIDENTIFIER
|
2199
2275
|
{
|
2200
|
-
|
2276
|
+
name = val[1].to_sym
|
2277
|
+
self.assignable name
|
2278
|
+
result = :"**#{name}"
|
2201
2279
|
}
|
2202
2280
|
| kwrest_mark
|
2203
2281
|
{
|
@@ -2304,9 +2382,10 @@ keyword_variable: kNIL { result = s(:nil) }
|
|
2304
2382
|
{
|
2305
2383
|
result = s(:array, val[0], val[2])
|
2306
2384
|
}
|
2307
|
-
| tLABEL
|
2385
|
+
| tLABEL arg_value
|
2308
2386
|
{
|
2309
|
-
|
2387
|
+
(label, _), arg = val
|
2388
|
+
result = s(:array, s(:lit, label.to_sym), arg)
|
2310
2389
|
}
|
2311
2390
|
| tDSTAR arg_value
|
2312
2391
|
{
|
@@ -2318,6 +2397,10 @@ keyword_variable: kNIL { result = s(:nil) }
|
|
2318
2397
|
operation3: tIDENTIFIER | tFID | op
|
2319
2398
|
dot_or_colon: tDOT | tCOLON2
|
2320
2399
|
call_op: tDOT
|
2400
|
+
|
2401
|
+
call_op2: call_op
|
2402
|
+
| tCOLON2
|
2403
|
+
|
2321
2404
|
opt_terms: | terms
|
2322
2405
|
opt_nl: | tNL
|
2323
2406
|
rparen: opt_nl tRPAREN
|