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
@@ -88,14 +88,35 @@ rule
88
88
  end
89
89
  self.env.extend
90
90
  }
91
- tLCURLY top_compstmt tRCURLY
91
+ begin_block
92
92
  {
93
- result = new_iter s(:preexe), nil, val[3]
93
+ _, _, block = val
94
+ result = block
95
+ }
96
+
97
+ begin_block: tLCURLY top_compstmt tRCURLY
98
+ {
99
+ _, stmt, _ = val
100
+ result = new_iter s(:preexe), 0, stmt
94
101
  }
95
102
 
96
- bodystmt: compstmt opt_rescue opt_else opt_ensure
103
+ bodystmt: compstmt opt_rescue k_else
97
104
  {
98
- result = new_body val
105
+ res = _values[-2]
106
+ yyerror "else without rescue is useless" unless res
107
+ }
108
+ compstmt
109
+ opt_ensure
110
+ {
111
+ body, resc, _, _, els, ens = val
112
+
113
+ result = new_body [body, resc, els, ens]
114
+ }
115
+ | compstmt opt_rescue opt_ensure
116
+ {
117
+ body, resc, ens = val
118
+
119
+ result = new_body [body, resc, nil, ens]
99
120
  }
100
121
 
101
122
  compstmt: stmts opt_terms
@@ -104,8 +125,8 @@ rule
104
125
  }
105
126
 
106
127
  stmts: none
107
- | stmt
108
- | stmts terms stmt
128
+ | stmt_or_begin # TODO: newline_node ?
129
+ | stmts terms stmt_or_begin
109
130
  {
110
131
  result = self.block_append val[0], val[2]
111
132
  }
@@ -115,6 +136,21 @@ rule
115
136
  debug20 2, val, result
116
137
  }
117
138
 
139
+ stmt_or_begin: stmt
140
+ | klBEGIN
141
+ {
142
+ if (self.in_def || self.in_single > 0) then
143
+ debug20 1
144
+ yyerror "BEGIN in method"
145
+ end
146
+ self.env.extend
147
+ }
148
+ begin_block
149
+ {
150
+ _, _, stmt = val
151
+ result = stmt
152
+ }
153
+
118
154
  stmt: kALIAS fitem
119
155
  {
120
156
  lexer.lex_state = :expr_fname
@@ -158,7 +194,8 @@ rule
158
194
  }
159
195
  | stmt kRESCUE_MOD stmt
160
196
  {
161
- result = s(:rescue, val[0], new_resbody(s(:array), val[2]))
197
+ body, _, resbody = val
198
+ result = new_rescue body, new_resbody(s(:array), resbody)
162
199
  }
163
200
  | klEND tLCURLY compstmt tRCURLY
