brakeman 5.2.1 → 5.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +21 -0
- data/bundle/load.rb +4 -4
- data/bundle/ruby/2.7.0/gems/{parallel-1.21.0 → parallel-1.22.1}/MIT-LICENSE.txt +0 -0
- data/bundle/ruby/2.7.0/gems/{parallel-1.21.0 → parallel-1.22.1}/lib/parallel/processor_count.rb +2 -3
- data/bundle/ruby/2.7.0/gems/parallel-1.22.1/lib/parallel/version.rb +4 -0
- data/bundle/ruby/2.7.0/gems/{parallel-1.21.0 → parallel-1.22.1}/lib/parallel.rb +84 -4
- data/bundle/ruby/2.7.0/gems/{ruby_parser-3.18.1 → ruby_parser-3.19.1}/History.rdoc +28 -0
- data/bundle/ruby/2.7.0/gems/{ruby_parser-3.18.1 → ruby_parser-3.19.1}/Manifest.txt +2 -0
- data/bundle/ruby/2.7.0/gems/{ruby_parser-3.18.1 → ruby_parser-3.19.1}/README.rdoc +8 -6
- data/bundle/ruby/2.7.0/gems/{ruby_parser-3.18.1 → ruby_parser-3.19.1}/compare/normalize.rb +0 -0
- data/bundle/ruby/2.7.0/gems/{ruby_parser-3.18.1 → ruby_parser-3.19.1}/debugging.md +0 -0
- data/bundle/ruby/2.7.0/gems/{ruby_parser-3.18.1 → ruby_parser-3.19.1}/gauntlet.md +19 -18
- data/bundle/ruby/2.7.0/gems/{ruby_parser-3.18.1 → ruby_parser-3.19.1}/lib/rp_extensions.rb +0 -0
- data/bundle/ruby/2.7.0/gems/{ruby_parser-3.18.1 → ruby_parser-3.19.1}/lib/rp_stringscanner.rb +0 -0
- data/bundle/ruby/2.7.0/gems/ruby_parser-3.19.1/lib/ruby20_parser.rb +10973 -0
- data/bundle/ruby/2.7.0/gems/{ruby_parser-3.18.1 → ruby_parser-3.19.1}/lib/ruby20_parser.y +14 -27
- data/bundle/ruby/2.7.0/gems/ruby_parser-3.19.1/lib/ruby21_parser.rb +10980 -0
- data/bundle/ruby/2.7.0/gems/{ruby_parser-3.18.1 → ruby_parser-3.19.1}/lib/ruby21_parser.y +14 -27
- data/bundle/ruby/2.7.0/gems/ruby_parser-3.19.1/lib/ruby22_parser.rb +11123 -0
- data/bundle/ruby/2.7.0/gems/{ruby_parser-3.18.1 → ruby_parser-3.19.1}/lib/ruby22_parser.y +14 -27
- data/bundle/ruby/2.7.0/gems/ruby_parser-3.19.1/lib/ruby23_parser.rb +11132 -0
- data/bundle/ruby/2.7.0/gems/{ruby_parser-3.18.1 → ruby_parser-3.19.1}/lib/ruby23_parser.y +14 -27
- data/bundle/ruby/2.7.0/gems/ruby_parser-3.19.1/lib/ruby24_parser.rb +11231 -0
- data/bundle/ruby/2.7.0/gems/{ruby_parser-3.18.1 → ruby_parser-3.19.1}/lib/ruby24_parser.y +14 -27
- data/bundle/ruby/2.7.0/gems/ruby_parser-3.19.1/lib/ruby25_parser.rb +11231 -0
- data/bundle/ruby/2.7.0/gems/{ruby_parser-3.18.1 → ruby_parser-3.19.1}/lib/ruby25_parser.y +14 -27
- data/bundle/ruby/2.7.0/gems/ruby_parser-3.19.1/lib/ruby26_parser.rb +11253 -0
- data/bundle/ruby/2.7.0/gems/{ruby_parser-3.18.1 → ruby_parser-3.19.1}/lib/ruby26_parser.y +14 -27
- data/bundle/ruby/2.7.0/gems/ruby_parser-3.19.1/lib/ruby27_parser.rb +12980 -0
- data/bundle/ruby/2.7.0/gems/{ruby_parser-3.18.1 → ruby_parser-3.19.1}/lib/ruby27_parser.y +19 -41
- data/bundle/ruby/2.7.0/gems/ruby_parser-3.19.1/lib/ruby30_parser.rb +13242 -0
- data/bundle/ruby/2.7.0/gems/{ruby_parser-3.18.1 → ruby_parser-3.19.1}/lib/ruby30_parser.y +65 -90
- data/bundle/ruby/2.7.0/gems/ruby_parser-3.19.1/lib/ruby31_parser.rb +13622 -0
- data/bundle/ruby/2.7.0/gems/{ruby_parser-3.18.1/lib/ruby3_parser.yy → ruby_parser-3.19.1/lib/ruby31_parser.y} +110 -105
- data/bundle/ruby/2.7.0/gems/ruby_parser-3.19.1/lib/ruby3_parser.yy +3536 -0
- data/bundle/ruby/2.7.0/gems/{ruby_parser-3.18.1 → ruby_parser-3.19.1}/lib/ruby_lexer.rb +0 -0
- data/bundle/ruby/2.7.0/gems/{ruby_parser-3.18.1 → ruby_parser-3.19.1}/lib/ruby_lexer.rex +0 -0
- data/bundle/ruby/2.7.0/gems/{ruby_parser-3.18.1 → ruby_parser-3.19.1}/lib/ruby_lexer.rex.rb +0 -0
- data/bundle/ruby/2.7.0/gems/{ruby_parser-3.18.1 → ruby_parser-3.19.1}/lib/ruby_lexer_strings.rb +0 -0
- data/bundle/ruby/2.7.0/gems/{ruby_parser-3.18.1 → ruby_parser-3.19.1}/lib/ruby_parser.rb +2 -0
- data/bundle/ruby/2.7.0/gems/{ruby_parser-3.18.1 → ruby_parser-3.19.1}/lib/ruby_parser.yy +19 -41
- data/bundle/ruby/2.7.0/gems/{ruby_parser-3.18.1 → ruby_parser-3.19.1}/lib/ruby_parser_extras.rb +55 -2
- data/bundle/ruby/2.7.0/gems/{ruby_parser-3.18.1 → ruby_parser-3.19.1}/tools/munge.rb +0 -0
- data/bundle/ruby/2.7.0/gems/{ruby_parser-3.18.1 → ruby_parser-3.19.1}/tools/ripper.rb +0 -0
- data/bundle/ruby/2.7.0/gems/{sexp_processor-4.16.0 → sexp_processor-4.16.1}/History.rdoc +6 -0
- data/bundle/ruby/2.7.0/gems/{sexp_processor-4.16.0 → sexp_processor-4.16.1}/Manifest.txt +0 -0
- data/bundle/ruby/2.7.0/gems/{sexp_processor-4.16.0 → sexp_processor-4.16.1}/README.rdoc +0 -0
- data/bundle/ruby/2.7.0/gems/{sexp_processor-4.16.0 → sexp_processor-4.16.1}/lib/composite_sexp_processor.rb +0 -0
- data/bundle/ruby/2.7.0/gems/{sexp_processor-4.16.0 → sexp_processor-4.16.1}/lib/pt_testcase.rb +7 -3
- data/bundle/ruby/2.7.0/gems/{sexp_processor-4.16.0 → sexp_processor-4.16.1}/lib/sexp.rb +0 -0
- data/bundle/ruby/2.7.0/gems/{sexp_processor-4.16.0 → sexp_processor-4.16.1}/lib/sexp_matcher.rb +0 -0
- data/bundle/ruby/2.7.0/gems/{sexp_processor-4.16.0 → sexp_processor-4.16.1}/lib/sexp_processor.rb +1 -1
- data/bundle/ruby/2.7.0/gems/{sexp_processor-4.16.0 → sexp_processor-4.16.1}/lib/strict_sexp.rb +0 -0
- data/bundle/ruby/2.7.0/gems/{sexp_processor-4.16.0 → sexp_processor-4.16.1}/lib/unique.rb +0 -0
- data/bundle/ruby/2.7.0/gems/{tilt-2.0.10 → tilt-2.0.11}/COPYING +0 -0
- data/bundle/ruby/2.7.0/gems/{tilt-2.0.10 → tilt-2.0.11}/lib/tilt/asciidoc.rb +0 -0
- data/bundle/ruby/2.7.0/gems/{tilt-2.0.10 → tilt-2.0.11}/lib/tilt/babel.rb +0 -0
- data/bundle/ruby/2.7.0/gems/{tilt-2.0.10 → tilt-2.0.11}/lib/tilt/bluecloth.rb +0 -0
- data/bundle/ruby/2.7.0/gems/{tilt-2.0.10 → tilt-2.0.11}/lib/tilt/builder.rb +0 -0
- data/bundle/ruby/2.7.0/gems/{tilt-2.0.10 → tilt-2.0.11}/lib/tilt/coffee.rb +0 -0
- data/bundle/ruby/2.7.0/gems/{tilt-2.0.10 → tilt-2.0.11}/lib/tilt/commonmarker.rb +11 -1
- data/bundle/ruby/2.7.0/gems/{tilt-2.0.10 → tilt-2.0.11}/lib/tilt/creole.rb +0 -0
- data/bundle/ruby/2.7.0/gems/{tilt-2.0.10 → tilt-2.0.11}/lib/tilt/csv.rb +1 -1
- data/bundle/ruby/2.7.0/gems/{tilt-2.0.10 → tilt-2.0.11}/lib/tilt/dummy.rb +0 -0
- data/bundle/ruby/2.7.0/gems/{tilt-2.0.10 → tilt-2.0.11}/lib/tilt/erb.rb +0 -0
- data/bundle/ruby/2.7.0/gems/{tilt-2.0.10 → tilt-2.0.11}/lib/tilt/erubi.rb +0 -0
- data/bundle/ruby/2.7.0/gems/{tilt-2.0.10 → tilt-2.0.11}/lib/tilt/erubis.rb +0 -0
- data/bundle/ruby/2.7.0/gems/{tilt-2.0.10 → tilt-2.0.11}/lib/tilt/etanni.rb +0 -0
- data/bundle/ruby/2.7.0/gems/{tilt-2.0.10 → tilt-2.0.11}/lib/tilt/haml.rb +0 -0
- data/bundle/ruby/2.7.0/gems/{tilt-2.0.10 → tilt-2.0.11}/lib/tilt/kramdown.rb +0 -0
- data/bundle/ruby/2.7.0/gems/{tilt-2.0.10 → tilt-2.0.11}/lib/tilt/less.rb +0 -0
- data/bundle/ruby/2.7.0/gems/{tilt-2.0.10 → tilt-2.0.11}/lib/tilt/liquid.rb +0 -0
- data/bundle/ruby/2.7.0/gems/{tilt-2.0.10 → tilt-2.0.11}/lib/tilt/livescript.rb +0 -0
- data/bundle/ruby/2.7.0/gems/{tilt-2.0.10 → tilt-2.0.11}/lib/tilt/mapping.rb +0 -0
- data/bundle/ruby/2.7.0/gems/{tilt-2.0.10 → tilt-2.0.11}/lib/tilt/markaby.rb +0 -0
- data/bundle/ruby/2.7.0/gems/{tilt-2.0.10 → tilt-2.0.11}/lib/tilt/maruku.rb +0 -0
- data/bundle/ruby/2.7.0/gems/{tilt-2.0.10 → tilt-2.0.11}/lib/tilt/nokogiri.rb +0 -0
- data/bundle/ruby/2.7.0/gems/{tilt-2.0.10 → tilt-2.0.11}/lib/tilt/pandoc.rb +23 -15
- data/bundle/ruby/2.7.0/gems/{tilt-2.0.10 → tilt-2.0.11}/lib/tilt/plain.rb +0 -0
- data/bundle/ruby/2.7.0/gems/{tilt-2.0.10 → tilt-2.0.11}/lib/tilt/prawn.rb +0 -0
- data/bundle/ruby/2.7.0/gems/{tilt-2.0.10 → tilt-2.0.11}/lib/tilt/radius.rb +0 -0
- data/bundle/ruby/2.7.0/gems/{tilt-2.0.10 → tilt-2.0.11}/lib/tilt/rdiscount.rb +0 -0
- data/bundle/ruby/2.7.0/gems/{tilt-2.0.10 → tilt-2.0.11}/lib/tilt/rdoc.rb +0 -0
- data/bundle/ruby/2.7.0/gems/{tilt-2.0.10 → tilt-2.0.11}/lib/tilt/redcarpet.rb +5 -2
- data/bundle/ruby/2.7.0/gems/{tilt-2.0.10 → tilt-2.0.11}/lib/tilt/redcloth.rb +0 -0
- data/bundle/ruby/2.7.0/gems/tilt-2.0.11/lib/tilt/rst-pandoc.rb +23 -0
- data/bundle/ruby/2.7.0/gems/tilt-2.0.11/lib/tilt/sass.rb +78 -0
- data/bundle/ruby/2.7.0/gems/{tilt-2.0.10 → tilt-2.0.11}/lib/tilt/sigil.rb +0 -0
- data/bundle/ruby/2.7.0/gems/{tilt-2.0.10 → tilt-2.0.11}/lib/tilt/string.rb +0 -0
- data/bundle/ruby/2.7.0/gems/{tilt-2.0.10 → tilt-2.0.11}/lib/tilt/template.rb +12 -1
- data/bundle/ruby/2.7.0/gems/{tilt-2.0.10 → tilt-2.0.11}/lib/tilt/typescript.rb +0 -0
- data/bundle/ruby/2.7.0/gems/{tilt-2.0.10 → tilt-2.0.11}/lib/tilt/wikicloth.rb +0 -0
- data/bundle/ruby/2.7.0/gems/{tilt-2.0.10 → tilt-2.0.11}/lib/tilt/yajl.rb +0 -0
- data/bundle/ruby/2.7.0/gems/{tilt-2.0.10 → tilt-2.0.11}/lib/tilt.rb +2 -1
- data/lib/brakeman/app_tree.rb +9 -1
- data/lib/brakeman/checks/check_basic_auth.rb +4 -2
- data/lib/brakeman/checks/check_basic_auth_timing_attack.rb +2 -1
- data/lib/brakeman/checks/check_content_tag.rb +8 -4
- data/lib/brakeman/checks/check_cookie_serialization.rb +2 -1
- data/lib/brakeman/checks/check_create_with.rb +4 -2
- data/lib/brakeman/checks/check_cross_site_scripting.rb +6 -3
- data/lib/brakeman/checks/check_csrf_token_forgery_cve.rb +2 -1
- data/lib/brakeman/checks/check_default_routes.rb +6 -3
- data/lib/brakeman/checks/check_deserialize.rb +2 -1
- data/lib/brakeman/checks/check_detailed_exceptions.rb +4 -2
- data/lib/brakeman/checks/check_digest_dos.rb +2 -1
- data/lib/brakeman/checks/check_divide_by_zero.rb +2 -1
- data/lib/brakeman/checks/check_dynamic_finders.rb +2 -1
- data/lib/brakeman/checks/check_escape_function.rb +2 -1
- data/lib/brakeman/checks/check_evaluation.rb +2 -1
- data/lib/brakeman/checks/check_execute.rb +6 -3
- data/lib/brakeman/checks/check_file_access.rb +2 -1
- data/lib/brakeman/checks/check_file_disclosure.rb +2 -1
- data/lib/brakeman/checks/check_filter_skipping.rb +2 -1
- data/lib/brakeman/checks/check_force_ssl.rb +2 -1
- data/lib/brakeman/checks/check_forgery_setting.rb +4 -2
- data/lib/brakeman/checks/check_header_dos.rb +2 -1
- data/lib/brakeman/checks/check_i18n_xss.rb +2 -1
- data/lib/brakeman/checks/check_jruby_xml.rb +2 -1
- data/lib/brakeman/checks/check_json_encoding.rb +2 -1
- data/lib/brakeman/checks/check_json_entity_escape.rb +4 -2
- data/lib/brakeman/checks/check_json_parsing.rb +4 -2
- data/lib/brakeman/checks/check_link_to.rb +2 -1
- data/lib/brakeman/checks/check_link_to_href.rb +4 -2
- data/lib/brakeman/checks/check_mail_to.rb +2 -1
- data/lib/brakeman/checks/check_mass_assignment.rb +6 -3
- data/lib/brakeman/checks/check_mime_type_dos.rb +2 -1
- data/lib/brakeman/checks/check_model_attr_accessible.rb +2 -1
- data/lib/brakeman/checks/check_model_attributes.rb +4 -2
- data/lib/brakeman/checks/check_model_serialize.rb +2 -1
- data/lib/brakeman/checks/check_nested_attributes.rb +2 -1
- data/lib/brakeman/checks/check_nested_attributes_bypass.rb +2 -1
- data/lib/brakeman/checks/check_number_to_currency.rb +4 -2
- data/lib/brakeman/checks/check_page_caching_cve.rb +2 -1
- data/lib/brakeman/checks/check_permit_attributes.rb +2 -1
- data/lib/brakeman/checks/check_quote_table_name.rb +2 -1
- data/lib/brakeman/checks/check_redirect.rb +2 -1
- data/lib/brakeman/checks/check_regex_dos.rb +2 -1
- data/lib/brakeman/checks/check_render.rb +4 -2
- data/lib/brakeman/checks/check_render_dos.rb +2 -1
- data/lib/brakeman/checks/check_render_inline.rb +4 -2
- data/lib/brakeman/checks/check_response_splitting.rb +2 -1
- data/lib/brakeman/checks/check_reverse_tabnabbing.rb +2 -1
- data/lib/brakeman/checks/check_route_dos.rb +2 -1
- data/lib/brakeman/checks/check_safe_buffer_manipulation.rb +2 -1
- data/lib/brakeman/checks/check_sanitize_config_cve.rb +120 -0
- data/lib/brakeman/checks/check_sanitize_methods.rb +6 -3
- data/lib/brakeman/checks/check_secrets.rb +2 -1
- data/lib/brakeman/checks/check_select_tag.rb +2 -1
- data/lib/brakeman/checks/check_select_vulnerability.rb +2 -1
- data/lib/brakeman/checks/check_send.rb +2 -1
- data/lib/brakeman/checks/check_session_manipulation.rb +2 -1
- data/lib/brakeman/checks/check_session_settings.rb +6 -3
- data/lib/brakeman/checks/check_simple_format.rb +4 -2
- data/lib/brakeman/checks/check_single_quotes.rb +2 -1
- data/lib/brakeman/checks/check_skip_before_filter.rb +4 -2
- data/lib/brakeman/checks/check_sprockets_path_traversal.rb +2 -1
- data/lib/brakeman/checks/check_sql.rb +7 -4
- data/lib/brakeman/checks/check_sql_cves.rb +4 -2
- data/lib/brakeman/checks/check_ssl_verify.rb +2 -1
- data/lib/brakeman/checks/check_strip_tags.rb +6 -3
- data/lib/brakeman/checks/check_symbol_dos.rb +2 -1
- data/lib/brakeman/checks/check_symbol_dos_cve.rb +2 -1
- data/lib/brakeman/checks/check_template_injection.rb +2 -1
- data/lib/brakeman/checks/check_translate_bug.rb +2 -1
- data/lib/brakeman/checks/check_unsafe_reflection.rb +9 -3
- data/lib/brakeman/checks/check_unsafe_reflection_methods.rb +2 -1
- data/lib/brakeman/checks/check_unscoped_find.rb +2 -1
- data/lib/brakeman/checks/check_validation_regex.rb +2 -1
- data/lib/brakeman/checks/check_verb_confusion.rb +2 -1
- data/lib/brakeman/checks/check_weak_hash.rb +6 -3
- data/lib/brakeman/checks/check_without_protection.rb +2 -1
- data/lib/brakeman/checks/check_xml_dos.rb +2 -1
- data/lib/brakeman/checks/check_yaml_parsing.rb +4 -2
- data/lib/brakeman/checks/eol_check.rb +4 -2
- data/lib/brakeman/options.rb +1 -1
- data/lib/brakeman/processors/alias_processor.rb +41 -2
- data/lib/brakeman/processors/lib/find_all_calls.rb +1 -0
- data/lib/brakeman/report/ignore/interactive.rb +2 -2
- data/lib/brakeman/report/report_csv.rb +2 -0
- data/lib/brakeman/report/report_junit.rb +2 -2
- data/lib/brakeman/report/report_table.rb +5 -5
- data/lib/brakeman/report/report_text.rb +2 -0
- data/lib/brakeman/report/templates/controller_warnings.html.erb +2 -0
- data/lib/brakeman/report/templates/ignored_warnings.html.erb +2 -0
- data/lib/brakeman/report/templates/model_warnings.html.erb +2 -0
- data/lib/brakeman/report/templates/security_warnings.html.erb +2 -0
- data/lib/brakeman/report/templates/view_warnings.html.erb +2 -0
- data/lib/brakeman/version.rb +1 -1
- data/lib/brakeman/warning.rb +5 -2
- data/lib/brakeman/warning_codes.rb +1 -0
- metadata +95 -92
- data/bundle/ruby/2.7.0/gems/parallel-1.21.0/lib/parallel/version.rb +0 -4
- data/bundle/ruby/2.7.0/gems/ruby_parser-3.18.1/lib/ruby20_parser.rb +0 -7128
- data/bundle/ruby/2.7.0/gems/ruby_parser-3.18.1/lib/ruby21_parser.rb +0 -7182
- data/bundle/ruby/2.7.0/gems/ruby_parser-3.18.1/lib/ruby22_parser.rb +0 -7228
- data/bundle/ruby/2.7.0/gems/ruby_parser-3.18.1/lib/ruby23_parser.rb +0 -7237
- data/bundle/ruby/2.7.0/gems/ruby_parser-3.18.1/lib/ruby24_parser.rb +0 -7268
- data/bundle/ruby/2.7.0/gems/ruby_parser-3.18.1/lib/ruby25_parser.rb +0 -7268
- data/bundle/ruby/2.7.0/gems/ruby_parser-3.18.1/lib/ruby26_parser.rb +0 -7287
- data/bundle/ruby/2.7.0/gems/ruby_parser-3.18.1/lib/ruby27_parser.rb +0 -8517
- data/bundle/ruby/2.7.0/gems/ruby_parser-3.18.1/lib/ruby30_parser.rb +0 -8751
- data/bundle/ruby/2.7.0/gems/tilt-2.0.10/lib/tilt/rst-pandoc.rb +0 -18
- data/bundle/ruby/2.7.0/gems/tilt-2.0.10/lib/tilt/sass.rb +0 -52
@@ -80,7 +80,7 @@ rule
|
|
80
80
|
| klBEGIN
|
81
81
|
{
|
82
82
|
if (self.in_def || self.in_single > 0) then
|
83
|
-
debug
|
83
|
+
debug 1
|
84
84
|
yyerror "BEGIN in method"
|
85
85
|
end
|
86
86
|
self.env.extend
|
@@ -135,7 +135,7 @@ rule
|
|
135
135
|
| error stmt
|
136
136
|
{
|
137
137
|
result = val[1]
|
138
|
-
debug
|
138
|
+
debug 2
|
139
139
|
}
|
140
140
|
|
141
141
|
stmt_or_begin: stmt
|
@@ -207,7 +207,7 @@ rule
|
|
207
207
|
(_, line), _, stmt, _ = val
|
208
208
|
|
209
209
|
if (self.in_def || self.in_single > 0) then
|
210
|
-
debug
|
210
|
+
debug 3
|
211
211
|
yyerror "END in method; use at_exit"
|
212
212
|
end
|
213
213
|
|
@@ -675,7 +675,7 @@ rule
|
|
675
675
|
| primary_value tCOLON2 tCONSTANT
|
676
676
|
{
|
677
677
|
if (self.in_def || self.in_single > 0) then
|
678
|
-
debug
|
678
|
+
debug 4
|
679
679
|
yyerror "dynamic constant assignment"
|
680
680
|
end
|
681
681
|
|
@@ -687,7 +687,7 @@ rule
|
|
687
687
|
| tCOLON3 tCONSTANT
|
688
688
|
{
|
689
689
|
if (self.in_def || self.in_single > 0) then
|
690
|
-
debug
|
690
|
+
debug 5
|
691
691
|
yyerror "dynamic constant assignment"
|
692
692
|
end
|
693
693
|
|
@@ -714,7 +714,7 @@ rule
|
|
714
714
|
|
715
715
|
result = self.assignable var
|
716
716
|
|
717
|
-
debug
|
717
|
+
debug 6
|
718
718
|
}
|
719
719
|
| primary_value tLBRACK2 opt_call_args rbracket
|
720
720
|
{
|
@@ -745,7 +745,7 @@ rule
|
|
745
745
|
expr, _, (id, _line) = val
|
746
746
|
|
747
747
|
if (self.in_def || self.in_single > 0) then
|
748
|
-
debug
|
748
|
+
debug 7
|
749
749
|
yyerror "dynamic constant assignment"
|
750
750
|
end
|
751
751
|
|
@@ -757,7 +757,7 @@ rule
|
|
757
757
|
_, (id, l) = val
|
758
758
|
|
759
759
|
if (self.in_def || self.in_single > 0) then
|
760
|
-
debug
|
760
|
+
debug 8
|
761
761
|
yyerror "dynamic constant assignment"
|
762
762
|
end
|
763
763
|
|
@@ -776,8 +776,7 @@ rule
|
|
776
776
|
|
777
777
|
cpath: tCOLON3 cname
|
778
778
|
{
|
779
|
-
|
780
|
-
result = s(:colon3, name.to_sym).line line
|
779
|
+
result = wrap :colon3, val[1]
|
781
780
|
}
|
782
781
|
| cname
|
783
782
|
{
|
@@ -802,9 +801,7 @@ rule
|
|
802
801
|
|
803
802
|
fitem: fname
|
804
803
|
{
|
805
|
-
|
806
|
-
|
807
|
-
result = s(:lit, id.to_sym).line line
|
804
|
+
result = wrap :lit, val[0]
|
808
805
|
}
|
809
806
|
| symbol
|
810
807
|
|
@@ -873,9 +870,9 @@ rule
|
|
873
870
|
}
|
874
871
|
| tCOLON3 tCONSTANT tOP_ASGN arg_rhs
|
875
872
|
{
|
876
|
-
_,
|
873
|
+
_, lhs, op, rhs = val
|
877
874
|
|
878
|
-
lhs =
|
875
|
+
lhs = wrap :colon3, lhs
|
879
876
|
result = new_const_op_asgn [lhs, op, rhs]
|
880
877
|
}
|
881
878
|
| backref tOP_ASGN arg_rhs
|
@@ -958,8 +955,8 @@ rule
|
|
958
955
|
}
|
959
956
|
| tUMINUS_NUM simple_numeric tPOW arg
|
960
957
|
{
|
961
|
-
_,
|
962
|
-
lit =
|
958
|
+
_, num, _, arg = val
|
959
|
+
lit = wrap :lit, num
|
963
960
|
result = new_call(new_call(lit, :"**", argl(arg)), :"-@")
|
964
961
|
|
965
962
|
}
|
@@ -1052,46 +1049,19 @@ rule
|
|
1052
1049
|
}
|
1053
1050
|
| defn_head f_opt_paren_args tEQL arg
|
1054
1051
|
{
|
1055
|
-
|
1056
|
-
|
1057
|
-
result = s(:defn, name, args, body).line line
|
1058
|
-
|
1059
|
-
local_pop in_def
|
1060
|
-
endless_method_name result
|
1052
|
+
result = new_endless_defn val
|
1061
1053
|
}
|
1062
1054
|
| defn_head f_opt_paren_args tEQL arg kRESCUE_MOD arg
|
1063
1055
|
{
|
1064
|
-
|
1065
|
-
|
1066
|
-
result = s(:defn, name, args,
|
1067
|
-
new_rescue(body,
|
1068
|
-
new_resbody(s(:array).line(line),
|
1069
|
-
resbody))).line line
|
1070
|
-
|
1071
|
-
local_pop in_def
|
1072
|
-
endless_method_name result
|
1056
|
+
result = new_endless_defn val
|
1073
1057
|
}
|
1074
1058
|
| defs_head f_opt_paren_args tEQL arg
|
1075
1059
|
{
|
1076
|
-
|
1077
|
-
|
1078
|
-
result = s(:defs, recv, name, args, body).line(line)
|
1079
|
-
|
1080
|
-
self.in_single -= 1
|
1081
|
-
local_pop in_def
|
1082
|
-
endless_method_name result
|
1060
|
+
result = new_endless_defs val
|
1083
1061
|
}
|
1084
1062
|
| defs_head f_opt_paren_args tEQL arg kRESCUE_MOD arg
|
1085
1063
|
{
|
1086
|
-
|
1087
|
-
|
1088
|
-
result = s(:defs, recv, name, args,
|
1089
|
-
new_rescue(body,
|
1090
|
-
new_resbody(s(:array).line(line),
|
1091
|
-
resbody))).line line
|
1092
|
-
|
1093
|
-
local_pop in_def
|
1094
|
-
endless_method_name result
|
1064
|
+
result = new_endless_defs val
|
1095
1065
|
}
|
1096
1066
|
| primary
|
1097
1067
|
|
@@ -1366,9 +1336,7 @@ rule
|
|
1366
1336
|
}
|
1367
1337
|
| tCOLON3 tCONSTANT
|
1368
1338
|
{
|
1369
|
-
|
1370
|
-
|
1371
|
-
result = s(:colon3, id.to_sym).line line
|
1339
|
+
result = wrap :colon3, val[1]
|
1372
1340
|
}
|
1373
1341
|
| tLBRACK { result = lexer.lineno } aref_args tRBRACK
|
1374
1342
|
{
|
@@ -1421,7 +1389,7 @@ rule
|
|
1421
1389
|
}
|
1422
1390
|
| kNOT tLPAREN2 rparen
|
1423
1391
|
{
|
1424
|
-
debug
|
1392
|
+
debug 9
|
1425
1393
|
}
|
1426
1394
|
| fcall brace_block
|
1427
1395
|
{
|
@@ -1731,6 +1699,7 @@ rule
|
|
1731
1699
|
f_any_kwrest: f_kwrest
|
1732
1700
|
| f_no_kwarg
|
1733
1701
|
|
1702
|
+
|
1734
1703
|
block_args_tail: f_block_kwarg tCOMMA f_kwrest opt_f_block_arg
|
1735
1704
|
{
|
1736
1705
|
result = call_args val
|
@@ -1861,8 +1830,7 @@ opt_block_args_tail: tCOMMA block_args_tail
|
|
1861
1830
|
|
1862
1831
|
bvar: tIDENTIFIER
|
1863
1832
|
{
|
1864
|
-
|
1865
|
-
result = s(:shadow, id.to_sym).line line
|
1833
|
+
result = wrap :shadow, val[0]
|
1866
1834
|
}
|
1867
1835
|
| f_bad_arg
|
1868
1836
|
|
@@ -2476,7 +2444,7 @@ opt_block_args_tail: tCOMMA block_args_tail
|
|
2476
2444
|
assignable [lhs.value, lhs.line]
|
2477
2445
|
else
|
2478
2446
|
# TODO or done?
|
2479
|
-
debug
|
2447
|
+
debug 10
|
2480
2448
|
end
|
2481
2449
|
|
2482
2450
|
# TODO PAIR -> LIST ?
|
@@ -2485,9 +2453,7 @@ opt_block_args_tail: tCOMMA block_args_tail
|
|
2485
2453
|
|
2486
2454
|
p_kw_label: tLABEL
|
2487
2455
|
{
|
2488
|
-
|
2489
|
-
|
2490
|
-
result = s(:lit, id.to_sym).line line
|
2456
|
+
result = wrap :lit, val[0]
|
2491
2457
|
}
|
2492
2458
|
|
2493
2459
|
p_kwrest: kwrest_mark tIDENTIFIER
|
@@ -2582,26 +2548,21 @@ opt_block_args_tail: tCOMMA block_args_tail
|
|
2582
2548
|
|
2583
2549
|
p_variable: tIDENTIFIER
|
2584
2550
|
{
|
2585
|
-
(id, line), = val
|
2586
|
-
|
2587
2551
|
# TODO: error_duplicate_pattern_variable(p, $1, &@1);
|
2588
2552
|
# TODO: assignable(p, $1, 0, &@$);
|
2589
|
-
result =
|
2553
|
+
result = wrap :lvar, val[0]
|
2590
2554
|
}
|
2591
2555
|
|
2592
2556
|
p_var_ref: tCARET tIDENTIFIER
|
2593
2557
|
{
|
2594
|
-
_, (id, line) = val
|
2595
|
-
|
2596
2558
|
# TODO: check id against env for lvar or dvar
|
2597
|
-
|
2598
|
-
result = s(:lvar, id.to_sym).line line
|
2559
|
+
result = wrap :lvar, val[1]
|
2599
2560
|
}
|
2600
2561
|
|
2562
|
+
|
2601
2563
|
p_const: tCOLON3 cname
|
2602
2564
|
{
|
2603
|
-
|
2604
|
-
result = s(:colon3, id.to_sym).line line
|
2565
|
+
result = wrap :colon3, val[1]
|
2605
2566
|
}
|
2606
2567
|
| p_const tCOLON2 cname
|
2607
2568
|
{
|
@@ -2613,8 +2574,7 @@ opt_block_args_tail: tCOMMA block_args_tail
|
|
2613
2574
|
| tCONSTANT
|
2614
2575
|
{
|
2615
2576
|
# TODO $$ = gettable(p, $1, &@$);
|
2616
|
-
|
2617
|
-
result = s(:const, id.to_sym).line line
|
2577
|
+
result = wrap :const, val[0]
|
2618
2578
|
}
|
2619
2579
|
######################################################################
|
2620
2580
|
|
@@ -2672,7 +2632,7 @@ opt_block_args_tail: tCOMMA block_args_tail
|
|
2672
2632
|
|
2673
2633
|
string: tCHAR
|
2674
2634
|
{
|
2675
|
-
debug
|
2635
|
+
debug 12
|
2676
2636
|
}
|
2677
2637
|
| string1
|
2678
2638
|
| string string1
|
@@ -2893,25 +2853,22 @@ regexp_contents: none
|
|
2893
2853
|
when nil then
|
2894
2854
|
result = s(:evstr).line line
|
2895
2855
|
else
|
2896
|
-
debug
|
2856
|
+
debug 13
|
2897
2857
|
raise "unknown string body: #{stmt.inspect}"
|
2898
2858
|
end
|
2899
2859
|
}
|
2900
2860
|
|
2901
2861
|
string_dvar: tGVAR
|
2902
2862
|
{
|
2903
|
-
|
2904
|
-
result = s(:gvar, id.to_sym).line line
|
2863
|
+
result = wrap :gvar, val[0]
|
2905
2864
|
}
|
2906
2865
|
| tIVAR
|
2907
2866
|
{
|
2908
|
-
|
2909
|
-
result = s(:ivar, id.to_sym).line line
|
2867
|
+
result = wrap :ivar, val[0]
|
2910
2868
|
}
|
2911
2869
|
| tCVAR
|
2912
2870
|
{
|
2913
|
-
|
2914
|
-
result = s(:cvar, id.to_sym).line line
|
2871
|
+
result = wrap :cvar, val[0]
|
2915
2872
|
}
|
2916
2873
|
| backref
|
2917
2874
|
|
@@ -2920,17 +2877,13 @@ regexp_contents: none
|
|
2920
2877
|
|
2921
2878
|
ssym: tSYMBEG sym
|
2922
2879
|
{
|
2923
|
-
_, (id, line) = val
|
2924
|
-
|
2925
2880
|
lexer.lex_state = EXPR_END
|
2926
|
-
result =
|
2881
|
+
result = wrap :lit, val[1]
|
2927
2882
|
}
|
2928
2883
|
| tSYMBOL
|
2929
2884
|
{
|
2930
|
-
(id, line), = val
|
2931
|
-
|
2932
2885
|
lexer.lex_state = EXPR_END
|
2933
|
-
result =
|
2886
|
+
result = wrap :lit, val[0]
|
2934
2887
|
}
|
2935
2888
|
|
2936
2889
|
sym: fname | tIVAR | tGVAR | tCVAR
|
@@ -2951,7 +2904,7 @@ regexp_contents: none
|
|
2951
2904
|
when :evstr then
|
2952
2905
|
result = s(:dsym, "", result).line result.line
|
2953
2906
|
else
|
2954
|
-
debug
|
2907
|
+
debug 14
|
2955
2908
|
end
|
2956
2909
|
}
|
2957
2910
|
|
@@ -2967,6 +2920,7 @@ regexp_contents: none
|
|
2967
2920
|
| tRATIONAL
|
2968
2921
|
| tIMAGINARY
|
2969
2922
|
|
2923
|
+
|
2970
2924
|
user_variable: tIDENTIFIER
|
2971
2925
|
| tIVAR
|
2972
2926
|
| tGVAR
|
@@ -3011,7 +2965,7 @@ keyword_variable: kNIL { result = s(:nil).line lexer.lineno }
|
|
3011
2965
|
| keyword_variable
|
3012
2966
|
{
|
3013
2967
|
result = self.assignable val[0]
|
3014
|
-
debug
|
2968
|
+
debug 15
|
3015
2969
|
}
|
3016
2970
|
|
3017
2971
|
backref: tNTH_REF
|
@@ -3292,17 +3246,25 @@ f_opt_paren_args: f_paren_args
|
|
3292
3246
|
result = [id, lexer.lineno] # TODO: tPOW/tDSTAR include lineno
|
3293
3247
|
}
|
3294
3248
|
|
3295
|
-
f_opt: f_arg_asgn
|
3249
|
+
f_opt: f_arg_asgn
|
3250
|
+
tEQL
|
3251
|
+
arg_value
|
3296
3252
|
{
|
3297
3253
|
lhs, _, rhs = val
|
3298
3254
|
result = self.assignable lhs, rhs
|
3299
3255
|
# TODO: detect duplicate names
|
3256
|
+
# TODO? p->cur_arg = 0;
|
3257
|
+
# TODO? p->ctxt.in_argdef = 1;
|
3300
3258
|
}
|
3301
3259
|
|
3302
|
-
f_block_opt: f_arg_asgn
|
3260
|
+
f_block_opt: f_arg_asgn
|
3261
|
+
tEQL
|
3262
|
+
primary_value
|
3303
3263
|
{
|
3304
3264
|
lhs, _, rhs = val
|
3305
3265
|
result = self.assignable lhs, rhs
|
3266
|
+
# TODO? p->cur_arg = 0;
|
3267
|
+
# TODO? p->ctxt.in_argdef = 1;
|
3306
3268
|
}
|
3307
3269
|
|
3308
3270
|
f_block_optarg: f_block_opt
|
@@ -3354,6 +3316,12 @@ f_opt_paren_args: f_paren_args
|
|
3354
3316
|
self.env[identifier] = :lvar
|
3355
3317
|
result = ["&#{identifier}".to_sym, line]
|
3356
3318
|
}
|
3319
|
+
| blkarg_mark
|
3320
|
+
{
|
3321
|
+
(_, line), = val
|
3322
|
+
|
3323
|
+
result = [:&, line]
|
3324
|
+
}
|
3357
3325
|
|
3358
3326
|
opt_f_block_arg: tCOMMA f_block_arg
|
3359
3327
|
{
|
@@ -3400,10 +3368,17 @@ f_opt_paren_args: f_paren_args
|
|
3400
3368
|
}
|
3401
3369
|
| tLABEL arg_value
|
3402
3370
|
{
|
3403
|
-
|
3371
|
+
label, arg = val
|
3372
|
+
|
3373
|
+
lit = wrap :lit, label
|
3374
|
+
result = s(:array, lit, arg).line lit.line
|
3375
|
+
}
|
3376
|
+
| tLABEL
|
3377
|
+
{
|
3378
|
+
lit = wrap :lit, val[0]
|
3379
|
+
arg = nil
|
3404
3380
|
|
3405
|
-
|
3406
|
-
result = s(:array, lit, arg).line line
|
3381
|
+
result = s(:array, lit, arg).line lit.line
|
3407
3382
|
}
|
3408
3383
|
| tSTRING_BEG string_contents tLABEL_END arg_value
|
3409
3384
|
{
|