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
@@ -1,20 +1,6 @@
1
1
  # -*- racc -*-
2
2
 
3
- #if V==20
4
- class Ruby20Parser
5
- #elif V==21
6
- class Ruby21Parser
7
- #elif V == 22
8
3
  class Ruby22Parser
9
- #elif V == 23
10
- class Ruby23Parser
11
- #elif V == 24
12
- class Ruby24Parser
13
- #elif V == 25
14
- class Ruby25Parser
15
- #else
16
- fail "version not specified or supported on code generation"
17
- #endif
18
4
 
19
5
  token kCLASS kMODULE kDEF kUNDEF kBEGIN kRESCUE kENSURE kEND kIF kUNLESS
20
6
  kTHEN kELSIF kELSE kCASE kWHEN kWHILE kUNTIL kFOR kBREAK kNEXT
@@ -33,15 +19,8 @@ token kCLASS kMODULE kDEF kUNDEF kBEGIN kRESCUE kENSURE kEND kIF kUNLESS
33
19
  tWORDS_BEG tQWORDS_BEG tSTRING_DBEG tSTRING_DVAR tSTRING_END
34
20
  tSTRING tSYMBOL tNL tEH tCOLON tCOMMA tSPACE tSEMI tLAMBDA
35
21
  tLAMBEG tDSTAR tCHAR tSYMBOLS_BEG tQSYMBOLS_BEG tSTRING_DEND tUBANG
36
- #if V >= 21
37
22
  tRATIONAL tIMAGINARY
38
- #endif
39
- #if V >= 22
40
23
  tLABEL_END
41
- #endif
42
- #if V >= 23
43
- tLONELY
44
- #endif
45
24
 
46
25
  prechigh
47
26
  right tBANG tTILDE tUPLUS
@@ -108,14 +87,35 @@ rule
108
87
  end
109
88
  self.env.extend
110
89
  }
111
- tLCURLY top_compstmt tRCURLY
90
+ begin_block
112
91
  {
113
- result = new_iter s(:preexe), nil, val[3]
92
+ _, _, block = val
93
+ result = block
94
+ }
95
+
96
+ begin_block: tLCURLY top_compstmt tRCURLY
97
+ {
98
+ _, stmt, _ = val
99
+ result = new_iter s(:preexe), 0, stmt
100
+ }
101
+
102
+ bodystmt: compstmt opt_rescue k_else
103
+ {
104
+ res = _values[-2]
105
+ yyerror "else without rescue is useless" unless res
114
106
  }
107
+ compstmt
108
+ opt_ensure
109
+ {
110
+ body, resc, _, _, els, ens = val
115
111
 
116
- bodystmt: compstmt opt_rescue opt_else opt_ensure
112
+ result = new_body [body, resc, els, ens]
113
+ }
114
+ | compstmt opt_rescue opt_ensure
117
115
  {
118
- result = new_body val
116
+ body, resc, ens = val
117
+
118
+ result = new_body [body, resc, nil, ens]
119
119
  }
120
120
 
121
121
  compstmt: stmts opt_terms
@@ -124,8 +124,8 @@ rule
124
124
  }
125
125
 
126
126
  stmts: none
127
- | stmt
128
- | stmts terms stmt
127
+ | stmt_or_begin # TODO: newline_node ?
128
+ | stmts terms stmt_or_begin
129
129
  {
130
130
  result = self.block_append val[0], val[2]
131
131
  }
@@ -135,6 +135,21 @@ rule
135
135
  debug20 2, val, result
136
136
  }
137
137
 
138
+ stmt_or_begin: stmt
139
+ | klBEGIN
140
+ {
141
+ if (self.in_def || self.in_single > 0) then
142
+ debug20 1
143
+ yyerror "BEGIN in method"
144
+ end
145
+ self.env.extend
146
+ }
147
+ begin_block
148
+ {
149
+ _, _, stmt = val
150
+ result = stmt
151
+ }
152
+
138
153
  stmt: kALIAS fitem
139
154
  {
140
155
  lexer.lex_state = :expr_fname
@@ -178,7 +193,8 @@ rule
178
193
  }
179
194
  | stmt kRESCUE_MOD stmt
180
195
  {
181
- result = s(:rescue, val[0], new_resbody(s(:array), val[2]))
196
+ body, _, resbody = val
197
+ result = new_rescue body, new_resbody(s(:array), resbody)
182
198
  }
183
199
  | klEND tLCURLY compstmt tRCURLY