164
201
  {
@@ -173,15 +210,33 @@ rule
173
210
  {
174
211
  result = new_masgn val[0], val[2], :wrap
175
212
  }
176
- | var_lhs tOP_ASGN command_call
213
+ | lhs tEQL mrhs
214
+ {
215
+ result = new_assign val[0], s(:svalue, val[2])
216
+ }
217
+ | mlhs tEQL mrhs_arg
218
+ {
219
+ result = new_masgn val[0], val[2]
220
+ }
221
+ | expr
222
+
223
+ command_asgn: lhs tEQL command_rhs
224
+ {
225
+ result = new_assign val[0], val[2]
226
+ }
227
+ # | lhs tEQL command_asgn
228
+ # {
229
+ # result = new_assign val[0], val[2]
230
+ # }
231
+ | var_lhs tOP_ASGN command_rhs
177
232
  {
178
233
  result = new_op_asgn val
179
234
  }
180
- | primary_value tLBRACK2 opt_call_args rbracket tOP_ASGN command_call
235
+ | primary_value tLBRACK2 opt_call_args rbracket tOP_ASGN command_rhs
181
236
  {
182
237
  result = s(:op_asgn1, val[0], val[2], val[4].to_sym, val[5])
183
238
  }
184
- | primary_value call_op tIDENTIFIER tOP_ASGN command_call
239
+ | primary_value call_op tIDENTIFIER tOP_ASGN command_rhs
185
240
  {
186
241
  result = s(:op_asgn, val[0], val[4], val[2].to_sym, val[3].to_sym)
187
242
  if val[1] == '&.'
@@ -189,7 +244,7 @@ rule
189
244
  end
190
245
  result.line = val[0].line
191
246
  }
192
- | primary_value call_op tCONSTANT tOP_ASGN command_call
247
+ | primary_value call_op tCONSTANT tOP_ASGN command_rhs
193
248
  {
194
249
  result = s(:op_asgn, val[0], val[4], val[2].to_sym, val[3].to_sym)
195
250
  if val[1] == '&.'
@@ -197,38 +252,33 @@ rule
197
252
  end
198
253
  result.line = val[0].line
199
254
  }
200
- | primary_value tCOLON2 tCONSTANT tOP_ASGN command_call
255
+ | primary_value tCOLON2 tCONSTANT tOP_ASGN command_rhs
201
256
  {
202
257
  result = s(:op_asgn, val[0], val[4], val[2], val[3])
203
258
  debug20 4, val, result
204
259
  }
205
- | primary_value tCOLON2 tIDENTIFIER tOP_ASGN command_call
260
+ | primary_value tCOLON2 tIDENTIFIER tOP_ASGN command_rhs
206
261
  {
207
262
  result = s(:op_asgn, val[0], val[4], val[2], val[3])
208
263
  debug20 5, val, result
209
264
  }
210
- | backref tOP_ASGN command_call
265
+ | backref tOP_ASGN command_rhs
211
266
  {
212
267
  self.backref_assign_error val[0]
213
268
  }
214
- | lhs tEQL mrhs
215
- {
216
- result = new_assign val[0], s(:svalue, val[2])
217
- }
218
- | mlhs tEQL mrhs_arg
219
- {
220
- result = new_masgn val[0], val[2]
221
- }
222
- | expr
223
269
 
224
- command_asgn: lhs tEQL command_call
270
+ command_rhs: command_call =tOP_ASGN
225
271
  {
226
- result = new_assign val[0], val[2]
272
+ expr, = val
273
+ result = value_expr expr
227
274
  }
228
- | lhs tEQL command_asgn
275
+ | command_call kRESCUE_MOD stmt
229
276
  {
230
- result = new_assign val[0], val[2]
277
+ expr, _, resbody = val
278
+ expr = value_expr expr
279
+ result = new_rescue(expr, new_resbody(s(:array), resbody))
231
280
  }
281
+ | command_asgn
232
282
 
233
283
  expr: command_call
234
284
  | expr kAND expr
@@ -254,30 +304,40 @@ rule
254
304
  result = value_expr(val[0])
255
305
  }
256
306
 
307
+ expr_value_do: {
308
+ lexer.cond.push true
309
+ }
310
+ expr_value do
311
+ {
312
+ lexer.cond.pop
313
+ }
314
+ {
315
+ _, expr, _, _ = val
316
+ result = expr
317
+ }
318
+
257
319
  command_call: command
258
320
  | block_command
259
321
 
260
322
  block_command: block_call
261
- | block_call dot_or_colon operation2 command_args
323
+ | block_call call_op2 operation2 command_args
262
324
  {
263
325
  result = new_call val[0], val[2].to_sym, val[3]
264
326
  }
265
327
 
266
328
  cmd_brace_block: tLBRACE_ARG
267
329
  {
268
- self.env.extend(:dynamic)
330
+ # self.env.extend(:dynamic)
269
331
  result = self.lexer.lineno
270
332
  }
271
- opt_block_param
272
- {
273
- result = nil # self.env.dynamic.keys
274
- }
275
- compstmt tRCURLY
333
+ brace_body tRCURLY
276
334
  {
277
- result = new_iter nil, val[2], val[4]
278
- result.line = val[1]
335
+ _, line, body, _ = val
279
336
 
280
- self.env.unextend
337
+ result = body
338
+ result.line = line
339
+
340
+ # self.env.unextend
281
341
  }
282
342
 
283
343
  fcall: operation
@@ -335,7 +395,7 @@ rule
335
395
  {
336
396
  result = new_yield val[1]
337
397
  }
