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
@@ -34,6 +34,10 @@ class RubyLexer
|
|
34
34
|
STR_SSYM = STR_FUNC_SYMBOL
|
35
35
|
STR_DSYM = STR_FUNC_SYMBOL | STR_FUNC_EXPAND
|
36
36
|
|
37
|
+
EXPR_BEG_ANY = [:expr_beg, :expr_mid, :expr_class ]
|
38
|
+
EXPR_ARG_ANY = [:expr_arg, :expr_cmdarg, ]
|
39
|
+
EXPR_END_ANY = [:expr_end, :expr_endarg, :expr_endfn]
|
40
|
+
|
37
41
|
ESCAPES = {
|
38
42
|
"a" => "\007",
|
39
43
|
"b" => "\010",
|
@@ -77,7 +81,7 @@ class RubyLexer
|
|
77
81
|
attr_accessor :brace_nest
|
78
82
|
attr_accessor :cmdarg
|
79
83
|
attr_accessor :command_start
|
80
|
-
attr_accessor :
|
84
|
+
attr_accessor :cmd_state # temporary--ivar to avoid passing everywhere
|
81
85
|
attr_accessor :last_state
|
82
86
|
attr_accessor :cond
|
83
87
|
attr_accessor :extra_lineno
|
@@ -109,20 +113,13 @@ class RubyLexer
|
|
109
113
|
# Last token read via next_token.
|
110
114
|
attr_accessor :token
|
111
115
|
|
112
|
-
##
|
113
|
-
# What version of ruby to parse. 18 and 19 are the only valid values
|
114
|
-
# currently supported.
|
115
|
-
|
116
|
-
attr_accessor :version
|
117
|
-
|
118
116
|
attr_writer :comments
|
119
117
|
|
120
|
-
def initialize
|
121
|
-
self.version = v
|
118
|
+
def initialize _ = nil
|
122
119
|
@lex_state = :expr_none
|
123
120
|
|
124
|
-
self.cmdarg = RubyParserStuff::StackState.new(:cmdarg, $DEBUG)
|
125
121
|
self.cond = RubyParserStuff::StackState.new(:cond, $DEBUG)
|
122
|
+
self.cmdarg = RubyParserStuff::StackState.new(:cmdarg, $DEBUG)
|
126
123
|
|
127
124
|
reset
|
128
125
|
end
|
@@ -343,23 +340,30 @@ class RubyLexer
|
|
343
340
|
end
|
344
341
|
|
345
342
|
def is_arg?
|
346
|
-
in_lex_state?
|
343
|
+
in_lex_state?(*EXPR_ARG_ANY)
|
347
344
|
end
|
348
345
|
|
349
346
|
def is_beg?
|
350
|
-
in_lex_state?
|
347
|
+
# TODO: in_lex_state?(*EXPR_BEG_ANY) || lex_state == [:expr_arg, :expr_labeled]
|
348
|
+
in_lex_state?(*EXPR_BEG_ANY, :expr_value, :expr_labeled)
|
351
349
|
end
|
352
350
|
|
353
351
|
def is_end?
|
354
|
-
in_lex_state?
|
352
|
+
in_lex_state?(*EXPR_END_ANY)
|
355
353
|
end
|
356
354
|
|
355
|
+
def lvar_defined? id
|
356
|
+
# TODO: (dyna_in_block? && dvar_defined?(id)) || local_id?(id)
|
357
|
+
self.parser.env[id.to_sym] == :lvar
|
358
|
+
end
|
359
|
+
|
360
|
+
|
357
361
|
def ruby22_label?
|
358
362
|
ruby22plus? and is_label_possible?
|
359
363
|
end
|
360
364
|
|
361
365
|
def is_label_possible?
|
362
|
-
(in_lex_state?(:expr_beg, :expr_endfn) && !
|
366
|
+
(in_lex_state?(:expr_beg, :expr_endfn) && !cmd_state) || is_arg?
|
363
367
|
end
|
364
368
|
|
365
369
|
def is_label_suffix?
|
@@ -370,6 +374,10 @@ class RubyLexer
|
|
370
374
|
is_arg? and space_seen and c !~ /\s/
|
371
375
|
end
|
372
376
|
|
377
|
+
def lambda_beginning?
|
378
|
+
lpar_beg && lpar_beg == paren_nest
|
379
|
+
end
|
380
|
+
|
373
381
|
def matched
|
374
382
|
ss.matched
|
375
383
|
end
|
@@ -411,20 +419,17 @@ class RubyLexer
|
|
411
419
|
nil # TODO
|
412
420
|
end
|
413
421
|
|
414
|
-
def
|
422
|
+
def process_brace_close text
|
423
|
+
# matching compare/parse23.y:8561
|
415
424
|
cond.lexpop
|
416
425
|
cmdarg.lexpop
|
417
426
|
|
418
427
|
case matched
|
419
428
|
when "}" then
|
420
429
|
self.brace_nest -= 1
|
421
|
-
self.lex_state = :expr_endarg
|
422
|
-
|
423
|
-
# TODO
|
424
|
-
# if (c == '}') {
|
425
|
-
# if (!brace_nest--) c = tSTRING_DEND;
|
426
|
-
# }
|
430
|
+
self.lex_state = :expr_endarg # TODO: :expr_end ? Look at 2.6
|
427
431
|
|
432
|
+
return :tSTRING_DEND, matched if brace_nest < 0
|
428
433
|
return :tRCURLY, matched
|
429
434
|
when "]" then
|
430
435
|
self.paren_nest -= 1
|
@@ -463,24 +468,30 @@ class RubyLexer
|
|
463
468
|
end
|
464
469
|
end
|
465
470
|
|
466
|
-
def
|
471
|
+
def process_brace_open text
|
472
|
+
# matching compare/parse23.y:8694
|
467
473
|
self.brace_nest += 1
|
468
|
-
|
474
|
+
|
475
|
+
if lambda_beginning? then
|
469
476
|
self.lpar_beg = nil
|
470
|
-
self.paren_nest -= 1
|
477
|
+
self.paren_nest -= 1 # close arg list when lambda opens body
|
471
478
|
|
472
479
|
return expr_result(:tLAMBEG, "{")
|
473
480
|
end
|
474
481
|
|
475
|
-
token =
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
+
token = case lex_state
|
483
|
+
when :expr_labeled then
|
484
|
+
:tLBRACE # hash
|
485
|
+
when *EXPR_ARG_ANY, :expr_end, :expr_endfn then
|
486
|
+
:tLCURLY # block (primary)
|
487
|
+
when :expr_endarg
|
488
|
+
:tLBRACE_ARG # block (expr)
|
489
|
+
else
|
490
|
+
:tLBRACE # hash
|
491
|
+
end
|
482
492
|
|
483
|
-
self.
|
493
|
+
# TODO: self.lex_state |= :expr_label if token != :tLBRACE_ARG
|
494
|
+
self.command_start = true if token != :tLBRACE
|
484
495
|
|
485
496
|
return expr_result(token, "{")
|
486
497
|
end
|
@@ -519,12 +530,19 @@ class RubyLexer
|
|
519
530
|
def process_lchevron text
|
520
531
|
if (!in_lex_state?(:expr_dot, :expr_class) &&
|
521
532
|
!is_end? &&
|
522
|
-
(!is_arg? || space_seen)) then
|
533
|
+
(!is_arg? || space_seen)) then # TODO: || in_state(:expr_labeled)
|
523
534
|
tok = self.heredoc_identifier
|
524
535
|
return tok if tok
|
525
536
|
end
|
526
537
|
|
527
|
-
|
538
|
+
if in_arg_state? then
|
539
|
+
self.lex_state = :expr_arg
|
540
|
+
else
|
541
|
+
self.command_start = true if lex_state == :expr_class
|
542
|
+
self.lex_state = :expr_beg
|
543
|
+
end
|
544
|
+
|
545
|
+
return result(lex_state, :tLSHFT, "\<\<")
|
528
546
|
end
|
529
547
|
|
530
548
|
def process_newline_or_comment text
|
@@ -534,6 +552,7 @@ class RubyLexer
|
|
534
552
|
if c == '#' then
|
535
553
|
ss.pos -= 1
|
536
554
|
|
555
|
+
# TODO: handle magic comments
|
537
556
|
while scan(/\s*\#.*(\n+|\z)/) do
|
538
557
|
hit = true
|
539
558
|
self.lineno += matched.lines.to_a.size
|
@@ -548,8 +567,21 @@ class RubyLexer
|
|
548
567
|
# Replace a string of newlines with a single one
|
549
568
|
self.lineno += matched.lines.to_a.size if scan(/\n+/)
|
550
569
|
|
551
|
-
|
552
|
-
|
570
|
+
# TODO: remove :expr_value -- audit all uses of it
|
571
|
+
c = in_lex_state?(:expr_beg, :expr_value, :expr_class,
|
572
|
+
:expr_fname, :expr_dot) && !in_lex_state?(:expr_labeled)
|
573
|
+
|
574
|
+
# TODO: figure out what token_seen is for
|
575
|
+
# TODO: if c || self.lex_state == [:expr_beg, :expr_labeled] then
|
576
|
+
if c || self.lex_state == :expr_labeled then
|
577
|
+
# ignore if !fallthrough?
|
578
|
+
if !c && parser.in_kwarg then
|
579
|
+
# normal newline
|
580
|
+
return result(:expr_beg, :tNL, nil)
|
581
|
+
else
|
582
|
+
return # skip
|
583
|
+
end
|
584
|
+
end
|
553
585
|
|
554
586
|
if scan(/([\ \t\r\f\v]*)(\.|&)/) then
|
555
587
|
self.space_seen = true unless ss[1].empty?
|
@@ -569,11 +601,7 @@ class RubyLexer
|
|
569
601
|
end
|
570
602
|
|
571
603
|
def process_paren text
|
572
|
-
token =
|
573
|
-
process_paren18
|
574
|
-
else
|
575
|
-
process_paren19
|
576
|
-
end
|
604
|
+
token = process_paren19
|
577
605
|
|
578
606
|
self.paren_nest += 1
|
579
607
|
|
@@ -581,25 +609,6 @@ class RubyLexer
|
|
581
609
|
return expr_result(token, "(")
|
582
610
|
end
|
583
611
|
|
584
|
-
def process_paren18
|
585
|
-
self.command_start = true
|
586
|
-
token = :tLPAREN2
|
587
|
-
|
588
|
-
if in_lex_state? :expr_beg, :expr_mid then
|
589
|
-
token = :tLPAREN
|
590
|
-
elsif space_seen then
|
591
|
-
if in_lex_state? :expr_cmdarg then
|
592
|
-
token = :tLPAREN_ARG
|
593
|
-
elsif in_lex_state? :expr_arg then
|
594
|
-
warning "don't put space before argument parentheses"
|
595
|
-
end
|
596
|
-
else
|
597
|
-
# not a ternary -- do nothing?
|
598
|
-
end
|
599
|
-
|
600
|
-
token
|
601
|
-
end
|
602
|
-
|
603
612
|
def process_paren19
|
604
613
|
if is_beg? then
|
605
614
|
:tLPAREN
|
@@ -654,8 +663,7 @@ class RubyLexer
|
|
654
663
|
|
655
664
|
def process_questionmark text
|
656
665
|
if is_end? then
|
657
|
-
|
658
|
-
return result(state, :tEH, "?")
|
666
|
+
return result(:expr_value, :tEH, "?")
|
659
667
|
end
|
660
668
|
|
661
669
|
if end_of_stream? then
|
@@ -677,8 +685,7 @@ class RubyLexer
|
|
677
685
|
end
|
678
686
|
|
679
687
|
# ternary
|
680
|
-
|
681
|
-
return result(state, :tEH, "?")
|
688
|
+
return result(:expr_value, :tEH, "?")
|
682
689
|
elsif check(/\w(?=\w)/) then # ternary, also
|
683
690
|
return result(:expr_beg, :tEH, "?")
|
684
691
|
end
|
@@ -689,11 +696,7 @@ class RubyLexer
|
|
689
696
|
ss.getch
|
690
697
|
end
|
691
698
|
|
692
|
-
|
693
|
-
return result(:expr_end, :tINTEGER, c[0].ord & 0xff)
|
694
|
-
else
|
695
|
-
return result(:expr_end, :tSTRING, c)
|
696
|
-
end
|
699
|
+
return result(:expr_end, :tSTRING, c)
|
697
700
|
end
|
698
701
|
|
699
702
|
def process_slash text
|
@@ -742,7 +745,9 @@ class RubyLexer
|
|
742
745
|
token = :tLBRACK2
|
743
746
|
end
|
744
747
|
|
745
|
-
|
748
|
+
# TODO: this is done by expr_result except "|EXPR_LABEL")
|
749
|
+
# SET_LEX_STATE(EXPR_BEG|EXPR_LABEL);
|
750
|
+
expr_result token, "["
|
746
751
|
end
|
747
752
|
|
748
753
|
def possibly_escape_string text, check
|
@@ -758,9 +763,6 @@ class RubyLexer
|
|
758
763
|
def process_symbol text
|
759
764
|
symbol = possibly_escape_string text, /^:"/
|
760
765
|
|
761
|
-
rb_compile_error "symbol cannot contain '\\0'" if
|
762
|
-
ruby18 && symbol =~ /\0/
|
763
|
-
|
764
766
|
return result(:expr_end, :tSYMBOL, symbol)
|
765
767
|
end
|
766
768
|
|
@@ -784,11 +786,14 @@ class RubyLexer
|
|
784
786
|
def process_label text
|
785
787
|
symbol = possibly_escape_string text, /^"/
|
786
788
|
|
787
|
-
result(:
|
789
|
+
result(:expr_labeled, :tLABEL, [symbol, self.lineno]) # TODO: expr_arg|expr_labeled
|
788
790
|
end
|
789
791
|
|
790
792
|
def process_token text
|
793
|
+
# matching: parse_ident in compare/parse23.y:7989
|
791
794
|
# TODO: make this always return [token, lineno]
|
795
|
+
self.last_state = lex_state
|
796
|
+
|
792
797
|
token = self.token = text
|
793
798
|
token << matched if scan(/[\!\?](?!=)/)
|
794
799
|
|
@@ -807,36 +812,33 @@ class RubyLexer
|
|
807
812
|
:tIDENTIFIER
|
808
813
|
end
|
809
814
|
|
810
|
-
if
|
815
|
+
if is_label_possible? and is_label_suffix? then
|
811
816
|
scan(/:/)
|
812
|
-
|
817
|
+
# TODO: :expr_arg|:expr_labeled
|
818
|
+
return result :expr_labeled, :tLABEL, [token, self.lineno]
|
813
819
|
end
|
814
820
|
|
821
|
+
# TODO: mb == ENC_CODERANGE_7BIT && !in_lex_state?(:expr_dot)
|
815
822
|
unless in_lex_state? :expr_dot then
|
816
823
|
# See if it is a reserved word.
|
817
|
-
keyword =
|
818
|
-
RubyParserStuff::Keyword.keyword18 token
|
819
|
-
else
|
820
|
-
RubyParserStuff::Keyword.keyword19 token
|
821
|
-
end
|
824
|
+
keyword = RubyParserStuff::Keyword.keyword token
|
822
825
|
|
823
826
|
return process_token_keyword keyword if keyword
|
824
827
|
end # unless in_lex_state? :expr_dot
|
825
828
|
|
826
|
-
#
|
827
|
-
# if (mb == ENC_CODERANGE_7BIT && lex_state != EXPR_DOT) {
|
828
|
-
|
829
|
+
# matching: compare/parse23.y:8079
|
829
830
|
state = if is_beg? or is_arg? or in_lex_state? :expr_dot then
|
830
|
-
|
831
|
-
elsif
|
831
|
+
cmd_state ? :expr_cmdarg : :expr_arg
|
832
|
+
elsif in_lex_state? :expr_fname then
|
832
833
|
:expr_endfn
|
833
834
|
else
|
834
835
|
:expr_end
|
835
836
|
end
|
836
837
|
|
837
838
|
if not [:expr_dot, :expr_fname].include? last_state and
|
838
|
-
|
839
|
-
|
839
|
+
(tok_id == :tIDENTIFIER) and # not :expr_fname, not attrasgn
|
840
|
+
lvar_defined?(token) then
|
841
|
+
state = :expr_end # TODO: EXPR_END|EXPR_LABEL
|
840
842
|
end
|
841
843
|
|
842
844
|
token.lineno = self.lineno # yes, on a string. I know... I know...
|
@@ -845,38 +847,38 @@ class RubyLexer
|
|
845
847
|
end
|
846
848
|
|
847
849
|
def process_token_keyword keyword
|
848
|
-
|
850
|
+
# matching MIDDLE of parse_ident in compare/parse23.y:8046
|
851
|
+
state = lex_state
|
852
|
+
self.lex_state = keyword.state
|
849
853
|
|
850
854
|
value = [token, self.lineno]
|
851
855
|
|
852
|
-
|
856
|
+
return result(lex_state, keyword.id0, value) if state == :expr_fname
|
857
|
+
|
858
|
+
self.command_start = true if lex_state == :expr_beg
|
853
859
|
|
854
860
|
case
|
855
|
-
when lex_state == :expr_fname then
|
856
|
-
result(state, keyword.id0, keyword.name)
|
857
861
|
when keyword.id0 == :kDO then
|
858
862
|
case
|
859
|
-
when
|
860
|
-
self.lpar_beg = nil
|
863
|
+
when lambda_beginning? then
|
864
|
+
self.lpar_beg = nil # lambda_beginning? == FALSE in the body of "-> do ... end"
|
861
865
|
self.paren_nest -= 1
|
862
|
-
|
866
|
+
result(lex_state, :kDO_LAMBDA, value)
|
863
867
|
when cond.is_in_state then
|
864
|
-
result(
|
865
|
-
when cmdarg.is_in_state &&
|
866
|
-
result(
|
867
|
-
when
|
868
|
-
result(
|
869
|
-
when lex_state == :expr_end # eg: a -> do end do end
|
870
|
-
result(state, :kDO_BLOCK, value)
|
868
|
+
result(lex_state, :kDO_COND, value)
|
869
|
+
when cmdarg.is_in_state && state != :expr_cmdarg then
|
870
|
+
result(lex_state, :kDO_BLOCK, value)
|
871
|
+
when [:expr_beg, :expr_endarg].include?(state) then
|
872
|
+
result(lex_state, :kDO_BLOCK, value)
|
871
873
|
else
|
872
|
-
result(
|
874
|
+
result(lex_state, :kDO, value)
|
873
875
|
end
|
874
|
-
when
|
875
|
-
result(
|
876
|
+
when [:expr_beg, :expr_labeled].include?(state) then
|
877
|
+
result(lex_state, keyword.id0, value)
|
876
878
|
when keyword.id0 != keyword.id1 then
|
877
|
-
result(:expr_beg, keyword.id1, value)
|
879
|
+
result(:expr_beg, keyword.id1, value) # TODO: :expr_beg|:expr_label
|
878
880
|
else
|
879
|
-
result(
|
881
|
+
result(lex_state, keyword.id1, value)
|
880
882
|
end
|
881
883
|
end
|
882
884
|
|
@@ -982,8 +984,8 @@ class RubyLexer
|
|
982
984
|
self.token = nil
|
983
985
|
self.extra_lineno = 0
|
984
986
|
|
985
|
-
self.cmdarg.reset
|
986
987
|
self.cond.reset
|
988
|
+
self.cmdarg.reset
|
987
989
|
end
|
988
990
|
|
989
991
|
def result lex_state, token, text # :nodoc:
|
@@ -992,10 +994,6 @@ class RubyLexer
|
|
992
994
|
[token, text]
|
993
995
|
end
|
994
996
|
|
995
|
-
def ruby18
|
996
|
-
RubyParser::V18 === parser
|
997
|
-
end
|
998
|
-
|
999
997
|
def scan re
|
1000
998
|
ss.scan re
|
1001
999
|
end
|
@@ -1133,11 +1131,7 @@ class RubyLexer
|
|
1133
1131
|
t = Regexp.escape term
|
1134
1132
|
x = Regexp.escape(paren) if paren && paren != "\000"
|
1135
1133
|
re = if qwords then
|
1136
|
-
|
1137
|
-
/[^#{t}#{x}\#\0\\\s]+|./ # |. to pick up whatever
|
1138
|
-
else
|
1139
|
-
/[^#{t}#{x}\#\0\\\s\v]+|./ # argh. 1.8's \s doesn't pick up \v
|
1140
|
-
end
|
1134
|
+
/[^#{t}#{x}\#\0\\\s]+|./ # |. to pick up whatever
|
1141
1135
|
else
|
1142
1136
|
/[^#{t}#{x}\#\0\\]+|./
|
1143
1137
|
end
|
@@ -1201,6 +1195,7 @@ class RubyLexer
|
|
1201
1195
|
end
|
1202
1196
|
|
1203
1197
|
def process_string # TODO: rewrite / remove
|
1198
|
+
# matches top of parser_yylex in compare/parse23.y:8113
|
1204
1199
|
token = if lex_strterm[0] == :heredoc then
|
1205
1200
|
self.heredoc lex_strterm
|
1206
1201
|
else
|
@@ -1209,6 +1204,7 @@ class RubyLexer
|
|
1209
1204
|
|
1210
1205
|
token_type, c = token
|
1211
1206
|
|
1207
|
+
# matches parser_string_term
|
1212
1208
|
if ruby22plus? && token_type == :tSTRING_END && ["'", '"'].include?(c) then
|
1213
1209
|
if (([:expr_beg, :expr_endfn].include?(lex_state) &&
|
1214
1210
|
!cond.is_in_state) || is_arg?) &&
|
@@ -1220,7 +1216,8 @@ class RubyLexer
|
|
1220
1216
|
|
1221
1217
|
if [:tSTRING_END, :tREGEXP_END, :tLABEL_END].include? token_type then
|
1222
1218
|
self.lex_strterm = nil
|
1223
|
-
|
1219
|
+
# TODO: :expr_beg|:expr_label
|
1220
|
+
self.lex_state = (token_type == :tLABEL_END) ? :expr_label : :expr_end
|
1224
1221
|
end
|
1225
1222
|
|
1226
1223
|
return token
|
@@ -1326,6 +1323,7 @@ class RubyLexer
|
|
1326
1323
|
# TODO: !ISASCII
|
1327
1324
|
return :tSTRING_DVAR, nil
|
1328
1325
|
when scan(/#[{]/) then
|
1326
|
+
self.command_start = true
|
1329
1327
|
return :tSTRING_DBEG, nil
|
1330
1328
|
when scan(/#/) then
|
1331
1329
|
string_buffer << '#'
|