184
200
  {
@@ -193,15 +209,33 @@ rule
193
209
  {
194
210
  result = new_masgn val[0], val[2], :wrap
195
211
  }
196
- | var_lhs tOP_ASGN command_call
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
+
222
+ command_asgn: lhs tEQL command_rhs
223
+ {
224
+ result = new_assign val[0], val[2]
225
+ }
226
+ # | lhs tEQL command_asgn
227
+ # {
228
+ # result = new_assign val[0], val[2]
229
+ # }
230
+ | var_lhs tOP_ASGN command_rhs
197
231
  {
198
232
  result = new_op_asgn val
199
233
  }
200
- | primary_value tLBRACK2 opt_call_args rbracket tOP_ASGN command_call
234
+ | primary_value tLBRACK2 opt_call_args rbracket tOP_ASGN command_rhs
201
235
  {
202
236
  result = s(:op_asgn1, val[0], val[2], val[4].to_sym, val[5])
203
237
  }
204
- | primary_value call_op tIDENTIFIER tOP_ASGN command_call
238
+ | primary_value call_op tIDENTIFIER tOP_ASGN command_rhs
205
239
  {
206
240
  result = s(:op_asgn, val[0], val[4], val[2].to_sym, val[3].to_sym)
207
241
  if val[1] == '&.'
@@ -209,7 +243,7 @@ rule
209
243
  end
210
244
  result.line = val[0].line
211
245
  }
212
- | primary_value call_op tCONSTANT tOP_ASGN command_call
246
+ | primary_value call_op tCONSTANT tOP_ASGN command_rhs
213
247
  {
214
248
  result = s(:op_asgn, val[0], val[4], val[2].to_sym, val[3].to_sym)
215
249
  if val[1] == '&.'
@@ -217,46 +251,33 @@ rule
217
251
  end
218
252
  result.line = val[0].line
219
253
  }
220
- | primary_value tCOLON2 tCONSTANT tOP_ASGN command_call
254
+ | primary_value tCOLON2 tCONSTANT tOP_ASGN command_rhs
221
255
  {
222
256
  result = s(:op_asgn, val[0], val[4], val[2], val[3])
223
257
  debug20 4, val, result
224
258
  }
225
- | primary_value tCOLON2 tIDENTIFIER tOP_ASGN command_call
259
+ | primary_value tCOLON2 tIDENTIFIER tOP_ASGN command_rhs
226
260
  {
227
261
  result = s(:op_asgn, val[0], val[4], val[2], val[3])
228
262
  debug20 5, val, result
229
263
  }
230
- | backref tOP_ASGN command_call
264
+ | backref tOP_ASGN command_rhs
231
265
  {
232
266
  self.backref_assign_error val[0]
233
267
  }
234
- | lhs tEQL mrhs
235
- {
236
- result = new_assign val[0], s(:svalue, val[2])
237
- }
238
- #if V == 20
239
- | mlhs tEQL arg_value
240
- {
241
- result = new_masgn val[0], val[2], :wrap
242
- }
243
- | mlhs tEQL mrhs
244
- #else
245
- | mlhs tEQL mrhs_arg
246
- #endif
247
- {
248
- result = new_masgn val[0], val[2]
249
- }
250
- | expr
251
268
 
252
- command_asgn: lhs tEQL command_call
269
+ command_rhs: command_call =tOP_ASGN
253
270
  {
254
- result = new_assign val[0], val[2]
271
+ expr, = val
272
+ result = value_expr expr
255
273
  }
256
- | lhs tEQL command_asgn
274
+ | command_call kRESCUE_MOD stmt
257
275
  {
258
- result = new_assign val[0], val[2]
276
+ expr, _, resbody = val
277
+ expr = value_expr expr
278
+ result = new_rescue(expr, new_resbody(s(:array), resbody))
259
279
  }
280
+ | command_asgn
260
281
 
261
282
  expr: command_call
262
283
  | expr kAND expr
@@ -282,30 +303,40 @@ rule
282
303
  result = value_expr(val[0])
283
304
  }
284
305
 
306
+ expr_value_do: {
307
+ lexer.cond.push true
308
+ }
309
+ expr_value do
310
+ {
311
+ lexer.cond.pop
312
+ }
313
+ {
314
+ _, expr, _, _ = val
315
+ result = expr
316
+ }
317
+
285
318
  command_call: command
286
319
  | block_command
287
320
 
288
321
  block_command: block_call
289
- | block_call dot_or_colon operation2 command_args
322
+ | block_call call_op2 operation2 command_args
290
323
  {
291
324
  result = new_call val[0], val[2].to_sym, val[3]
292
325
  }
293
326
 
294
327
  cmd_brace_block: tLBRACE_ARG
295
328
  {
296
- self.env.extend(:dynamic)
329
+ # self.env.extend(:dynamic)
297
330
  result = self.lexer.lineno
298
331
  }
299
- opt_block_param
300
- {
301
- result = nil # self.env.dynamic.keys
302
- }
303
- compstmt tRCURLY
332
+ brace_body tRCURLY
304
333
  {
305
- result = new_iter nil, val[2], val[4]
306
- result.line = val[1]
334
+ _, line, body, _ = val
307
335
 
308
- self.env.unextend
336
+ result = body
337
+ result.line = line
338
+
339
+ # self.env.unextend
309
340
  }
310
341
 
311
342
  fcall: operation
@@ -363,7 +394,7 @@ rule
363
394
  {
364
395
  result = new_yield val[1]
365
396
  }