338
- | kRETURN call_args
398
+ | k_return call_args
339
399
  {
340
400
  line = val[0].last
341
401
  result = s(:return, ret_args(val[1])).line(line)
@@ -559,8 +619,9 @@ rule
559
619
 
560
620
  | reswords
561
621
  {
622
+ (sym, _line), = val
562
623
  lexer.lex_state = :expr_end
563
- result = val[0]
624
+ result = sym
564
625
  }
565
626
 
566
627
  fsym: fname | symbol
@@ -590,6 +651,7 @@ rule
590
651
  | tNEQ | tLSHFT | tRSHFT | tPLUS | tMINUS | tSTAR2
591
652
  | tSTAR | tDIVIDE | tPERCENT | tPOW | tDSTAR | tBANG | tTILDE
592
653
  | tUPLUS | tUMINUS | tAREF | tASET | tBACK_REF2
654
+ | tUBANG
593
655
 
594
656
  reswords: k__LINE__ | k__FILE__ | k__ENCODING__ | klBEGIN | klEND
595
657
  | kALIAS | kAND | kBEGIN | kBREAK | kCASE
@@ -601,51 +663,46 @@ rule
601
663
  | kWHEN | kYIELD | kIF | kUNLESS | kWHILE
602
664
  | kUNTIL
603
665
 
604
- arg: lhs tEQL arg
666
+ arg: lhs tEQL arg_rhs
605
667
  {
606
668
  result = new_assign val[0], val[2]
607
669
  }
608
- | lhs tEQL arg kRESCUE_MOD arg
609
- {
610
- result = new_assign val[0], s(:rescue, val[2], new_resbody(s(:array), val[4]))
611
- }
612
- | var_lhs tOP_ASGN arg
613
- {
614
- result = new_op_asgn val
615
- }
616
- | var_lhs tOP_ASGN arg kRESCUE_MOD arg
670
+ | var_lhs tOP_ASGN arg_rhs
617
671
  {
618
672
  result = new_op_asgn val
619
- result = s(:rescue, result, new_resbody(s(:array), val[4]))
620
673
  }
621
- | primary_value tLBRACK2 opt_call_args rbracket tOP_ASGN arg
674
+ | primary_value tLBRACK2 opt_call_args rbracket tOP_ASGN arg_rhs
622
675
  {
623
676
  val[2].sexp_type = :arglist if val[2]
624
677
  result = s(:op_asgn1, val[0], val[2], val[4].to_sym, val[5])
625
678
  }
626
- | primary_value call_op tIDENTIFIER tOP_ASGN arg
679
+ | primary_value call_op tIDENTIFIER tOP_ASGN arg_rhs
627
680
  {
628
681
  result = new_op_asgn2 val
629
682
  }
630
- | primary_value call_op tCONSTANT tOP_ASGN arg
683
+ | primary_value call_op tCONSTANT tOP_ASGN arg_rhs
631
684
  {
632
685
  result = new_op_asgn2 val
633
686
  }
634
- | primary_value tCOLON2 tIDENTIFIER tOP_ASGN arg
687
+ | primary_value tCOLON2 tIDENTIFIER tOP_ASGN arg_rhs
635
688
  {
636
689
  result = s(:op_asgn, val[0], val[4], val[2].to_sym, val[3].to_sym)
637
690
  }
638
- | primary_value tCOLON2 tCONSTANT tOP_ASGN arg
691
+ | primary_value tCOLON2 tCONSTANT tOP_ASGN arg_rhs
639
692
  {
640
- yyerror "constant re-assignment"
693
+ # TODO: assignment
694
+ raise "not yet: %p" % [val]
641
695
  }
642
- | tCOLON3 tCONSTANT tOP_ASGN arg
696
+ | tCOLON3 tCONSTANT tOP_ASGN arg_rhs
643
697
  {
644
- yyerror "constant re-assignment"
698
+ # TODO: assignment
699
+ raise "not yet: %p" % [val]
645
700
  }
646
- | backref tOP_ASGN arg
701
+ | backref tOP_ASGN arg_rhs
647
702
  {
648
- self.backref_assign_error val[0]
703
+ # TODO: lhs = var_field val[0]
704
+ asgn = new_op_asgn val
705
+ result = self.backref_assign_error asgn
649
706
  }
650
707
  | arg tDOT2 arg
651
708
  {
@@ -717,22 +774,7 @@ rule
717
774
  {
718
775
  result = new_call val[0], :"<=>", argl(val[2])
719
776
  }
720
- | arg tGT arg
721
- {
722
- result = new_call val[0], :">", argl(val[2])
723
- }
724
- | arg tGEQ arg
725
- {
726
- result = new_call val[0], :">=", argl(val[2])
727
- }
728
- | arg tLT arg
729
- {
730
- result = new_call val[0], :"<", argl(val[2])
731
- }
732
- | arg tLEQ arg
733
- {
734
- result = new_call val[0], :"<=", argl(val[2])
735
- }
777
+ | rel_expr =tCMP
736
778
  | arg tEQ arg
737
779
  {
738
780
  result = new_call val[0], :"==", argl(val[2])
@@ -791,6 +833,23 @@ rule
791
833
  }
792
834
  | primary
793
835
 
836
+ relop: tGT
837
+ | tLT
838
+ | tGEQ
839
+ | tLEQ
840
+
841
+ rel_expr: arg relop arg =tGT
842
+ {
843
+ lhs, op, rhs = val
844
+ result = new_call lhs, op.to_sym, argl(rhs)
845
+ }
846
+ | rel_expr relop arg =tGT
847
+ {
848
+ lhs, op, rhs = val
849
+ warn "comparison '%s' after comparison", op
850
+ result = new_call lhs, op.to_sym, argl(rhs)
851
+ }
852
+
794
853
  arg_value: arg
795
854
  {
796
855
  result = value_expr(val[0])
@@ -810,6 +869,15 @@ rule
810
869
  result = args [array_to_hash(val[0])]
811
870
  }
812
871
 
872
+ arg_rhs: arg =tOP_ASGN
873
+ | arg kRESCUE_MOD arg
874
+ {
875
+ body, _, resbody = val
876
+ body = value_expr body
877
+ resbody = remove_begin resbody
878
+ result = new_rescue(body, new_resbody(s(:array), resbody))
879
+ }
880
+
813
881
  paren_args: tLPAREN2 opt_call_args rparen
814
882
  {
815
883
  result = val[1]
@@ -865,12 +933,11 @@ rule
865
933
  }
866
934
 
867
935
  command_args: {
868
- result = lexer.cmdarg.stack.dup # TODO: smell?
869
- lexer.cmdarg.push true
936
+ result = lexer.cmdarg.store true
870
937
  }
871
938
  call_args
872
939
  {
873
- lexer.cmdarg.stack.replace val[0]
940
+ lexer.cmdarg.restore val[0]
874
941
  result = val[1]
875
942
  }
876
943
 
@@ -938,12 +1005,16 @@ rule
938
1005
  {
939
1006
  result = new_call nil, val[0].to_sym
940
1007
  }
941
- | kBEGIN
1008
+ | k_begin
942
1009
  {
943
1010
  result = self.lexer.lineno
1011
+ # TODO:
1012
+ # $<val>1 = cmdarg_stack;
1013
+ # CMDARG_SET(0);
944
1014
  }
945
- bodystmt kEND
1015
+ bodystmt k_end
946
1016
  {
1017
+ # TODO: CMDARG_SET($<val>1);
947
1018
  unless val[2] then
948
1019
  result = s(:nil)
949
1020
  else
@@ -954,22 +1025,25 @@ rule
954
1025
  }
955
1026
  | tLPAREN_ARG rparen
956
1027
  {
1028
+ # TODO: lex_state = :expr_endarg in between
957
1029
  debug20 13, val, result
958
1030
  }
959
1031
  | tLPAREN_ARG
960
1032
  {
961
- result = self.lexer.cmdarg.stack.dup
962
- lexer.cmdarg.stack.replace [false] # TODO add api for these
1033
+ result = lexer.cmdarg.store false
1034
+ # result = self.lexer.cmdarg.stack.dup
1035
+ # lexer.cmdarg.stack.replace [false] # TODO add api for these
963
1036
  }
964
- expr
1037
+ stmt
965
1038
  {
966
1039
  lexer.lex_state = :expr_endarg
967
1040
  }
968
1041
  rparen
969
1042
  {
1043
+ _, cmdarg, stmt, _, _, = val
970
1044
  warning "(...) interpreted as grouped expression"
971
- lexer.cmdarg.stack.replace val[1]
972
- result = val[2]
1045
+ lexer.cmdarg.restore cmdarg
1046
+ result = stmt
973
1047
  }
974
1048
  | tLPAREN compstmt tRPAREN
975
1049
  {
@@ -997,7 +1071,7 @@ rule
997
1071
  {
998
1072
  result = new_hash val
999
1073
  }
1000
- | kRETURN
1074
+ | k_return
1001
1075
  {
1002
1076
  result = s(:return)
1003
1077
  }
@@ -1045,61 +1119,42 @@ rule
1045
1119
  {
1046
1120
  result = val[1] # TODO: fix lineno
1047
1121
  }
1048
- | kIF expr_value then compstmt if_tail kEND
1122
+ | k_if expr_value then compstmt if_tail k_end
1049
1123
  {
1050
- result = new_if val[1], val[3], val[4]
1124
+ _, c, _, t, f, _ = val
1125
+ result = new_if c, t, f
1051
1126
  }
1052
- | kUNLESS expr_value then compstmt opt_else kEND
1127
+ | k_unless expr_value then compstmt opt_else k_end
1053
1128
  {
1054
- result = new_if val[1], val[4], val[3]
1129
+ _, c, _, t, f, _ = val
1130
+ result = new_if c, f, t
1055
1131
  }
1056
- | kWHILE
1132
+ | k_while expr_value_do compstmt k_end
1057
1133
  {
1058
- lexer.cond.push true
1134
+ _, cond, body, _ = val
1135
+ result = new_while body, cond, true
1059
1136
  }
1060
- expr_value do
1137
+ | k_until expr_value_do compstmt k_end
1061
1138
  {
1062
- lexer.cond.pop
1063
- }
1064
- compstmt kEND
1065
- {
1066
- result = new_while val[5], val[2], true
1067
- }
1068
- | kUNTIL
1069
- {
1070
- lexer.cond.push true
1071
- }
1072
- expr_value do
1073
- {
1074
- lexer.cond.pop
1139
+ _, cond, body, _ = val
1140
+ result = new_until body, cond, true
1075
1141
  }
1076
- compstmt kEND
1077
- {
1078
- result = new_until val[5], val[2], true
1079
- }
1080
- | kCASE expr_value opt_terms case_body kEND
1142
+ | k_case expr_value opt_terms case_body k_end
1081
1143
  {
1082
1144
  (_, line), expr, _, body, _ = val
1083
1145
  result = new_case expr, body, line
1084
1146
  }
1085
- | kCASE opt_terms case_body kEND
1147
+ | k_case opt_terms case_body k_end
1086
1148
  {
1087
1149
  (_, line), _, body, _ = val
1088
1150
  result = new_case nil, body, line
1089
1151
  }
1090
- | kFOR for_var kIN
1091
- {
1092
- lexer.cond.push true
1093
- }
1094
- expr_value do
1152
+ | k_for for_var kIN expr_value_do compstmt k_end
1095
1153
  {
1096
- lexer.cond.pop
1154
+ _, var, _, iter, body, _ = val
1155
+ result = new_for iter, var, body
1097
1156
  }
1098
- compstmt kEND
1099
- {
1100
- result = new_for val[4], val[1], val[7]
1101
- }
1102
- | kCLASS
1157
+ | k_class
1103
1158
  {
1104
1159
  result = self.lexer.lineno
1105
1160
  }
@@ -1111,13 +1166,13 @@ rule
1111
1166
  end
1112
1167
  self.env.extend
1113
1168
  }
1114
- bodystmt kEND
1169
+ bodystmt k_end
1115
1170
  {
1116
1171
  result = new_class val
1117
1172
  self.env.unextend
1118
1173
  self.lexer.comments # we don't care about comments in the body
1119
1174
  }
1120
- | kCLASS tLSHFT
1175
+ | k_class tLSHFT
1121
1176
  {
1122
1177
  result = self.lexer.lineno
1123
1178
  }
@@ -1132,13 +1187,13 @@ rule
1132
1187
  self.in_single = 0
1133
1188
  self.env.extend
1134
1189
  }
1135
- bodystmt kEND
1190
+ bodystmt k_end
1136
1191
  {
1137
1192
  result = new_sclass val
1138
1193
  self.env.unextend
1139
1194
  self.lexer.comments # we don't care about comments in the body
1140
1195
  }
1141
- | kMODULE
1196
+ | k_module
1142
1197
  {
1143
1198
  result = self.lexer.lineno
1144
1199
  }
@@ -1150,13 +1205,13 @@ rule
1150
1205
 
1151
1206
  self.env.extend
1152
1207
  }
