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.

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