366
- | kRETURN call_args
397
+ | k_return call_args
367
398
  {
368
399
  line = val[0].last
369
400
  result = s(:return, ret_args(val[1])).line(line)
@@ -587,8 +618,9 @@ rule
587
618
 
588
619
  | reswords
589
620
  {
621
+ (sym, _line), = val
590
622
  lexer.lex_state = :expr_end
591
- result = val[0]
623
+ result = sym
592
624
  }
593
625
 
594
626
  fsym: fname | symbol
@@ -618,9 +650,7 @@ rule
618
650
  | tNEQ | tLSHFT | tRSHFT | tPLUS | tMINUS | tSTAR2
619
651
  | tSTAR | tDIVIDE | tPERCENT | tPOW | tDSTAR | tBANG | tTILDE
620
652
  | tUPLUS | tUMINUS | tAREF | tASET | tBACK_REF2
621
- #if V == 20
622
653
  | tUBANG
623
- #endif
624
654
 
625
655
  reswords: k__LINE__ | k__FILE__ | k__ENCODING__ | klBEGIN | klEND
626
656
  | kALIAS | kAND | kBEGIN | kBREAK | kCASE
@@ -632,51 +662,46 @@ rule
632
662
  | kWHEN | kYIELD | kIF | kUNLESS | kWHILE
633
663
  | kUNTIL
634
664
 
635
- arg: lhs tEQL arg
665
+ arg: lhs tEQL arg_rhs
636
666
  {
637
667
  result = new_assign val[0], val[2]
638
668
  }
639
- | lhs tEQL arg kRESCUE_MOD arg
640
- {
641
- result = new_assign val[0], s(:rescue, val[2], new_resbody(s(:array), val[4]))
642
- }
643
- | var_lhs tOP_ASGN arg
644
- {
645
- result = new_op_asgn val
646
- }
647
- | var_lhs tOP_ASGN arg kRESCUE_MOD arg
669
+ | var_lhs tOP_ASGN arg_rhs
648
670
  {
649
671
  result = new_op_asgn val
650
- result = s(:rescue, result, new_resbody(s(:array), val[4]))
651
672
  }
652
- | primary_value tLBRACK2 opt_call_args rbracket tOP_ASGN arg
673
+ | primary_value tLBRACK2 opt_call_args rbracket tOP_ASGN arg_rhs
653
674
  {
654
675
  val[2].sexp_type = :arglist if val[2]
655
676
  result = s(:op_asgn1, val[0], val[2], val[4].to_sym, val[5])
656
677
  }
657
- | primary_value call_op tIDENTIFIER tOP_ASGN arg
678
+ | primary_value call_op tIDENTIFIER tOP_ASGN arg_rhs
658
679
  {
659
680
  result = new_op_asgn2 val
660
681
  }
661
- | primary_value call_op tCONSTANT tOP_ASGN arg
682
+ | primary_value call_op tCONSTANT tOP_ASGN arg_rhs
662
683
  {
663
684
  result = new_op_asgn2 val
664
685
  }
665
- | primary_value tCOLON2 tIDENTIFIER tOP_ASGN arg
686
+ | primary_value tCOLON2 tIDENTIFIER tOP_ASGN arg_rhs
666
687
  {
667
688
  result = s(:op_asgn, val[0], val[4], val[2].to_sym, val[3].to_sym)
668
689
  }
669
- | primary_value tCOLON2 tCONSTANT tOP_ASGN arg
690
+ | primary_value tCOLON2 tCONSTANT tOP_ASGN arg_rhs
670
691
  {
671
- yyerror "constant re-assignment"
692
+ # TODO: assignment
693
+ raise "not yet: %p" % [val]
672
694
  }
673
- | tCOLON3 tCONSTANT tOP_ASGN arg
695
+ | tCOLON3 tCONSTANT tOP_ASGN arg_rhs
674
696
  {
675
- yyerror "constant re-assignment"
697
+ # TODO: assignment
698
+ raise "not yet: %p" % [val]
676
699
  }
677
- | backref tOP_ASGN arg
700
+ | backref tOP_ASGN arg_rhs
678
701
  {
679
- self.backref_assign_error val[0]
702
+ # TODO: lhs = var_field val[0]
703
+ asgn = new_op_asgn val
704
+ result = self.backref_assign_error asgn
680
705
  }
681
706
  | arg tDOT2 arg
682
707
  {
@@ -720,21 +745,9 @@ rule
720
745
  {
721
746
  result = new_call val[0], :**, argl(val[2])
722
747
  }
723
- #if V == 20
724
- | tUMINUS_NUM tINTEGER tPOW arg
725
- {
726
- result = new_call(new_call(s(:lit, val[1]), :"**", argl(val[3])), :"-@")
727
- }
728
- | tUMINUS_NUM tFLOAT tPOW arg
729
- #else
730
748
  | tUMINUS_NUM simple_numeric tPOW arg
731
- #endif
732
749
  {
733
750
  result = new_call(new_call(s(:lit, val[1]), :"**", argl(val[3])), :"-@")
734
- #if V == 20
735
- ## TODO: why is this 2.0 only?
736
- debug20 12, val, result
737
- #endif
738
751
  }
739
752
  | tUPLUS arg
740
753
  {
@@ -760,22 +773,7 @@ rule
760
773
  {
761
774
  result = new_call val[0], :"<=>", argl(val[2])
762
775
  }
763
- | arg tGT arg
764
- {
765
- result = new_call val[0], :">", argl(val[2])
766
- }
767
- | arg tGEQ arg
768
- {
769
- result = new_call val[0], :">=", argl(val[2])
770
- }
771
- | arg tLT arg
772
- {
773
- result = new_call val[0], :"<", argl(val[2])
774
- }
775
- | arg tLEQ arg
776
- {
777
- result = new_call val[0], :"<=", argl(val[2])
778
- }
776
+ | rel_expr =tCMP
779
777
  | arg tEQ arg
780
778
  {
781
779
  result = new_call val[0], :"==", argl(val[2])
@@ -834,6 +832,23 @@ rule
834
832
  }
835
833
  | primary
836
834
 
835
+ relop: tGT
836
+ | tLT
837
+ | tGEQ
838
+ | tLEQ
839
+
840
+ rel_expr: arg relop arg =tGT
841
+ {
842
+ lhs, op, rhs = val
843
+ result = new_call lhs, op.to_sym, argl(rhs)
844
+ }
845
+ | rel_expr relop arg =tGT
846
+ {
847
+ lhs, op, rhs = val
848
+ warn "comparison '%s' after comparison", op
849
+ result = new_call lhs, op.to_sym, argl(rhs)
850
+ }
851
+
837
852
  arg_value: arg
838
853
  {
839
854
  result = value_expr(val[0])
@@ -853,6 +868,15 @@ rule
853
868
  result = args [array_to_hash(val[0])]
854
869
  }
855
870
 
871
+ arg_rhs: arg =tOP_ASGN
872
+ | arg kRESCUE_MOD arg
873
+ {
874
+ body, _, resbody = val
875
+ body = value_expr body
876
+ resbody = remove_begin resbody
877
+ result = new_rescue(body, new_resbody(s(:array), resbody))
878
+ }
879
+
856
880
  paren_args: tLPAREN2 opt_call_args rparen
857
881
  {
858
882
  result = val[1]
@@ -908,12 +932,11 @@ rule
908
932
  }
909
933
 
910
934
  command_args: {
911
- result = lexer.cmdarg.stack.dup # TODO: smell?
912
- lexer.cmdarg.push true
935
+ result = lexer.cmdarg.store true
913
936
  }
914
937
  call_args
915
938
  {
916
- lexer.cmdarg.stack.replace val[0]
939
+ lexer.cmdarg.restore val[0]
917
940
  result = val[1]
918
941
  }
919
942
 
@@ -945,7 +968,6 @@ rule
945
968
  result = self.list_append val[0], s(:splat, val[3])
946
969
  }
947
970
 
948
- #if V >= 21
949
971
  mrhs_arg: mrhs
950
972
  {
951
973
  result = new_masgn_arg val[0]
@@ -955,7 +977,6 @@ rule
955
977
  result = new_masgn_arg val[0], :wrap
956
978
  }
957
979
 
958
- #endif
959
980
  mrhs: args tCOMMA arg_value
960
981
  {
961
982
  result = val[0] << val[2]
@@ -983,12 +1004,16 @@ rule
983
1004
  {
984
1005
  result = new_call nil, val[0].to_sym
985
1006
  }
986
- | kBEGIN
1007
+ | k_begin
987
1008
  {
988
1009
  result = self.lexer.lineno
1010
+ # TODO:
1011
+ # $<val>1 = cmdarg_stack;
1012
+ # CMDARG_SET(0);
989
1013
  }
990
- bodystmt kEND
1014
+ bodystmt k_end
991
1015
  {
1016
+ # TODO: CMDARG_SET($<val>1);
992
1017
  unless val[2] then
993
1018
  result = s(:nil)
994
1019
  else
@@ -999,22 +1024,25 @@ rule
999
1024
  }
1000
1025
  | tLPAREN_ARG rparen
1001
1026
  {
1027
+ # TODO: lex_state = :expr_endarg in between
1002
1028
  debug20 13, val, result
1003
1029
  }
1004
1030
  | tLPAREN_ARG
1005
1031
  {
1006
- result = self.lexer.cmdarg.stack.dup
1007
- lexer.cmdarg.stack.replace [false] # TODO add api for these
1032
+ result = lexer.cmdarg.store false
1033
+ # result = self.lexer.cmdarg.stack.dup
1034
+ # lexer.cmdarg.stack.replace [false] # TODO add api for these
1008
1035
  }
1009
- expr
1036
+ stmt
1010
1037
  {
1011
1038
  lexer.lex_state = :expr_endarg
1012
1039
  }
1013
1040
  rparen
1014
1041
  {
1042
+ _, cmdarg, stmt, _, _, = val
1015
1043
  warning "(...) interpreted as grouped expression"
1016
- lexer.cmdarg.stack.replace val[1]
1017
- result = val[2]
1044
+ lexer.cmdarg.restore cmdarg
1045
+ result = stmt
1018
1046
  }
1019
1047
  | tLPAREN compstmt tRPAREN
1020
1048
  {
@@ -1042,7 +1070,7 @@ rule
1042
1070
  {
1043
1071
  result = new_hash val
1044
1072
  }
1045
- | kRETURN
1073
+ | k_return
1046
1074
  {
1047
1075
  result = s(:return)
1048
1076
  }
@@ -1090,61 +1118,42 @@ rule
1090
1118
  {
1091
1119
  result = val[1] # TODO: fix lineno
1092
1120
  }
1093
- | kIF expr_value then compstmt if_tail kEND
1094
- {
1095
- result = new_if val[1], val[3], val[4]
1096
- }
1097
- | kUNLESS expr_value then compstmt opt_else kEND
1098
- {
1099
- result = new_if val[1], val[4], val[3]
1100
- }
1101
- | kWHILE
1121
+ | k_if expr_value then compstmt if_tail k_end
1102
1122
  {
1103
- lexer.cond.push true
1104
- }
1105
- expr_value do
1106
- {
1107
- lexer.cond.pop
1123
+ _, c, _, t, f, _ = val
1124
+ result = new_if c, t, f
1108
1125
  }
1109
- compstmt kEND
1126
+ | k_unless expr_value then compstmt opt_else k_end
1110
1127
  {
1111
- result = new_while val[5], val[2], true
1128
+ _, c, _, t, f, _ = val
1129
+ result = new_if c, f, t
1112
1130
  }
1113
- | kUNTIL
1131
+ | k_while expr_value_do compstmt k_end
1114
1132
  {
1115
- lexer.cond.push true
1116
- }
1117
- expr_value do
1118
- {
1119
- lexer.cond.pop
1133
+ _, cond, body, _ = val
1134
+ result = new_while body, cond, true
1120
1135
  }
1121
- compstmt kEND
1136
+ | k_until expr_value_do compstmt k_end
1122
1137
  {
1123
- result = new_until val[5], val[2], true
1138
+ _, cond, body, _ = val
1139
+ result = new_until body, cond, true
1124
1140
  }
1125
- | kCASE expr_value opt_terms case_body kEND
1141
+ | k_case expr_value opt_terms case_body k_end
1126
1142
  {
1127
1143
  (_, line), expr, _, body, _ = val
1128
1144
  result = new_case expr, body, line
1129
1145
  }
1130
- | kCASE opt_terms case_body kEND
1146
+ | k_case opt_terms case_body k_end
1131
1147
  {
1132
1148
  (_, line), _, body, _ = val
1133
1149
  result = new_case nil, body, line
1134
1150
  }
1135
- | kFOR for_var kIN
1151
+ | k_for for_var kIN expr_value_do compstmt k_end
1136
1152
  {
1137
- lexer.cond.push true
1138
- }
1139
- expr_value do
1140
- {
1141
- lexer.cond.pop
1153
+ _, var, _, iter, body, _ = val
1154
+ result = new_for iter, var, body
1142
1155
  }
1143
- compstmt kEND
1144
- {
1145
- result = new_for val[4], val[1], val[7]
1146
- }
1147
- | kCLASS
1156
+ | k_class
1148
1157
  {
1149
1158
  result = self.lexer.lineno
1150
1159
  }
@@ -1156,13 +1165,13 @@ rule
1156
1165
  end
1157
1166
  self.env.extend
1158
1167
  }
1159
- bodystmt kEND
1168
+ bodystmt k_end
1160
1169
  {
1161
1170
  result = new_class val
1162
1171
  self.env.unextend
1163
1172
  self.lexer.comments # we don't care about comments in the body
1164
1173
  }
1165
- | kCLASS tLSHFT
1174
+ | k_class tLSHFT
1166
1175
  {
1167
1176
  result = self.lexer.lineno
1168
1177
  }
@@ -1177,13 +1186,13 @@ rule
1177
1186
  self.in_single = 0
1178
1187
  self.env.extend
1179
1188
  }
1180
- bodystmt kEND
1189
+ bodystmt k_end
1181
1190
  {
1182
1191
  result = new_sclass val
1183
1192
  self.env.unextend
1184
1193
  self.lexer.comments # we don't care about comments in the body
1185
1194
  }
1186
- | kMODULE
1195
+ | k_module
1187
1196
  {
1188
1197
  result = self.lexer.lineno
1189
1198
  }
@@ -1195,13 +1204,13 @@ rule
1195
1204
 
1196
1205
  self.env.extend
1197
1206
  }
1198
- bodystmt kEND
1207
+ bodystmt k_end
1199
1208
  {
1200
1209
  result = new_module val
1201
1210
  self.env.unextend
1202
1211
  self.lexer.comments # we don't care about comments in the body
1203
1212
  }
1204
- | kDEF fname
1213
+ | k_def fname
1205
1214
  {
1206
1215
  result = [self.in_def, self.lexer.cmdarg.stack.dup]
1207
1216
 
@@ -1212,7 +1221,7 @@ rule
1212
1221
  # TODO: port local_push_gen and local_pop_gen
1213
1222
  lexer.cmdarg.stack.replace [false]
1214
1223
  }
1215
- f_arglist bodystmt kEND
1224
+ f_arglist bodystmt k_end
1216
1225
  {
1217
1226
  in_def, cmdarg = val[2]
1218
1227
 
@@ -1223,7 +1232,7 @@ rule
1223
1232
  self.in_def = in_def
1224
1233
  self.lexer.comments # we don't care about comments in the body
1225
1234
  }
1226
- | kDEF singleton dot_or_colon
1235
+ | k_def singleton dot_or_colon
1227
1236
  {
1228
1237
  self.comments.push self.lexer.comments
1229
1238
  lexer.lex_state = :expr_fname
@@ -1236,7 +1245,7 @@ rule
1236
1245
  result = [lexer.lineno, self.lexer.cmdarg.stack.dup]
1237
1246
  lexer.cmdarg.stack.replace [false]
1238
1247
  }
1239
- f_arglist bodystmt kEND
1248
+ f_arglist bodystmt k_end
1240
1249
  {
1241
1250
  line, cmdarg = val[5]
1242
1251
  result = new_defs val
@@ -1281,7 +1290,15 @@ rule
1281
1290
  k_class: kCLASS
1282
1291
  k_module: kMODULE
1283
1292
  k_def: kDEF
1293
+ k_do: kDO
1294
+ k_do_block: kDO_BLOCK
1295
+ k_rescue: kRESCUE
1296
+ k_ensure: kENSURE
1297
+ k_when: kWHEN
1298
+ k_else: kELSE
1299
+ k_elsif: kELSIF
1284
1300
  k_end: kEND
1301
+ k_return: kRETURN
1285
1302
 
1286
1303
  then: term
1287
1304
  | kTHEN
@@ -1291,7 +1308,7 @@ rule
1291
1308
  | kDO_COND
1292
1309
 
1293
1310
  if_tail: opt_else
1294
- | kELSIF expr_value then compstmt if_tail
1311
+ | k_elsif expr_value then compstmt if_tail
1295
1312
  {
1296
1313
  result = s(:if, val[1], val[3], val[4])
1297
1314
  }
@@ -1462,18 +1479,22 @@ opt_block_args_tail: tCOMMA block_args_tail
1462
1479
 
1463
1480
  opt_block_param: none { result = 0 }
1464
1481
  | block_param_def
1482
+ {
1483
+ self.lexer.command_start = true
1484
+ }
1465
1485
 
1466
1486
  block_param_def: tPIPE opt_bv_decl tPIPE
1467
1487
  {
1488
+ # TODO: current_arg = 0
1468
1489
  result = args val
1469
1490
  }
1470
1491
  | tOROP
1471
1492
  {
1472
- self.lexer.command_start = true
1473
1493
  result = s(:args)
1474
1494
  }
1475
1495
  | tPIPE block_param opt_bv_decl tPIPE
1476
1496
  {
1497
+ # TODO: current_arg = 0
1477
1498
  result = args val
1478
1499
  }
1479
1500
 
@@ -1506,13 +1527,21 @@ opt_block_args_tail: tCOMMA block_args_tail
1506
1527
  lexer.paren_nest += 1
1507
1528
  lexer.lpar_beg = lexer.paren_nest
1508
1529
  }
1509
- f_larglist lambda_body
1530
+ f_larglist
1510
1531
  {
1511
- lpar, args, body = val
1532
+ result = [lexer.cmdarg.store(false), self.lexer.lineno]
1533
+ }
1534
+ lambda_body
1535
+ {
1536
+ lpar, args, (cmdarg, lineno), body = val
1512
1537
  lexer.lpar_beg = lpar
1513
1538
 
1539
+ lexer.cmdarg.restore cmdarg
1540
+ lexer.cmdarg.lexpop
1541
+
1514
1542
  call = new_call nil, :lambda
1515
1543
  result = new_iter call, args, body
1544
+ result.line = lineno
1516
1545
  self.env.unextend
1517
1546
  }
1518
1547
 
@@ -1530,28 +1559,15 @@ opt_block_args_tail: tCOMMA block_args_tail
1530
1559
  {
1531
1560
  result = val[1]
1532
1561
  }
1533
- | kDO_LAMBDA compstmt kEND
1562
+ | kDO_LAMBDA bodystmt kEND
1534
1563
  {
1535
1564
  result = val[1]
1536
1565
  }
1537
1566
 
1538
- do_block: kDO_BLOCK
1567
+ do_block: k_do_block do_body kEND
1539
1568
  {
1540
- self.env.extend :dynamic
1541
- result = self.lexer.lineno
1542
- }
1543
- opt_block_param
1544
- {
1545
- result = nil # self.env.dynamic.keys
1546
- }
1547
- compstmt kEND
1548
- {
1549
- args = val[2]
1550
- body = val[4]
1551
- result = new_iter nil, args, body
1552
- result.line = val[1]
1553
-
1554
- self.env.unextend
1569
+ # TODO: maybe fix lineno to kDO's lineno?
1570
+ result = val[1]
1555
1571
  }
1556
1572
 
1557
1573
  block_call: command do_block
@@ -1568,11 +1584,11 @@ opt_block_args_tail: tCOMMA block_args_tail
1568
1584
  result = val[1]
1569
1585
  result.insert 1, val[0]
1570
1586
  }