1153
- bodystmt kEND
1208
+ bodystmt k_end
1154
1209
  {
1155
1210
  result = new_module val
1156
1211
  self.env.unextend
1157
1212
  self.lexer.comments # we don't care about comments in the body
1158
1213
  }
1159
- | kDEF fname
1214
+ | k_def fname
1160
1215
  {
1161
1216
  result = [self.in_def, self.lexer.cmdarg.stack.dup]
1162
1217
 
@@ -1167,7 +1222,7 @@ rule
1167
1222
  # TODO: port local_push_gen and local_pop_gen
1168
1223
  lexer.cmdarg.stack.replace [false]
1169
1224
  }
1170
- f_arglist bodystmt kEND
1225
+ f_arglist bodystmt k_end
1171
1226
  {
1172
1227
  in_def, cmdarg = val[2]
1173
1228
 
@@ -1178,7 +1233,7 @@ rule
1178
1233
  self.in_def = in_def
1179
1234
  self.lexer.comments # we don't care about comments in the body
1180
1235
  }
1181
- | kDEF singleton dot_or_colon
1236
+ | k_def singleton dot_or_colon
1182
1237
  {
1183
1238
  self.comments.push self.lexer.comments
1184
1239
  lexer.lex_state = :expr_fname
@@ -1191,7 +1246,7 @@ rule
1191
1246
  result = [lexer.lineno, self.lexer.cmdarg.stack.dup]
1192
1247
  lexer.cmdarg.stack.replace [false]
1193
1248
  }
1194
- f_arglist bodystmt kEND
1249
+ f_arglist bodystmt k_end
1195
1250
  {
1196
1251
  line, cmdarg = val[5]
1197
1252
  result = new_defs val
@@ -1236,7 +1291,15 @@ rule
1236
1291
  k_class: kCLASS
1237
1292
  k_module: kMODULE
1238
1293
  k_def: kDEF
1294
+ k_do: kDO
1295
+ k_do_block: kDO_BLOCK
1296
+ k_rescue: kRESCUE
1297
+ k_ensure: kENSURE
1298
+ k_when: kWHEN
1299
+ k_else: kELSE
1300
+ k_elsif: kELSIF
1239
1301
  k_end: kEND
1302
+ k_return: kRETURN
1240
1303
 
1241
1304
  then: term
1242
1305
  | kTHEN
@@ -1246,7 +1309,7 @@ rule
1246
1309
  | kDO_COND
1247
1310
 
1248
1311
  if_tail: opt_else
1249
- | kELSIF expr_value then compstmt if_tail
1312
+ | k_elsif expr_value then compstmt if_tail
1250
1313
  {
1251
1314
  result = s(:if, val[1], val[3], val[4])
1252
1315
  }
@@ -1417,18 +1480,22 @@ opt_block_args_tail: tCOMMA block_args_tail
1417
1480
 
1418
1481
  opt_block_param: none { result = 0 }
1419
1482
  | block_param_def
1483
+ {
1484
+ self.lexer.command_start = true
1485
+ }
1420
1486
 
1421
1487
  block_param_def: tPIPE opt_bv_decl tPIPE
1422
1488
  {
1489
+ # TODO: current_arg = 0
1423
1490
  result = args val
1424
1491
  }
1425
1492
  | tOROP
1426
1493
  {
1427
- self.lexer.command_start = true
1428
1494
  result = s(:args)
1429
1495
  }
1430
1496
  | tPIPE block_param opt_bv_decl tPIPE
1431
1497
  {
1498
+ # TODO: current_arg = 0
1432
1499
  result = args val
1433
1500
  }
1434
1501
 
@@ -1461,13 +1528,21 @@ opt_block_args_tail: tCOMMA block_args_tail
1461
1528
  lexer.paren_nest += 1
1462
1529
  lexer.lpar_beg = lexer.paren_nest
1463
1530
  }