1571
- | block_call dot_or_colon operation2 opt_paren_args
1587
+ | block_call call_op2 operation2 opt_paren_args
1572
1588
  {
1573
1589
  result = new_call val[0], val[2].to_sym, val[3]
1574
1590
  }
1575
- | block_call dot_or_colon operation2 opt_paren_args brace_block
1591
+ | block_call call_op2 operation2 opt_paren_args brace_block
1576
1592
  {
1577
1593
  iter1, _, name, args, iter2 = val
1578
1594
 
@@ -1581,7 +1597,7 @@ opt_block_args_tail: tCOMMA block_args_tail
1581
1597
 
1582
1598
  result = iter2
1583
1599
  }
1584
- | block_call dot_or_colon operation2 command_args do_block
1600
+ | block_call call_op2 operation2 command_args do_block
1585
1601
  {
1586
1602
  iter1, _, name, args, iter2 = val
1587
1603
 
@@ -1638,43 +1654,55 @@ opt_block_args_tail: tCOMMA block_args_tail
1638
1654
  self.env.extend :dynamic
1639
1655
  result = self.lexer.lineno
1640
1656
  }
1641
- opt_block_param
1642
- {
1643
- result = nil # self.env.dynamic.keys
1644
- }
1645
- compstmt tRCURLY
1657
+ brace_body tRCURLY
1646
1658
  {
1647
- _, line, args, _, body, _ = val
1659
+ _, line, body, _ = val
1648
1660
 
1649
- result = new_iter nil, args, body
1661
+ result = body
1650
1662
  result.line = line
1651
1663
 
1652
1664
  self.env.unextend
1653
1665
  }