1464
- f_larglist lambda_body
1531
+ f_larglist
1532
+ {
1533
+ result = [lexer.cmdarg.store(false), self.lexer.lineno]
1534
+ }
1535
+ lambda_body
1465
1536
  {
1466
- lpar, args, body = val
1537
+ lpar, args, (cmdarg, lineno), body = val
1467
1538
  lexer.lpar_beg = lpar
1468
1539
 
1540
+ lexer.cmdarg.restore cmdarg
1541
+ lexer.cmdarg.lexpop
1542
+
1469
1543
  call = new_call nil, :lambda
1470
1544
  result = new_iter call, args, body
1545
+ result.line = lineno
1471
1546
  self.env.unextend
1472
1547
  }
1473
1548
 
@@ -1485,28 +1560,15 @@ opt_block_args_tail: tCOMMA block_args_tail
1485
1560
  {
1486
1561
  result = val[1]
1487
1562
  }
1488
- | kDO_LAMBDA compstmt kEND
1563
+ | kDO_LAMBDA bodystmt kEND
1489
1564
  {
1490
1565
  result = val[1]
1491
1566
  }
1492
1567
 
1493
- do_block: kDO_BLOCK
1568
+ do_block: k_do_block do_body kEND
1494
1569
  {
1495
- self.env.extend :dynamic
1496
- result = self.lexer.lineno
1497
- }
1498
- opt_block_param
1499
- {
1500
- result = nil # self.env.dynamic.keys
1501
- }
1502
- compstmt kEND
1503
- {
1504
- args = val[2]
1505
- body = val[4]
1506
- result = new_iter nil, args, body
1507
- result.line = val[1]
1508
-
1509
- self.env.unextend
1570
+ # TODO: maybe fix lineno to kDO's lineno?
1571
+ result = val[1]
1510
1572
  }
1511
1573
 
1512
1574
  block_call: command do_block
@@ -1523,11 +1585,11 @@ opt_block_args_tail: tCOMMA block_args_tail
1523
1585
  result = val[1]
1524
1586
  result.insert 1, val[0]
1525
1587
  }
1526
- | block_call dot_or_colon operation2 opt_paren_args
1588
+ | block_call call_op2 operation2 opt_paren_args
1527
1589
  {
1528
1590
  result = new_call val[0], val[2].to_sym, val[3]
1529
1591
  }
1530
- | block_call dot_or_colon operation2 opt_paren_args brace_block
1592
+ | block_call call_op2 operation2 opt_paren_args brace_block
1531
1593
  {
1532
1594
  iter1, _, name, args, iter2 = val
1533
1595
 
@@ -1536,7 +1598,7 @@ opt_block_args_tail: tCOMMA block_args_tail
1536
1598
 
1537
1599
  result = iter2
1538
1600
  }
1539
- | block_call dot_or_colon operation2 command_args do_block
1601
+ | block_call call_op2 operation2 command_args do_block
1540
1602
  {
1541
1603
  iter1, _, name, args, iter2 = val
1542
1604
 
@@ -1593,39 +1655,55 @@ opt_block_args_tail: tCOMMA block_args_tail
1593
1655
  self.env.extend :dynamic
1594
1656
  result = self.lexer.lineno
1595
1657
  }
1596
- opt_block_param
1597
- {
1598
- result = nil # self.env.dynamic.keys
1599
- }
1600
- compstmt tRCURLY
1658
+ brace_body tRCURLY
1601
1659
  {
1602
- _, line, args, _, body, _ = val
1660
+ _, line, body, _ = val
1603
1661
 
1604
- result = new_iter nil, args, body
1662
+ result = body
1605
1663
  result.line = line
1606
1664
 
1607
1665
  self.env.unextend
1608
1666
  }
1609
- | kDO
1667
+ | k_do
1610
1668
  {
1611
1669
  self.env.extend :dynamic
1612
1670
  result = self.lexer.lineno
1613
1671
  }
1614
- opt_block_param
1672
+ do_body kEND
1615
1673
  {
1616
- result = nil # self.env.dynamic.keys
1674
+ _, line, body, _ = val
1675
+
1676
+ result = body
1677
+ result.line = line
1678
+
1679
+ self.env.unextend
1617
1680
  }
1618
- bodystmt kEND
1681
+
1682
+ brace_body: { self.env.extend :dynamic; result = self.lexer.lineno }
1683
+ { result = lexer.cmdarg.store(false) }
1684
+ opt_block_param compstmt
1619
1685
  {
1620
- _, line, args, _, body, _ = val
1686
+ line, cmdarg, param, cmpstmt = val
1621
1687
 
1622
- result = new_iter nil, args, body
1623
- result.line = line
1688
+ result = new_brace_body param, cmpstmt, line
1689
+ self.env.unextend
1690
+ lexer.cmdarg.restore cmdarg
1691
+ lexer.cmdarg.pop # because of: cmdarg_stack >> 1 ?
1692
+ }
1693
+
1694
+ do_body: { self.env.extend :dynamic; result = self.lexer.lineno }
1695
+ { result = lexer.cmdarg.store(false) }
1696
+ opt_block_param
1697
+ bodystmt
1698
+ {
1699
+ line, cmdarg, param, cmpstmt = val
1624
1700
 
1701
+ result = new_do_body param, cmpstmt, line
1625
1702
  self.env.unextend
1703
+ lexer.cmdarg.restore cmdarg
1626
1704
  }
1627
1705
 
1628
- case_body: kWHEN
1706
+ case_body: k_when
1629
1707
  {
1630
1708
  result = self.lexer.lineno
1631
1709
  }
@@ -1638,7 +1716,7 @@ opt_block_args_tail: tCOMMA block_args_tail
1638
1716
 
1639
1717
  cases: opt_else | case_body
1640
1718
 
1641
- opt_rescue: kRESCUE exc_list exc_var then compstmt opt_rescue
1719
+ opt_rescue: k_rescue exc_list exc_var then compstmt opt_rescue
1642
1720
  {
1643
1721
  (_, line), klasses, var, _, body, rest = val
1644
1722
 
@@ -1667,7 +1745,7 @@ opt_block_args_tail: tCOMMA block_args_tail
1667
1745
  }
1668
1746
  | none
1669
1747
 
1670
- opt_ensure: kENSURE compstmt
1748
+ opt_ensure: k_ensure compstmt
1671
1749
  {
1672
1750
  _, body = val
1673
1751
 
@@ -1834,7 +1912,7 @@ regexp_contents: none
1834
1912
  result = lexer.lex_strterm
1835
1913
 
1836
1914
  lexer.lex_strterm = nil
1837
- lexer.lex_state = :expr_beg # TODO: expr_value ?
1915
+ lexer.lex_state = :expr_beg
1838
1916
  }
1839
1917
  string_dvar
1840
1918
  {
@@ -1855,11 +1933,11 @@ regexp_contents: none
1855
1933
  lexer.brace_nest = 0
1856
1934
  lexer.string_nest = 0
1857
1935
 
1858
- lexer.lex_state = :expr_value
1936
+ lexer.lex_state = :expr_beg
1859
1937
  }