1654
- | kDO
1666
+ | k_do
1655
1667
  {
1656
1668
  self.env.extend :dynamic
1657
1669
  result = self.lexer.lineno
1658
1670
  }
1659
- opt_block_param
1671
+ do_body kEND
1660
1672
  {
1661
- result = nil # self.env.dynamic.keys
1673
+ _, line, body, _ = val
1674
+
1675
+ result = body
1676
+ result.line = line
1677
+
1678
+ self.env.unextend
1662
1679
  }
1663
- #if V >= 25
1664
- bodystmt kEND
1665
- #else
1666
- compstmt kEND
1667
- #endif
1680
+
1681
+ brace_body: { self.env.extend :dynamic; result = self.lexer.lineno }
1682
+ { result = lexer.cmdarg.store(false) }
1683
+ opt_block_param compstmt
1668
1684
  {
1669
- _, line, args, _, body, _ = val
1685
+ line, cmdarg, param, cmpstmt = val
1670
1686
 
1671
- result = new_iter nil, args, body
1672
- result.line = line
1687
+ result = new_brace_body param, cmpstmt, line
1688
+ self.env.unextend
1689
+ lexer.cmdarg.restore cmdarg
1690
+ lexer.cmdarg.pop # because of: cmdarg_stack >> 1 ?
1691
+ }
1673
1692
 
1693
+ do_body: { self.env.extend :dynamic; result = self.lexer.lineno }
1694
+ { result = lexer.cmdarg.store(false) }
1695
+ opt_block_param
1696
+ compstmt
1697
+ {
1698
+ line, cmdarg, param, cmpstmt = val
1699
+
1700
+ result = new_do_body param, cmpstmt, line
1674
1701
  self.env.unextend
1702
+ lexer.cmdarg.restore cmdarg
1675
1703
  }
1676
1704
 
1677
- case_body: kWHEN
1705
+ case_body: k_when
1678
1706
  {
1679
1707
  result = self.lexer.lineno
1680
1708
  }
@@ -1687,7 +1715,7 @@ opt_block_args_tail: tCOMMA block_args_tail
1687
1715
 
1688
1716
  cases: opt_else | case_body
1689
1717
 
1690
- opt_rescue: kRESCUE exc_list exc_var then compstmt opt_rescue
1718
+ opt_rescue: k_rescue exc_list exc_var then compstmt opt_rescue
1691
1719
  {
1692
1720
  (_, line), klasses, var, _, body, rest = val
1693
1721
 
@@ -1716,7 +1744,7 @@ opt_block_args_tail: tCOMMA block_args_tail
1716
1744
  }
1717
1745
  | none