1860
- compstmt tRCURLY
1938
+ compstmt
1939
+ tSTRING_DEND
1861
1940
  {
1862
- # TODO: tRCURLY -> tSTRING_END
1863
1941
  _, memo, stmt, _ = val
1864
1942
 
1865
1943
  lex_strterm, brace_nest, string_nest, oldcond, oldcmdarg, oldlex_state = memo
@@ -1982,23 +2060,18 @@ keyword_variable: kNIL { result = s(:nil) }
1982
2060
  backref: tNTH_REF { result = s(:nth_ref, val[0]) }
1983
2061
  | tBACK_REF { result = s(:back_ref, val[0]) }
1984
2062
 
1985
- superclass: term
1986
- {
1987
- result = nil
1988
- }
1989
- | tLT
2063
+ superclass: tLT
1990
2064
  {
1991
2065
  lexer.lex_state = :expr_beg
2066
+ lexer.command_start = true
1992
2067
  }
1993
2068
  expr_value term
1994
2069
  {
1995
2070
  result = val[2]
1996
2071
  }
1997
- | error term
2072
+ | none
1998
2073
  {
1999
- yyerrok
2000
2074
  result = nil
2001
- debug20 30, val, result
2002
2075
  }
2003
2076
 
2004
2077
  f_arglist: tLPAREN2 f_args rparen
@@ -2006,16 +2079,20 @@ keyword_variable: kNIL { result = s(:nil) }
2006
2079
  result = val[1]
2007
2080
  self.lexer.lex_state = :expr_beg
2008
2081
  self.lexer.command_start = true
2009
- # TODO:
2010
- # $<num>$ = parser->parser_in_kwarg;
2011
- # parser->parser_in_kwarg = 1;
2012
2082
  }
2013
- | f_args term
2083
+ | {
2084
+ result = self.in_kwarg
2085
+ self.in_kwarg = true
2086
+ # TODO: self.lexer.lex_state |= :expr_label
2087
+ }
2088
+ f_args term
2014
2089
  {
2015
- # TODO: parser->parser_in_kwarg = $<num>1;
2016
- result = val[0]
2017
- self.lexer.lex_state = :expr_beg
2018
- self.lexer.command_start = true
2090
+ kwarg, args, _ = val
2091
+
2092
+ self.in_kwarg = kwarg
2093
+ result = args
2094
+ lexer.lex_state = :expr_beg
2095
+ lexer.command_start = true
2019
2096
  }
2020
2097
 
2021
2098
  args_tail: f_kwarg tCOMMA f_kwrest opt_f_block_arg
@@ -2218,7 +2295,9 @@ keyword_variable: kNIL { result = s(:nil) }
2218
2295
 
2219
2296
  f_kwrest: kwrest_mark tIDENTIFIER
2220
2297
  {
2221
- result = :"**#{val[1]}"
2298
+ name = val[1].to_sym
2299
+ self.assignable name
2300
+ result = :"**#{name}"
2222
2301
  }
2223
2302
  | kwrest_mark
2224
2303
  {
@@ -2325,9 +2404,10 @@ keyword_variable: kNIL { result = s(:nil) }
2325
2404
  {
2326
2405
  result = s(:array, val[0], val[2])
2327
2406
  }
2328
- | tLABEL opt_nl arg_value
2407
+ | tLABEL arg_value
2329
2408
  {
2330
- result = s(:array, s(:lit, val[0][0].to_sym), val.last)
2409
+ (label, _), arg = val
2410
+ result = s(:array, s(:lit, label.to_sym), arg)
2331
2411
  }
2332
2412
  | tSTRING_BEG string_contents tLABEL_END arg_value
2333
2413
  {
@@ -2335,11 +2415,6 @@ keyword_variable: kNIL { result = s(:nil) }
2335
2415
  sym.sexp_type = :dsym
2336
2416
  result = s(:array, sym, value)
2337
2417
  }
2338
- | tSYMBOL arg_value
2339
- {
2340
- raise "not yet: #{val.inspect}"
2341
- # result = s(:array, s(:lit, val[1].to_sym), val[1])
2342
- }
2343
2418
  | tDSTAR arg_value
2344
2419
  {
2345
2420
  result = s(:array, s(:kwsplat, val[1]))
@@ -2350,7 +2425,11 @@ keyword_variable: kNIL { result = s(:nil) }
2350
2425
  operation3: tIDENTIFIER | tFID | op
2351
2426
  dot_or_colon: tDOT | tCOLON2
2352
2427
  call_op: tDOT
2353
- | tLONELY
2428
+ | tLONELY # TODO: rename tANDDOT?
2429
+
2430
+ call_op2: call_op
2431
+ | tCOLON2
2432
+
2354
2433
  opt_terms: | terms
2355
2434
  opt_nl: | tNL
2356
2435
  rparen: opt_nl tRPAREN