1718
1746
 
1719
- opt_ensure: kENSURE compstmt
1747
+ opt_ensure: k_ensure compstmt
1720
1748
  {
1721
1749
  _, body = val
1722
1750
 
@@ -1883,7 +1911,7 @@ regexp_contents: none
1883
1911
  result = lexer.lex_strterm
1884
1912
 
1885
1913
  lexer.lex_strterm = nil
1886
- lexer.lex_state = :expr_beg # TODO: expr_value ?
1914
+ lexer.lex_state = :expr_beg
1887
1915
  }
1888
1916
  string_dvar
1889
1917
  {
@@ -1904,15 +1932,11 @@ regexp_contents: none
1904
1932
  lexer.brace_nest = 0
1905
1933
  lexer.string_nest = 0
1906
1934
 
1907
- lexer.lex_state = :expr_value
1935
+ lexer.lex_state = :expr_beg
1908
1936
  }
1909
- compstmt tRCURLY
1937
+ compstmt
1938
+ tSTRING_DEND
1910
1939
  {
1911
- #if V == 20
1912
- # TODO: tRCURLY -> tSTRING_DEND
1913
- #else
1914
- # TODO: tRCURLY -> tSTRING_END
1915
- #endif
1916
1940
  _, memo, stmt, _ = val
1917
1941
 
1918
1942
  lex_strterm, brace_nest, string_nest, oldcond, oldcmdarg, oldlex_state = memo
@@ -1978,31 +2002,17 @@ regexp_contents: none
1978
2002
  end
1979
2003
  }
1980
2004
 
1981
- #if V == 20
1982
- numeric: tINTEGER
1983
- | tFLOAT
1984
- | tUMINUS_NUM tINTEGER =tLOWEST
1985
- #else
1986
2005
  numeric: simple_numeric
1987
2006
  | tUMINUS_NUM simple_numeric
1988
- #endif
1989
- {
1990
- result = -val[1] # TODO: pt_testcase
1991
- #if V == 20
1992
- }
1993
- | tUMINUS_NUM tFLOAT =tLOWEST
1994
2007
  {
1995
2008
  result = -val[1] # TODO: pt_testcase
1996
- #endif
1997
2009
  }
1998
2010
 
1999
- #if V >= 21
2000
2011
  simple_numeric: tINTEGER
2001
2012
  | tFLOAT
2002
2013
  | tRATIONAL
2003
2014
  | tIMAGINARY
2004
2015
 
2005
- #endif
2006
2016
  user_variable: tIDENTIFIER
2007
2017
  | tIVAR
2008
2018
  | tGVAR
@@ -2049,23 +2059,18 @@ keyword_variable: kNIL { result = s(:nil) }
2049
2059
  backref: tNTH_REF { result = s(:nth_ref, val[0]) }
2050
2060
  | tBACK_REF { result = s(:back_ref, val[0]) }
2051
2061
 
2052
- superclass: term
2053
- {
2054
- result = nil
2055
- }
2056
- | tLT
2062
+ superclass: tLT
2057
2063
  {
2058
2064
  lexer.lex_state = :expr_beg
2065
+ lexer.command_start = true
2059
2066
  }
2060
2067
  expr_value term
2061
2068
  {
2062
2069
  result = val[2]
2063
2070
  }
2064
- | error term
2071
+ | none
2065
2072
  {
2066
- yyerrok
2067
2073
  result = nil
2068
- debug20 30, val, result
2069
2074
  }
2070
2075
 
2071
2076
  f_arglist: tLPAREN2 f_args rparen
@@ -2073,16 +2078,20 @@ keyword_variable: kNIL { result = s(:nil) }
2073
2078
  result = val[1]
2074
2079
  self.lexer.lex_state = :expr_beg
2075
2080
  self.lexer.command_start = true
2076
- # TODO:
2077
- # $<num>$ = parser->parser_in_kwarg;
2078
- # parser->parser_in_kwarg = 1;
2079
2081
  }
2080
- | f_args term
2082
+ | {
2083
+ result = self.in_kwarg
2084
+ self.in_kwarg = true
2085
+ # TODO: self.lexer.lex_state |= :expr_label
2086
+ }
2087
+ f_args term
2081
2088
  {
2082
- # TODO: parser->parser_in_kwarg = $<num>1;
2083
- result = val[0]
2084
- self.lexer.lex_state = :expr_beg
2085
- self.lexer.command_start = true
2089
+ kwarg, args, _ = val
2090
+
2091
+ self.in_kwarg = kwarg
2092
+ result = args
2093
+ lexer.lex_state = :expr_beg
2094
+ lexer.command_start = true
2086
2095
  }
2087
2096
 
2088
2097
  args_tail: f_kwarg tCOMMA f_kwrest opt_f_block_arg
@@ -2195,7 +2204,6 @@ keyword_variable: kNIL { result = s(:nil) }
2195
2204
  result = identifier
2196
2205
  }
2197
2206
 
2198
- #if V >= 22
2199
2207
  f_arg_asgn: f_norm_arg
2200
2208
 
2201
2209
  f_arg_item: f_arg_asgn
@@ -2203,13 +2211,6 @@ keyword_variable: kNIL { result = s(:nil) }
2203
2211
  {
2204
2212
  result = val[1]
2205
2213
  }
2206
- #else
2207
- f_arg_item: f_norm_arg
2208
- | tLPAREN f_margs rparen
2209
- {
2210
- result = val[1]
2211
- }
2212
- #endif
2213
2214
 
2214
2215
  f_arg: f_arg_item
2215
2216
  {
@@ -2237,13 +2238,9 @@ keyword_variable: kNIL { result = s(:nil) }
2237
2238
  result << item
2238
2239
  }
2239
2240
 
2240
- #if V == 20
2241
- f_kw: tLABEL arg_value
2242
- #else
2243
2241
  f_label: tLABEL
2244
2242
 
2245
2243
  f_kw: f_label arg_value
2246
- #endif
2247
2244
  {
2248
2245
  # TODO: call_args
2249
2246
  label, _ = val[0] # TODO: fix lineno?
@@ -2252,7 +2249,6 @@ keyword_variable: kNIL { result = s(:nil) }
2252
2249
 
2253
2250
  result = s(:array, s(:kwarg, identifier, val[1]))
2254
2251
  }
2255
- #if V >= 21
2256
2252
  | f_label
2257
2253
  {
2258
2254
  label, _ = val[0] # TODO: fix lineno?
@@ -2261,13 +2257,8 @@ keyword_variable: kNIL { result = s(:nil) }
2261
2257
 
2262
2258
  result = s(:array, s(:kwarg, identifier))
2263
2259
  }
2264
- #endif
2265
2260
 
2266
- #if V == 20
2267
- f_block_kw: tLABEL primary_value
2268
- #else
2269
2261
  f_block_kw: f_label primary_value
2270
- #endif
2271
2262
  {
2272
2263
  # TODO: call_args
2273
2264
  label, _ = val[0] # TODO: fix lineno?
@@ -2276,7 +2267,6 @@ keyword_variable: kNIL { result = s(:nil) }
2276
2267
 
2277
2268
  result = s(:array, s(:kwarg, identifier, val[1]))
2278
2269
  }
2279
- #if V >= 21
2280
2270
  | f_label
2281
2271
  {
2282
2272
  label, _ = val[0] # TODO: fix lineno?
@@ -2285,7 +2275,6 @@ keyword_variable: kNIL { result = s(:nil) }
2285
2275
 
2286
2276
  result = s(:array, s(:kwarg, identifier))
2287
2277
  }
2288
- #endif
2289
2278
 
2290
2279
  f_block_kwarg: f_block_kw
2291
2280
  | f_block_kwarg tCOMMA f_block_kw
@@ -2305,32 +2294,22 @@ keyword_variable: kNIL { result = s(:nil) }
2305
2294
 
2306
2295
  f_kwrest: kwrest_mark tIDENTIFIER
2307
2296
  {
2308
- result = :"**#{val[1]}"
2297
+ name = val[1].to_sym
2298
+ self.assignable name
2299
+ result = :"**#{name}"
2309
2300
  }
2310
2301
  | kwrest_mark
2311
2302
  {
2312
2303
  result = :"**"
2313
2304
  }
2314
2305
 
2315
- #if V == 20
2316
- f_opt: tIDENTIFIER tEQL arg_value
2317
- #elif V == 21
2318
- f_opt: f_norm_arg tEQL arg_value
2319
- #else
2320
2306
  f_opt: f_arg_asgn tEQL arg_value
2321
- #endif
2322
2307
  {
2323
2308
  result = self.assignable val[0], val[2]
2324
2309
  # TODO: detect duplicate names
2325
2310
  }
2326
2311
 
2327
- #if V == 20
2328
- f_block_opt: tIDENTIFIER tEQL primary_value
2329
- #elif V == 21
2330
- f_block_opt: f_norm_arg tEQL primary_value
2331
- #else
2332
2312
  f_block_opt: f_arg_asgn tEQL primary_value
2333
- #endif
2334
2313
  {
2335
2314
  result = self.assignable val[0], val[2]
2336
2315
  }
@@ -2424,23 +2403,17 @@ keyword_variable: kNIL { result = s(:nil) }
2424
2403
  {
2425
2404
  result = s(:array, val[0], val[2])
2426
2405
  }
2427
- | tLABEL opt_nl arg_value
2406
+ | tLABEL arg_value
2428
2407
  {
2429
- result = s(:array, s(:lit, val[0][0].to_sym), val.last)
2408
+ (label, _), arg = val
2409
+ result = s(:array, s(:lit, label.to_sym), arg)
2430
2410
  }
2431
- #if V >= 22
2432
2411
  | tSTRING_BEG string_contents tLABEL_END arg_value
2433
2412
  {
2434
2413
  _, sym, _, value = val
2435
2414
  sym.sexp_type = :dsym
2436
2415
  result = s(:array, sym, value)
2437
2416
  }
2438
- | tSYMBOL arg_value
2439
- {
2440
- raise "not yet: #{val.inspect}"
2441
- # result = s(:array, s(:lit, val[1].to_sym), val[1])
2442
- }
2443
- #endif
2444
2417
  | tDSTAR arg_value
2445
2418
  {
2446
2419
  result = s(:array, s(:kwsplat, val[1]))
@@ -2451,9 +2424,10 @@ keyword_variable: kNIL { result = s(:nil) }
2451
2424
  operation3: tIDENTIFIER | tFID | op
2452
2425
  dot_or_colon: tDOT | tCOLON2
2453
2426
  call_op: tDOT
2454
- #if V >= 23
2455
- | tLONELY
2456
- #endif
2427
+
2428
+ call_op2: call_op
2429
+ | tCOLON2
2430
+
2457
2431
  opt_terms: | terms
2458
2432
  opt_nl: | tNL
2459
2433
  rparen: opt_nl tRPAREN