brakeman 4.6.1 → 4.7.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 (251) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +11 -0
  3. data/bundle/load.rb +7 -7
  4. data/bundle/ruby/2.6.0/gems/{haml-4.0.7 → haml-5.1.2}/CHANGELOG.md +122 -4
  5. data/bundle/ruby/2.6.0/gems/{haml-4.0.7 → haml-5.1.2}/FAQ.md +4 -14
  6. data/bundle/ruby/2.6.0/gems/haml-5.1.2/Gemfile +19 -0
  7. data/bundle/ruby/2.6.0/gems/{haml-4.0.7 → haml-5.1.2}/MIT-LICENSE +2 -2
  8. data/bundle/ruby/2.6.0/gems/{haml-4.0.7 → haml-5.1.2}/README.md +80 -42
  9. data/bundle/ruby/2.6.0/gems/{haml-4.0.7 → haml-5.1.2}/REFERENCE.md +121 -64
  10. data/bundle/ruby/2.6.0/gems/haml-5.1.2/TODO +24 -0
  11. data/bundle/ruby/2.6.0/gems/haml-5.1.2/haml.gemspec +44 -0
  12. data/bundle/ruby/2.6.0/gems/{haml-4.0.7 → haml-5.1.2}/lib/haml.rb +2 -0
  13. data/bundle/ruby/2.6.0/gems/haml-5.1.2/lib/haml/attribute_builder.rb +164 -0
  14. data/bundle/ruby/2.6.0/gems/haml-5.1.2/lib/haml/attribute_compiler.rb +224 -0
  15. data/bundle/ruby/2.6.0/gems/haml-5.1.2/lib/haml/attribute_parser.rb +150 -0
  16. data/bundle/ruby/2.6.0/gems/{haml-4.0.7 → haml-5.1.2}/lib/haml/buffer.rb +25 -132
  17. data/bundle/ruby/2.6.0/gems/haml-5.1.2/lib/haml/compiler.rb +330 -0
  18. data/bundle/ruby/2.6.0/gems/{haml-4.0.7 → haml-5.1.2}/lib/haml/engine.rb +34 -41
  19. data/bundle/ruby/2.6.0/gems/haml-5.1.2/lib/haml/error.rb +65 -0
  20. data/bundle/ruby/2.6.0/gems/haml-5.1.2/lib/haml/escapable.rb +50 -0
  21. data/bundle/ruby/2.6.0/gems/{haml-4.0.7 → haml-5.1.2}/lib/haml/exec.rb +38 -20
  22. data/bundle/ruby/2.6.0/gems/{haml-4.0.7 → haml-5.1.2}/lib/haml/filters.rb +22 -27
  23. data/bundle/ruby/2.6.0/gems/haml-5.1.2/lib/haml/generator.rb +42 -0
  24. data/bundle/ruby/2.6.0/gems/{haml-4.0.7 → haml-5.1.2}/lib/haml/helpers.rb +129 -90
  25. data/bundle/ruby/2.6.0/gems/{haml-4.0.7 → haml-5.1.2}/lib/haml/helpers/action_view_extensions.rb +4 -2
  26. data/bundle/ruby/2.6.0/gems/{haml-4.0.7 → haml-5.1.2}/lib/haml/helpers/action_view_mods.rb +45 -60
  27. data/bundle/ruby/2.6.0/gems/{haml-4.0.7 → haml-5.1.2}/lib/haml/helpers/action_view_xss_mods.rb +2 -0
  28. data/bundle/ruby/2.6.0/gems/haml-5.1.2/lib/haml/helpers/safe_erubi_template.rb +20 -0
  29. data/bundle/ruby/2.6.0/gems/{haml-4.0.7 → haml-5.1.2}/lib/haml/helpers/safe_erubis_template.rb +5 -1
  30. data/bundle/ruby/2.6.0/gems/{haml-4.0.7 → haml-5.1.2}/lib/haml/helpers/xss_mods.rb +19 -12
  31. data/bundle/ruby/2.6.0/gems/{haml-4.0.7 → haml-5.1.2}/lib/haml/options.rb +63 -69
  32. data/bundle/ruby/2.6.0/gems/{haml-4.0.7 → haml-5.1.2}/lib/haml/parser.rb +292 -228
  33. data/bundle/ruby/2.6.0/gems/haml-5.1.2/lib/haml/plugin.rb +37 -0
  34. data/bundle/ruby/2.6.0/gems/haml-5.1.2/lib/haml/railtie.rb +48 -0
  35. data/bundle/ruby/2.6.0/gems/{haml-4.0.7 → haml-5.1.2}/lib/haml/sass_rails_filter.rb +18 -4
  36. data/bundle/ruby/2.6.0/gems/{haml-4.0.7 → haml-5.1.2}/lib/haml/template.rb +13 -6
  37. data/bundle/ruby/2.6.0/gems/{haml-4.0.7 → haml-5.1.2}/lib/haml/template/options.rb +13 -2
  38. data/bundle/ruby/2.6.0/gems/haml-5.1.2/lib/haml/temple_engine.rb +123 -0
  39. data/bundle/ruby/2.6.0/gems/haml-5.1.2/lib/haml/temple_line_counter.rb +30 -0
  40. data/bundle/ruby/2.6.0/gems/haml-5.1.2/lib/haml/util.rb +258 -0
  41. data/bundle/ruby/2.6.0/gems/haml-5.1.2/lib/haml/version.rb +5 -0
  42. data/bundle/ruby/2.6.0/gems/haml-5.1.2/yard/default/fulldoc/html/css/common.sass +15 -0
  43. data/bundle/ruby/2.6.0/gems/haml-5.1.2/yard/default/layout/html/footer.erb +12 -0
  44. data/bundle/ruby/2.6.0/gems/{highline-2.0.2 → highline-2.0.3}/AUTHORS +0 -0
  45. data/bundle/ruby/2.6.0/gems/{highline-2.0.2 → highline-2.0.3}/COPYING +0 -0
  46. data/bundle/ruby/2.6.0/gems/{highline-2.0.2 → highline-2.0.3}/Changelog.md +3 -0
  47. data/bundle/ruby/2.6.0/gems/{highline-2.0.2 → highline-2.0.3}/Gemfile +0 -0
  48. data/bundle/ruby/2.6.0/gems/{highline-2.0.2 → highline-2.0.3}/LICENSE +0 -0
  49. data/bundle/ruby/2.6.0/gems/{highline-2.0.2 → highline-2.0.3}/README.md +0 -0
  50. data/bundle/ruby/2.6.0/gems/{highline-2.0.2 → highline-2.0.3}/TODO +0 -0
  51. data/bundle/ruby/2.6.0/gems/{highline-2.0.2 → highline-2.0.3}/appveyor.yml +0 -0
  52. data/bundle/ruby/2.6.0/gems/{highline-2.0.2 → highline-2.0.3}/highline.gemspec +0 -0
  53. data/bundle/ruby/2.6.0/gems/{highline-2.0.2 → highline-2.0.3}/lib/highline.rb +0 -0
  54. data/bundle/ruby/2.6.0/gems/{highline-2.0.2 → highline-2.0.3}/lib/highline/builtin_styles.rb +0 -0
  55. data/bundle/ruby/2.6.0/gems/{highline-2.0.2 → highline-2.0.3}/lib/highline/color_scheme.rb +0 -0
  56. data/bundle/ruby/2.6.0/gems/{highline-2.0.2 → highline-2.0.3}/lib/highline/compatibility.rb +0 -0
  57. data/bundle/ruby/2.6.0/gems/{highline-2.0.2 → highline-2.0.3}/lib/highline/custom_errors.rb +0 -0
  58. data/bundle/ruby/2.6.0/gems/{highline-2.0.2 → highline-2.0.3}/lib/highline/import.rb +0 -0
  59. data/bundle/ruby/2.6.0/gems/{highline-2.0.2 → highline-2.0.3}/lib/highline/io_console_compatible.rb +0 -0
  60. data/bundle/ruby/2.6.0/gems/{highline-2.0.2 → highline-2.0.3}/lib/highline/list.rb +0 -0
  61. data/bundle/ruby/2.6.0/gems/{highline-2.0.2 → highline-2.0.3}/lib/highline/list_renderer.rb +0 -0
  62. data/bundle/ruby/2.6.0/gems/{highline-2.0.2 → highline-2.0.3}/lib/highline/menu.rb +0 -0
  63. data/bundle/ruby/2.6.0/gems/{highline-2.0.2 → highline-2.0.3}/lib/highline/menu/item.rb +0 -0
  64. data/bundle/ruby/2.6.0/gems/{highline-2.0.2 → highline-2.0.3}/lib/highline/paginator.rb +0 -0
  65. data/bundle/ruby/2.6.0/gems/{highline-2.0.2 → highline-2.0.3}/lib/highline/question.rb +0 -0
  66. data/bundle/ruby/2.6.0/gems/{highline-2.0.2 → highline-2.0.3}/lib/highline/question/answer_converter.rb +0 -0
  67. data/bundle/ruby/2.6.0/gems/{highline-2.0.2 → highline-2.0.3}/lib/highline/question_asker.rb +0 -0
  68. data/bundle/ruby/2.6.0/gems/{highline-2.0.2 → highline-2.0.3}/lib/highline/simulate.rb +0 -0
  69. data/bundle/ruby/2.6.0/gems/{highline-2.0.2 → highline-2.0.3}/lib/highline/statement.rb +0 -0
  70. data/bundle/ruby/2.6.0/gems/{highline-2.0.2 → highline-2.0.3}/lib/highline/string.rb +0 -0
  71. data/bundle/ruby/2.6.0/gems/{highline-2.0.2 → highline-2.0.3}/lib/highline/string_extensions.rb +0 -0
  72. data/bundle/ruby/2.6.0/gems/{highline-2.0.2 → highline-2.0.3}/lib/highline/style.rb +0 -0
  73. data/bundle/ruby/2.6.0/gems/{highline-2.0.2 → highline-2.0.3}/lib/highline/template_renderer.rb +0 -0
  74. data/bundle/ruby/2.6.0/gems/{highline-2.0.2 → highline-2.0.3}/lib/highline/terminal.rb +0 -0
  75. data/bundle/ruby/2.6.0/gems/{highline-2.0.2 → highline-2.0.3}/lib/highline/terminal/io_console.rb +0 -0
  76. data/bundle/ruby/2.6.0/gems/{highline-2.0.2 → highline-2.0.3}/lib/highline/terminal/ncurses.rb +0 -0
  77. data/bundle/ruby/2.6.0/gems/{highline-2.0.2 → highline-2.0.3}/lib/highline/terminal/unix_stty.rb +0 -0
  78. data/bundle/ruby/2.6.0/gems/{highline-2.0.2 → highline-2.0.3}/lib/highline/version.rb +1 -1
  79. data/bundle/ruby/2.6.0/gems/{highline-2.0.2 → highline-2.0.3}/lib/highline/wrapper.rb +0 -0
  80. data/bundle/ruby/2.6.0/gems/{ruby2ruby-2.4.3 → ruby2ruby-2.4.4}/History.rdoc +6 -0
  81. data/bundle/ruby/2.6.0/gems/{ruby2ruby-2.4.3 → ruby2ruby-2.4.4}/Manifest.txt +0 -0
  82. data/bundle/ruby/2.6.0/gems/{ruby2ruby-2.4.3 → ruby2ruby-2.4.4}/README.rdoc +0 -0
  83. data/bundle/ruby/2.6.0/gems/{ruby2ruby-2.4.3 → ruby2ruby-2.4.4}/lib/ruby2ruby.rb +3 -3
  84. data/bundle/ruby/2.6.0/gems/{ruby_parser-3.13.1 → ruby_parser-3.14.0}/History.rdoc +38 -0
  85. data/bundle/ruby/2.6.0/gems/{ruby_parser-3.13.1 → ruby_parser-3.14.0}/Manifest.txt +0 -0
  86. data/bundle/ruby/2.6.0/gems/{ruby_parser-3.13.1 → ruby_parser-3.14.0}/README.rdoc +3 -3
  87. data/bundle/ruby/2.6.0/gems/{ruby_parser-3.13.1 → ruby_parser-3.14.0}/compare/normalize.rb +0 -0
  88. data/bundle/ruby/2.6.0/gems/{ruby_parser-3.13.1 → ruby_parser-3.14.0}/debugging.md +0 -0
  89. data/bundle/ruby/2.6.0/gems/{ruby_parser-3.13.1 → ruby_parser-3.14.0}/lib/rp_extensions.rb +0 -0
  90. data/bundle/ruby/2.6.0/gems/{ruby_parser-3.13.1 → ruby_parser-3.14.0}/lib/rp_stringscanner.rb +0 -0
  91. data/bundle/ruby/2.6.0/gems/ruby_parser-3.14.0/lib/ruby20_parser.rb +7045 -0
  92. data/bundle/ruby/2.6.0/gems/{ruby_parser-3.13.1/lib/ruby_parser.yy → ruby_parser-3.14.0/lib/ruby20_parser.y} +390 -397
  93. data/bundle/ruby/2.6.0/gems/ruby_parser-3.14.0/lib/ruby21_parser.rb +7116 -0
  94. data/bundle/ruby/2.6.0/gems/{ruby_parser-3.13.1 → ruby_parser-3.14.0}/lib/ruby21_parser.y +399 -254
  95. data/bundle/ruby/2.6.0/gems/ruby_parser-3.14.0/lib/ruby22_parser.rb +7149 -0
  96. data/bundle/ruby/2.6.0/gems/{ruby_parser-3.13.1 → ruby_parser-3.14.0}/lib/ruby22_parser.y +400 -255
  97. data/bundle/ruby/2.6.0/gems/ruby_parser-3.14.0/lib/ruby23_parser.rb +7166 -0
  98. data/bundle/ruby/2.6.0/gems/{ruby_parser-3.13.1 → ruby_parser-3.14.0}/lib/ruby23_parser.y +400 -255
  99. data/bundle/ruby/2.6.0/gems/ruby_parser-3.14.0/lib/ruby24_parser.rb +7178 -0
  100. data/bundle/ruby/2.6.0/gems/{ruby_parser-3.13.1 → ruby_parser-3.14.0}/lib/ruby24_parser.y +404 -257
  101. data/bundle/ruby/2.6.0/gems/ruby_parser-3.14.0/lib/ruby25_parser.rb +7178 -0
  102. data/bundle/ruby/2.6.0/gems/{ruby_parser-3.13.1 → ruby_parser-3.14.0}/lib/ruby25_parser.y +404 -257
  103. data/bundle/ruby/2.6.0/gems/ruby_parser-3.14.0/lib/ruby26_parser.rb +7198 -0
  104. data/bundle/ruby/2.6.0/gems/{ruby_parser-3.13.1 → ruby_parser-3.14.0}/lib/ruby26_parser.y +410 -261
  105. data/bundle/ruby/2.6.0/gems/{ruby_parser-3.13.1 → ruby_parser-3.14.0}/lib/ruby_lexer.rb +424 -432
  106. data/bundle/ruby/2.6.0/gems/{ruby_parser-3.13.1 → ruby_parser-3.14.0}/lib/ruby_lexer.rex +0 -0
  107. data/bundle/ruby/2.6.0/gems/{ruby_parser-3.13.1 → ruby_parser-3.14.0}/lib/ruby_lexer.rex.rb +1 -1
  108. data/bundle/ruby/2.6.0/gems/{ruby_parser-3.13.1 → ruby_parser-3.14.0}/lib/ruby_parser.rb +27 -27
  109. data/bundle/ruby/2.6.0/gems/ruby_parser-3.14.0/lib/ruby_parser.yy +2732 -0
  110. data/bundle/ruby/2.6.0/gems/{ruby_parser-3.13.1 → ruby_parser-3.14.0}/lib/ruby_parser_extras.rb +627 -406
  111. data/bundle/ruby/2.6.0/gems/{ruby_parser-3.13.1 → ruby_parser-3.14.0}/tools/munge.rb +1 -1
  112. data/bundle/ruby/2.6.0/gems/{ruby_parser-3.13.1 → ruby_parser-3.14.0}/tools/ripper.rb +13 -2
  113. data/bundle/ruby/2.6.0/gems/{sexp_processor-4.12.1 → sexp_processor-4.13.0}/History.rdoc +13 -0
  114. data/bundle/ruby/2.6.0/gems/{sexp_processor-4.12.1 → sexp_processor-4.13.0}/Manifest.txt +1 -0
  115. data/bundle/ruby/2.6.0/gems/{sexp_processor-4.12.1 → sexp_processor-4.13.0}/README.rdoc +0 -0
  116. data/bundle/ruby/2.6.0/gems/{sexp_processor-4.12.1 → sexp_processor-4.13.0}/lib/composite_sexp_processor.rb +0 -0
  117. data/bundle/ruby/2.6.0/gems/{sexp_processor-4.12.1 → sexp_processor-4.13.0}/lib/pt_testcase.rb +0 -0
  118. data/bundle/ruby/2.6.0/gems/sexp_processor-4.13.0/lib/sexp.rb +381 -0
  119. data/bundle/ruby/2.6.0/gems/{sexp_processor-4.12.1/lib/sexp.rb → sexp_processor-4.13.0/lib/sexp_matcher.rb} +25 -385
  120. data/bundle/ruby/2.6.0/gems/{sexp_processor-4.12.1 → sexp_processor-4.13.0}/lib/sexp_processor.rb +1 -1
  121. data/bundle/ruby/2.6.0/gems/{sexp_processor-4.12.1 → sexp_processor-4.13.0}/lib/strict_sexp.rb +0 -0
  122. data/bundle/ruby/2.6.0/gems/{sexp_processor-4.12.1 → sexp_processor-4.13.0}/lib/unique.rb +0 -0
  123. data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/CHANGES +5 -0
  124. data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/EXPRESSIONS.md +0 -0
  125. data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/Gemfile +0 -0
  126. data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/LICENSE +0 -0
  127. data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/README.md +1 -1
  128. data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple.rb +0 -0
  129. data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/engine.rb +0 -0
  130. data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/erb/engine.rb +0 -0
  131. data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/erb/parser.rb +0 -0
  132. data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/erb/template.rb +0 -0
  133. data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/erb/trimming.rb +0 -0
  134. data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/exceptions.rb +0 -0
  135. data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/filter.rb +0 -0
  136. data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/filters/code_merger.rb +0 -0
  137. data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/filters/control_flow.rb +0 -0
  138. data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/filters/dynamic_inliner.rb +0 -0
  139. data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/filters/encoding.rb +0 -0
  140. data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/filters/eraser.rb +0 -0
  141. data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/filters/escapable.rb +0 -0
  142. data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/filters/multi_flattener.rb +0 -0
  143. data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/filters/remove_bom.rb +0 -0
  144. data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/filters/static_analyzer.rb +0 -0
  145. data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/filters/static_merger.rb +0 -0
  146. data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/filters/string_splitter.rb +1 -1
  147. data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/filters/validator.rb +0 -0
  148. data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/generator.rb +0 -0
  149. data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/generators/array.rb +0 -0
  150. data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/generators/array_buffer.rb +0 -0
  151. data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/generators/erb.rb +0 -0
  152. data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/generators/rails_output_buffer.rb +0 -0
  153. data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/generators/string_buffer.rb +0 -0
  154. data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/grammar.rb +0 -0
  155. data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/html/attribute_merger.rb +0 -0
  156. data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/html/attribute_remover.rb +0 -0
  157. data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/html/attribute_sorter.rb +0 -0
  158. data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/html/dispatcher.rb +0 -0
  159. data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/html/fast.rb +0 -0
  160. data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/html/filter.rb +0 -0
  161. data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/html/pretty.rb +0 -0
  162. data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/html/safe.rb +0 -0
  163. data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/map.rb +0 -0
  164. data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/mixins/dispatcher.rb +0 -0
  165. data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/mixins/engine_dsl.rb +0 -0
  166. data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/mixins/grammar_dsl.rb +0 -0
  167. data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/mixins/options.rb +0 -0
  168. data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/mixins/template.rb +0 -0
  169. data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/parser.rb +0 -0
  170. data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/static_analyzer.rb +1 -1
  171. data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/templates.rb +0 -0
  172. data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/templates/rails.rb +0 -0
  173. data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/templates/tilt.rb +0 -0
  174. data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/lib/temple/utils.rb +0 -0
  175. data/bundle/ruby/2.6.0/gems/temple-0.8.2/lib/temple/version.rb +3 -0
  176. data/bundle/ruby/2.6.0/gems/{temple-0.8.1 → temple-0.8.2}/temple.gemspec +0 -0
  177. data/bundle/ruby/2.6.0/gems/{tilt-2.0.9 → tilt-2.0.10}/COPYING +0 -0
  178. data/bundle/ruby/2.6.0/gems/{tilt-2.0.9 → tilt-2.0.10}/lib/tilt.rb +1 -1
  179. data/bundle/ruby/2.6.0/gems/{tilt-2.0.9 → tilt-2.0.10}/lib/tilt/asciidoc.rb +0 -0
  180. data/bundle/ruby/2.6.0/gems/{tilt-2.0.9 → tilt-2.0.10}/lib/tilt/babel.rb +0 -0
  181. data/bundle/ruby/2.6.0/gems/{tilt-2.0.9 → tilt-2.0.10}/lib/tilt/bluecloth.rb +0 -0
  182. data/bundle/ruby/2.6.0/gems/{tilt-2.0.9 → tilt-2.0.10}/lib/tilt/builder.rb +0 -0
  183. data/bundle/ruby/2.6.0/gems/{tilt-2.0.9 → tilt-2.0.10}/lib/tilt/coffee.rb +0 -0
  184. data/bundle/ruby/2.6.0/gems/{tilt-2.0.9 → tilt-2.0.10}/lib/tilt/commonmarker.rb +0 -0
  185. data/bundle/ruby/2.6.0/gems/{tilt-2.0.9 → tilt-2.0.10}/lib/tilt/creole.rb +0 -0
  186. data/bundle/ruby/2.6.0/gems/{tilt-2.0.9 → tilt-2.0.10}/lib/tilt/csv.rb +0 -0
  187. data/bundle/ruby/2.6.0/gems/{tilt-2.0.9 → tilt-2.0.10}/lib/tilt/dummy.rb +0 -0
  188. data/bundle/ruby/2.6.0/gems/{tilt-2.0.9 → tilt-2.0.10}/lib/tilt/erb.rb +0 -0
  189. data/bundle/ruby/2.6.0/gems/{tilt-2.0.9 → tilt-2.0.10}/lib/tilt/erubi.rb +0 -0
  190. data/bundle/ruby/2.6.0/gems/{tilt-2.0.9 → tilt-2.0.10}/lib/tilt/erubis.rb +0 -0
  191. data/bundle/ruby/2.6.0/gems/{tilt-2.0.9 → tilt-2.0.10}/lib/tilt/etanni.rb +0 -0
  192. data/bundle/ruby/2.6.0/gems/{tilt-2.0.9 → tilt-2.0.10}/lib/tilt/haml.rb +0 -0
  193. data/bundle/ruby/2.6.0/gems/{tilt-2.0.9 → tilt-2.0.10}/lib/tilt/kramdown.rb +0 -0
  194. data/bundle/ruby/2.6.0/gems/{tilt-2.0.9 → tilt-2.0.10}/lib/tilt/less.rb +0 -0
  195. data/bundle/ruby/2.6.0/gems/{tilt-2.0.9 → tilt-2.0.10}/lib/tilt/liquid.rb +0 -0
  196. data/bundle/ruby/2.6.0/gems/{tilt-2.0.9 → tilt-2.0.10}/lib/tilt/livescript.rb +0 -0
  197. data/bundle/ruby/2.6.0/gems/{tilt-2.0.9 → tilt-2.0.10}/lib/tilt/mapping.rb +0 -0
  198. data/bundle/ruby/2.6.0/gems/{tilt-2.0.9 → tilt-2.0.10}/lib/tilt/markaby.rb +0 -0
  199. data/bundle/ruby/2.6.0/gems/{tilt-2.0.9 → tilt-2.0.10}/lib/tilt/maruku.rb +0 -0
  200. data/bundle/ruby/2.6.0/gems/{tilt-2.0.9 → tilt-2.0.10}/lib/tilt/nokogiri.rb +0 -0
  201. data/bundle/ruby/2.6.0/gems/{tilt-2.0.9 → tilt-2.0.10}/lib/tilt/pandoc.rb +0 -0
  202. data/bundle/ruby/2.6.0/gems/{tilt-2.0.9 → tilt-2.0.10}/lib/tilt/plain.rb +0 -0
  203. data/bundle/ruby/2.6.0/gems/{tilt-2.0.9 → tilt-2.0.10}/lib/tilt/prawn.rb +0 -0
  204. data/bundle/ruby/2.6.0/gems/{tilt-2.0.9 → tilt-2.0.10}/lib/tilt/radius.rb +0 -0
  205. data/bundle/ruby/2.6.0/gems/{tilt-2.0.9 → tilt-2.0.10}/lib/tilt/rdiscount.rb +0 -0
  206. data/bundle/ruby/2.6.0/gems/{tilt-2.0.9 → tilt-2.0.10}/lib/tilt/rdoc.rb +0 -0
  207. data/bundle/ruby/2.6.0/gems/{tilt-2.0.9 → tilt-2.0.10}/lib/tilt/redcarpet.rb +0 -0
  208. data/bundle/ruby/2.6.0/gems/{tilt-2.0.9 → tilt-2.0.10}/lib/tilt/redcloth.rb +0 -0
  209. data/bundle/ruby/2.6.0/gems/{tilt-2.0.9 → tilt-2.0.10}/lib/tilt/rst-pandoc.rb +0 -0
  210. data/bundle/ruby/2.6.0/gems/{tilt-2.0.9 → tilt-2.0.10}/lib/tilt/sass.rb +0 -0
  211. data/bundle/ruby/2.6.0/gems/{tilt-2.0.9 → tilt-2.0.10}/lib/tilt/sigil.rb +0 -0
  212. data/bundle/ruby/2.6.0/gems/{tilt-2.0.9 → tilt-2.0.10}/lib/tilt/string.rb +0 -0
  213. data/bundle/ruby/2.6.0/gems/{tilt-2.0.9 → tilt-2.0.10}/lib/tilt/template.rb +7 -12
  214. data/bundle/ruby/2.6.0/gems/{tilt-2.0.9 → tilt-2.0.10}/lib/tilt/typescript.rb +0 -0
  215. data/bundle/ruby/2.6.0/gems/{tilt-2.0.9 → tilt-2.0.10}/lib/tilt/wikicloth.rb +0 -0
  216. data/bundle/ruby/2.6.0/gems/{tilt-2.0.9 → tilt-2.0.10}/lib/tilt/yajl.rb +0 -0
  217. data/lib/brakeman/checks/base_check.rb +23 -1
  218. data/lib/brakeman/checks/check_cookie_serialization.rb +1 -1
  219. data/lib/brakeman/checks/check_cross_site_scripting.rb +1 -1
  220. data/lib/brakeman/checks/check_execute.rb +26 -1
  221. data/lib/brakeman/differ.rb +16 -28
  222. data/lib/brakeman/parsers/haml_embedded.rb +1 -1
  223. data/lib/brakeman/parsers/template_parser.rb +3 -1
  224. data/lib/brakeman/processors/alias_processor.rb +10 -0
  225. data/lib/brakeman/processors/base_processor.rb +2 -0
  226. data/lib/brakeman/processors/haml_template_processor.rb +86 -122
  227. data/lib/brakeman/processors/lib/rails2_config_processor.rb +1 -1
  228. data/lib/brakeman/processors/template_alias_processor.rb +28 -0
  229. data/lib/brakeman/tracker/config.rb +33 -92
  230. data/lib/brakeman/version.rb +1 -1
  231. metadata +215 -206
  232. data/bundle/ruby/2.6.0/gems/haml-4.0.7/lib/haml/compiler.rb +0 -540
  233. data/bundle/ruby/2.6.0/gems/haml-4.0.7/lib/haml/error.rb +0 -61
  234. data/bundle/ruby/2.6.0/gems/haml-4.0.7/lib/haml/railtie.rb +0 -22
  235. data/bundle/ruby/2.6.0/gems/haml-4.0.7/lib/haml/template/plugin.rb +0 -41
  236. data/bundle/ruby/2.6.0/gems/haml-4.0.7/lib/haml/util.rb +0 -377
  237. data/bundle/ruby/2.6.0/gems/haml-4.0.7/lib/haml/version.rb +0 -3
  238. data/bundle/ruby/2.6.0/gems/ruby_parser-3.13.1/lib/ruby20_parser.rb +0 -6869
  239. data/bundle/ruby/2.6.0/gems/ruby_parser-3.13.1/lib/ruby20_parser.y +0 -2431
  240. data/bundle/ruby/2.6.0/gems/ruby_parser-3.13.1/lib/ruby21_parser.rb +0 -6944
  241. data/bundle/ruby/2.6.0/gems/ruby_parser-3.13.1/lib/ruby22_parser.rb +0 -6968
  242. data/bundle/ruby/2.6.0/gems/ruby_parser-3.13.1/lib/ruby23_parser.rb +0 -6987
  243. data/bundle/ruby/2.6.0/gems/ruby_parser-3.13.1/lib/ruby24_parser.rb +0 -6994
  244. data/bundle/ruby/2.6.0/gems/ruby_parser-3.13.1/lib/ruby25_parser.rb +0 -6994
  245. data/bundle/ruby/2.6.0/gems/ruby_parser-3.13.1/lib/ruby26_parser.rb +0 -7012
  246. data/bundle/ruby/2.6.0/gems/temple-0.8.1/lib/temple/version.rb +0 -3
  247. data/bundle/ruby/2.6.0/gems/tilt-2.0.9/CHANGELOG.md +0 -132
  248. data/bundle/ruby/2.6.0/gems/tilt-2.0.9/Gemfile +0 -70
  249. data/bundle/ruby/2.6.0/gems/tilt-2.0.9/HACKING +0 -16
  250. data/bundle/ruby/2.6.0/gems/tilt-2.0.9/README.md +0 -233
  251. data/bundle/ruby/2.6.0/gems/tilt-2.0.9/tilt.gemspec +0 -130
@@ -21,30 +21,30 @@ token kCLASS kMODULE kDEF kUNDEF kBEGIN kRESCUE kENSURE kEND kIF kUNLESS
21
21
  tLAMBEG tDSTAR tCHAR tSYMBOLS_BEG tQSYMBOLS_BEG tSTRING_DEND tUBANG
22
22
  tRATIONAL tIMAGINARY
23
23
 
24
- prechigh
25
- right tBANG tTILDE tUPLUS
26
- right tPOW
27
- right tUMINUS_NUM tUMINUS
28
- left tSTAR2 tDIVIDE tPERCENT
29
- left tPLUS tMINUS
30
- left tLSHFT tRSHFT
31
- left tAMPER2
32
- left tPIPE tCARET
33
- left tGT tGEQ tLT tLEQ
34
- nonassoc tCMP tEQ tEQQ tNEQ tMATCH tNMATCH
35
- left tANDOP
36
- left tOROP
37
- nonassoc tDOT2 tDOT3
38
- right tEH tCOLON
39
- left kRESCUE_MOD
40
- right tEQL tOP_ASGN
41
- nonassoc kDEFINED
42
- right kNOT
43
- left kOR kAND
44
- nonassoc kIF_MOD kUNLESS_MOD kWHILE_MOD kUNTIL_MOD
45
- nonassoc tLBRACE_ARG
46
- nonassoc tLOWEST
47
24
  preclow
25
+ nonassoc tLOWEST
26
+ nonassoc tLBRACE_ARG
27
+ nonassoc kIF_MOD kUNLESS_MOD kWHILE_MOD kUNTIL_MOD
28
+ left kOR kAND
29
+ right kNOT
30
+ nonassoc kDEFINED
31
+ right tEQL tOP_ASGN
32
+ left kRESCUE_MOD
33
+ right tEH tCOLON
34
+ nonassoc tDOT2 tDOT3
35
+ left tOROP
36
+ left tANDOP
37
+ nonassoc tCMP tEQ tEQQ tNEQ tMATCH tNMATCH
38
+ left tGT tGEQ tLT tLEQ
39
+ left tPIPE tCARET
40
+ left tAMPER2
41
+ left tLSHFT tRSHFT
42
+ left tPLUS tMINUS
43
+ left tSTAR2 tDIVIDE tPERCENT # TODO: tSTAR2 -> tMULT
44
+ right tUMINUS_NUM tUMINUS
45
+ right tPOW
46
+ right tBANG tTILDE tUPLUS
47
+ prechigh
48
48
 
49
49
  rule
50
50
 
@@ -58,7 +58,8 @@ rule
58
58
 
59
59
  top_compstmt: top_stmts opt_terms
60
60
  {
61
- result = val[0]
61
+ stmt, _ = val
62
+ result = stmt
62
63
  }
63
64
 
64
65
  top_stmts: none
@@ -70,14 +71,6 @@ rule
70
71
  | error top_stmt
71
72
 
72
73
  top_stmt: stmt
73
- {
74
- result = val[0]
75
-
76
- # TODO: remove once I have more confidence this is fixed
77
- # result.each_of_type :call_args do |s|
78
- # debug20 666, s, result
79
- # end
80
- }
81
74
  | klBEGIN
82
75
  {
83
76
  if (self.in_def || self.in_single > 0) then
@@ -88,14 +81,19 @@ rule
88
81
  }
89
82
  begin_block
90
83
  {
91
- _, _, block = val
92
- result = block
84
+ (_, lineno), _, iter = val
85
+ iter.line lineno
86
+
87
+ (_, preexe,) = iter
88
+ preexe.line lineno
89
+
90
+ result = iter
93
91
  }
94
92
 
95
- begin_block: tLCURLY top_compstmt tRCURLY
93
+ begin_block: tLCURLY { result = lexer.lineno } top_compstmt tRCURLY
96
94
  {
97
- _, stmt, _ = val
98
- result = new_iter s(:preexe), 0, stmt
95
+ _, line, stmt, _ = val
96
+ result = new_iter s(:preexe).line(line), 0, stmt
99
97
  }
100
98
 
101
99
  bodystmt: compstmt opt_rescue k_else
@@ -137,34 +135,27 @@ rule
137
135
  stmt_or_begin: stmt
138
136
  | klBEGIN
139
137
  {
140
- if (self.in_def || self.in_single > 0) then
141
- debug20 1
142
- yyerror "BEGIN in method"
143
- end
144
- self.env.extend
145
- }
146
- begin_block
147
- {
148
- _, _, stmt = val
149
- result = stmt
138
+ yyerror "BEGIN is permitted only at toplevel"
150
139
  }
151
140
 
152
141
  stmt: kALIAS fitem
153
142
  {
154
143
  lexer.lex_state = EXPR_FNAME
155
- result = self.lexer.lineno
156
144
  }
157
145
  fitem
158
146
  {
159
- result = s(:alias, val[1], val[3]).line(val[2])
147
+ (_, line), lhs, _, rhs = val
148
+ result = s(:alias, lhs, rhs).line(line).line line
160
149
  }
161
150
  | kALIAS tGVAR tGVAR
162
151
  {
163
- result = s(:valias, val[1].to_sym, val[2].to_sym)
152
+ (_, line), lhs, rhs = val
153
+ result = s(:valias, lhs.to_sym, rhs.to_sym).line line
164
154
  }
165
155
  | kALIAS tGVAR tBACK_REF
166
156
  {
167
- result = s(:valias, val[1].to_sym, :"$#{val[2]}")
157
+ (_, line), lhs, rhs = val
158
+ result = s(:valias, lhs.to_sym, :"$#{rhs}").line line
168
159
  }
169
160
  | kALIAS tGVAR tNTH_REF
170
161
  {
@@ -176,32 +167,41 @@ rule
176
167
  }
177
168
  | stmt kIF_MOD expr_value
178
169
  {
179
- result = new_if val[2], val[0], nil
170
+ t, _, c = val
171
+ result = new_if c, t, nil
180
172
  }
181
173
  | stmt kUNLESS_MOD expr_value
182
174
  {
183
- result = new_if val[2], nil, val[0]
175
+ f, _, c = val
176
+ result = new_if c, nil, f
184
177
  }
185
178
  | stmt kWHILE_MOD expr_value
186
179
  {
187
- result = new_while val[0], val[2], true
180
+ e, _, c = val
181
+ result = new_while e, c, true
188
182
  }
189
183
  | stmt kUNTIL_MOD expr_value
190
184
  {
191
- result = new_until val[0], val[2], true
185
+ e, _, c = val
186
+ result = new_until e, c, true
192
187
  }
193
188
  | stmt kRESCUE_MOD stmt
194
189
  {
195
190
  body, _, resbody = val
196
- result = new_rescue body, new_resbody(s(:array), resbody)
191
+
192
+ resbody = new_resbody s(:array).line(resbody.line), resbody
193
+ result = new_rescue body, resbody
197
194
  }
198
195
  | klEND tLCURLY compstmt tRCURLY
199
196
  {
197
+ (_, line), _, stmt, _ = val
198
+
200
199
  if (self.in_def || self.in_single > 0) then
201
200
  debug20 3
202
201
  yyerror "END in method; use at_exit"
203
202
  end
204
- result = new_iter s(:postexe), 0, val[2]
203
+
204
+ result = new_iter s(:postexe).line(line), 0, stmt
205
205
  }
206
206
  | command_asgn
207
207
  | mlhs tEQL command_call
@@ -210,7 +210,8 @@ rule
210
210
  }
211
211
  | lhs tEQL mrhs
212
212
  {
213
- result = new_assign val[0], s(:svalue, val[2])
213
+ lhs, _, rhs = val
214
+ result = new_assign lhs, s(:svalue, rhs).line(rhs.line)
214
215
  }
215
216
  | mlhs tEQL mrhs_arg
216
217
  {
@@ -232,11 +233,12 @@ rule
232
233
  }
233
234
  | primary_value tLBRACK2 opt_call_args rbracket tOP_ASGN command_rhs
234
235
  {
235
- result = s(:op_asgn1, val[0], val[2], val[4].to_sym, val[5])
236
+ result = new_op_asgn1 val
236
237
  }
237
238
  | primary_value call_op tIDENTIFIER tOP_ASGN command_rhs
238
239
  {
239
- result = s(:op_asgn, val[0], val[4], val[2].to_sym, val[3].to_sym)
240
+ prim, _, id, opasgn, rhs = val
241
+ result = s(:op_asgn, prim, rhs, id.to_sym, opasgn.to_sym)
240
242
  if val[1] == '&.'
241
243
  result.sexp_type = :safe_op_asgn
242
244
  end
@@ -275,19 +277,26 @@ rule
275
277
  expr: command_call
276
278
  | expr kAND expr
277
279
  {
278
- result = logical_op :and, val[0], val[2]
280
+ lhs, _, rhs = val
281
+ result = logical_op :and, lhs, rhs
279
282
  }
280
283
  | expr kOR expr
281
284
  {
282
- result = logical_op :or, val[0], val[2]
285
+ lhs, _, rhs = val
286
+ result = logical_op :or, lhs, rhs
283
287
  }
284
288
  | kNOT opt_nl expr
285
289
  {
286
- result = s(:call, val[2], :"!")
290
+ (_, line), _, expr = val
291
+ result = new_call(expr, :"!").line line
292
+ # REFACTOR: call_uni_op
287
293
  }
288
294
  | tBANG command_call
289
295
  {
290
- result = s(:call, val[1], :"!")
296
+ _, cmd = val
297
+ result = new_call(cmd, :"!").line cmd.line
298
+ # TODO: fix line number to tBANG... but causes BAD shift/reduce conflict
299
+ # REFACTOR: call_uni_op -- see parse26.y
291
300
  }
292
301
  | arg
293
302
 
@@ -314,7 +323,8 @@ rule
314
323
  block_command: block_call
315
324
  | block_call call_op2 operation2 command_args
316
325
  {
317
- result = new_call val[0], val[2].to_sym, val[3]
326
+ blk, _, msg, args = val
327
+ result = new_call(blk, msg.to_sym, args).line blk.line
318
328
  }
319
329
 
320
330
  cmd_brace_block: tLBRACE_ARG
@@ -334,26 +344,32 @@ rule
334
344
 
335
345
  fcall: operation
336
346
  {
337
- result = new_call nil, val[0].to_sym
347
+ msg, = val
348
+ result = new_call(nil, msg.to_sym).line lexer.lineno
338
349
  }
339
350
 
340
351
  command: fcall command_args =tLOWEST
341
352
  {
342
- result = val[0].concat val[1].sexp_body # REFACTOR pattern
353
+ call, args = val
354
+ result = call.concat args.sexp_body
343
355
  }
344
356
  | fcall command_args cmd_brace_block
345
357
  {
346
- result = val[0].concat val[1].sexp_body
347
- if val[2] then
348
- block_dup_check result, val[2]
358
+ call, args, block = val
349
359
 
350
- result, operation = val[2], result
360
+ result = call.concat args.sexp_body
361
+
362
+ if block then
363
+ block_dup_check result, block
364
+
365
+ result, operation = block, result
351
366
  result.insert 1, operation
352
367
  end
353
368
  }
354
369
  | primary_value call_op operation2 command_args =tLOWEST
355
370
  {
356
- result = new_call val[0], val[2].to_sym, val[3], val[1]
371
+ lhs, callop, op, args = val
372
+ result = new_call lhs, op.to_sym, args, callop
357
373
  }
358
374
  | primary_value call_op operation2 command_args cmd_brace_block
359
375
  {
@@ -385,7 +401,9 @@ rule
385
401
  }
386
402
  | kYIELD command_args
387
403
  {
388
- result = new_yield val[1]
404
+ (_, line), args = val
405
+ result = new_yield args
406
+ result.line line # TODO: push to new_yield
389
407
  }
390
408
  | k_return call_args
391
409
  {
@@ -394,8 +412,8 @@ rule
394
412
  }
395
413
  | kBREAK call_args
396
414
  {
397
- line = val[0].last
398
- result = s(:break, ret_args(val[1])).line(line)
415
+ (_, line), args = val
416
+ result = s(:break, ret_args(args)).line line
399
417
  }
400
418
  | kNEXT call_args
401
419
  {
@@ -412,56 +430,79 @@ rule
412
430
  mlhs_inner: mlhs_basic
413
431
  | tLPAREN mlhs_inner rparen
414
432
  {
415
- result = s(:masgn, s(:array, val[1]))
433
+ _, arg, _ = val
434
+ l = arg.line
435
+
436
+ result = s(:masgn, s(:array, arg).line(l)).line l
416
437
  }
417
438
 
418
439
  mlhs_basic: mlhs_head
419
440
  {
420
- result = s(:masgn, val[0])
441
+ head, = val
442
+ result = s(:masgn, head).line head.line
421
443
  }
422
444
  | mlhs_head mlhs_item
423
445
  {
424
- result = s(:masgn, val[0] << val[1].compact)
446
+ lhs, rhs = val
447
+ result = s(:masgn, lhs << rhs.compact).line lhs.line
425
448
  }
426
449
  | mlhs_head tSTAR mlhs_node
427
450
  {
428
- result = s(:masgn, val[0] << s(:splat, val[2]))
451
+ head, _, tail = val
452
+ head << s(:splat, tail).line(tail.line)
453
+ result = s(:masgn, head).line head.line
429
454
  }
430
455
  | mlhs_head tSTAR mlhs_node tCOMMA mlhs_post
431
456
  {
432
457
  ary1, _, splat, _, ary2 = val
433
458
 
434
- result = list_append ary1, s(:splat, splat)
459
+ result = list_append ary1, s(:splat, splat).line(splat.line)
435
460
  result.concat ary2.sexp_body
436
- result = s(:masgn, result)
461
+ result = s(:masgn, result).line result.line
437
462
  }
438
463
  | mlhs_head tSTAR
439
464
  {
440
- result = s(:masgn, val[0] << s(:splat))
465
+ head, _ = val
466
+ l = head.line
467
+ result = s(:masgn, head << s(:splat).line(l)).line l
441
468
  }
442
469
  | mlhs_head tSTAR tCOMMA mlhs_post
443
470
  {
444
- ary = list_append val[0], s(:splat)
445
- ary.concat val[3].sexp_body
446
- result = s(:masgn, ary)
471
+ head, _, _, post = val
472
+ ary = list_append head, s(:splat).line(head.line)
473
+ ary.concat post.sexp_body
474
+ result = s(:masgn, ary).line ary.line
447
475
  }
448
476
  | tSTAR mlhs_node
449
477
  {
450
- result = s(:masgn, s(:array, s(:splat, val[1])))
478
+ _, node = val
479
+ l = node.line
480
+ splat = s(:splat, node).line l
481
+ ary = s(:array, splat).line l
482
+ result = s(:masgn, ary).line l
451
483
  }
452
484
  | tSTAR mlhs_node tCOMMA mlhs_post
453
485
  {
454
- ary = s(:array, s(:splat, val[1]))
455
- ary.concat val[3].sexp_body
456
- result = s(:masgn, ary)
486
+ _, node, _, post = val
487
+
488
+ splat = s(:splat, node).line node.line
489
+ ary = s(:array, splat).line splat.line
490
+ ary.concat post.sexp_body
491
+ result = s(:masgn, ary).line ary.line
457
492
  }
458
493
  | tSTAR
459
494
  {
460
- result = s(:masgn, s(:array, s(:splat)))
495
+ l = lexer.lineno
496
+ result = s(:masgn, s(:array, s(:splat).line(l)).line(l)).line l
461
497
  }
462
498
  | tSTAR tCOMMA mlhs_post
463
499
  {
464
- result = s(:masgn, s(:array, s(:splat), *val[2].sexp_body))
500
+ _, _, post = val
501
+ l = post.line
502
+
503
+ splat = s(:splat).line l
504
+ ary = s(:array, splat, *post.sexp_body).line l
505
+ result = s(:masgn, ary).line l
465
506
  }
466
507
 
467
508
  mlhs_item: mlhs_node
@@ -472,7 +513,8 @@ rule
472
513
 
473
514
  mlhs_head: mlhs_item tCOMMA
474
515
  {
475
- result = s(:array, val[0])
516
+ lhs, _ = val
517
+ result = s(:array, lhs).line lhs.line
476
518
  }
477
519
  | mlhs_head mlhs_item tCOMMA
478
520
  {
@@ -481,7 +523,8 @@ rule
481
523
 
482
524
  mlhs_post: mlhs_item
483
525
  {
484
- result = s(:array, val[0])
526
+ item, = val
527
+ result = s(:array, item).line item.line
485
528
  }
486
529
  | mlhs_post tCOMMA mlhs_item
487
530
  {
@@ -506,7 +549,8 @@ rule
506
549
  }
507
550
  | primary_value tCOLON2 tIDENTIFIER
508
551
  {
509
- result = s(:attrasgn, val[0], :"#{val[2]}=")
552
+ recv, _, id = val
553
+ result = new_attrasgn recv, id
510
554
  }
511
555
  | primary_value call_op tCONSTANT
512
556
  {
@@ -519,7 +563,10 @@ rule
519
563
  yyerror "dynamic constant assignment"
520
564
  end
521
565
 
522
- result = s(:const, s(:colon2, val[0], val[2].to_sym), nil)
566
+ expr, _, id = val
567
+ l = expr.line
568
+
569
+ result = s(:const, s(:colon2, expr, id.to_sym).line(l), nil).line l
523
570
  }
524
571
  | tCOLON3 tCONSTANT
525
572
  {
@@ -528,7 +575,10 @@ rule
528
575
  yyerror "dynamic constant assignment"
529
576
  end
530
577
 
531
- result = s(:const, nil, s(:colon3, val[1].to_sym))
578
+ _, id = val
579
+ l = lexer.lineno
580
+
581
+ result = s(:const, nil, s(:colon3, id.to_sym).line(l)).line l
532
582
  }
533
583
  | backref
534
584
  {
@@ -537,24 +587,31 @@ rule
537
587
 
538
588
  lhs: user_variable
539
589
  {
590
+ line = lexer.lineno
540
591
  result = self.assignable val[0]
592
+ result.line = line
541
593
  }
542
594
  | keyword_variable
543
595
  {
596
+ line = lexer.lineno
544
597
  result = self.assignable val[0]
598
+ result.line = line
545
599
  debug20 9, val, result
546
600
  }
547
601
  | primary_value tLBRACK2 opt_call_args rbracket
548
602
  {
549
- result = self.aryset val[0], val[2]
603
+ lhs, _, args, _ = val
604
+ result = self.aryset lhs, args
550
605
  }
551
606
  | primary_value call_op tIDENTIFIER # REFACTOR
552
607
  {
553
- result = new_attrasgn val[0], val[2], val[1]
608
+ lhs, op, id = val
609
+ result = new_attrasgn lhs, id, op
554
610
  }
555
611
  | primary_value tCOLON2 tIDENTIFIER
556
612
  {
557
- result = s(:attrasgn, val[0], :"#{val[2]}=")
613
+ lhs, _, id = val
614
+ result = new_attrasgn lhs, id
558
615
  }
559
616
  | primary_value call_op tCONSTANT # REFACTOR?
560
617
  {
@@ -562,21 +619,27 @@ rule
562
619
  }
563
620
  | primary_value tCOLON2 tCONSTANT
564
621
  {
622
+ expr, _, id = val
623
+
565
624
  if (self.in_def || self.in_single > 0) then
566
625
  debug20 10
567
626
  yyerror "dynamic constant assignment"
568
627
  end
569
628
 
570
- result = s(:const, s(:colon2, val[0], val[2].to_sym))
629
+ l = expr.line
630
+ result = s(:const, s(:colon2, expr, id.to_sym).line(l)).line l
571
631
  }
572
632
  | tCOLON3 tCONSTANT
573
633
  {
634
+ _, id = val
635
+
574
636
  if (self.in_def || self.in_single > 0) then
575
637
  debug20 11
576
638
  yyerror "dynamic constant assignment"
577
639
  end
578
640
 
579
- result = s(:const, s(:colon3, val[1].to_sym))
641
+ l = lexer.lineno
642
+ result = s(:const, s(:colon3, id.to_sym).line(l)).line l
580
643
  }
581
644
  | backref
582
645
  {
@@ -591,7 +654,8 @@ rule
591
654
 
592
655
  cpath: tCOLON3 cname
593
656
  {
594
- result = s(:colon3, val[1].to_sym)
657
+ _, name = val
658
+ result = s(:colon3, name.to_sym).line lexer.lineno
595
659
  }
596
660
  | cname
597
661
  {
@@ -599,7 +663,10 @@ rule
599
663
  }
600
664
  | primary_value tCOLON2 cname
601
665
  {
602
- result = s(:colon2, val[0], val[2].to_sym)
666
+ pval, _, name = val
667
+
668
+ result = s(:colon2, pval, name.to_sym)
669
+ result.line pval.line
603
670
  }
604
671
 
605
672
  fname: tIDENTIFIER | tCONSTANT | tFID
@@ -620,7 +687,8 @@ rule
620
687
 
621
688
  fitem: fsym
622
689
  {
623
- result = s(:lit, val[0].to_sym)
690
+ id, = val
691
+ result = s(:lit, id.to_sym).line lexer.lineno
624
692
  }
625
693
  | dsym
626
694
 
@@ -643,6 +711,7 @@ rule
643
711
  | tNEQ | tLSHFT | tRSHFT | tPLUS | tMINUS | tSTAR2
644
712
  | tSTAR | tDIVIDE | tPERCENT | tPOW | tDSTAR | tBANG | tTILDE
645
713
  | tUPLUS | tUMINUS | tAREF | tASET | tBACK_REF2
714
+ # TODO: tUBANG dead?
646
715
  | tUBANG
647
716
 
648
717
  reswords: k__LINE__ | k__FILE__ | k__ENCODING__ | klBEGIN | klEND
@@ -665,8 +734,7 @@ rule
665
734
  }
666
735
  | primary_value tLBRACK2 opt_call_args rbracket tOP_ASGN arg_rhs
667
736
  {
668
- val[2].sexp_type = :arglist if val[2]
669
- result = s(:op_asgn1, val[0], val[2], val[4].to_sym, val[5])
737
+ result = new_op_asgn1 val
670
738
  }
671
739
  | primary_value call_op tIDENTIFIER tOP_ASGN arg_rhs
672
740
  {
@@ -678,7 +746,9 @@ rule
678
746
  }
679
747
  | primary_value tCOLON2 tIDENTIFIER tOP_ASGN arg_rhs
680
748
  {
681
- result = s(:op_asgn, val[0], val[4], val[2].to_sym, val[3].to_sym)
749
+ lhs, _, id, op, rhs = val
750
+
751
+ result = s(:op_asgn, lhs, rhs, id.to_sym, op.to_sym).line lhs.line
682
752
  }
683
753
  | primary_value tCOLON2 tCONSTANT tOP_ASGN arg_rhs
684
754
  {
@@ -708,18 +778,18 @@ rule
708
778
  {
709
779
  v1, v2 = val[0], val[2]
710
780
  if v1.node_type == :lit and v2.node_type == :lit and Integer === v1.last and Integer === v2.last then
711
- result = s(:lit, (v1.last)..(v2.last))
781
+ result = s(:lit, (v1.last)..(v2.last)).line v1.line
712
782
  else
713
- result = s(:dot2, v1, v2)
783
+ result = s(:dot2, v1, v2).line v1.line
714
784
  end
715
785
  }
716
786
  | arg tDOT3 arg
717
787
  {
718
788
  v1, v2 = val[0], val[2]
719
789
  if v1.node_type == :lit and v2.node_type == :lit and Integer === v1.last and Integer === v2.last then
720
- result = s(:lit, (v1.last)...(v2.last))
790
+ result = s(:lit, (v1.last)...(v2.last)).line v1.line
721
791
  else
722
- result = s(:dot3, v1, v2)
792
+ result = s(:dot3, v1, v2).line v1.line
723
793
  end
724
794
  }
725
795
  | arg tPLUS arg
@@ -748,7 +818,9 @@ rule
748
818
  }
749
819
  | tUMINUS_NUM simple_numeric tPOW arg
750
820
  {
751
- result = new_call(new_call(s(:lit, val[1]), :"**", argl(val[3])), :"-@")
821
+ lit = s(:lit, val[1]).line lexer.lineno
822
+ result = new_call(new_call(lit, :"**", argl(val[3])), :"-@")
823
+
752
824
  }
753
825
  | tUPLUS arg
754
826
  {
@@ -789,15 +861,19 @@ rule
789
861
  }
790
862
  | arg tMATCH arg
791
863
  {
792
- result = new_match val[0], val[2]
864
+ lhs, _, rhs = val
865
+ result = new_match lhs, rhs
793
866
  }
794
867
  | arg tNMATCH arg
795
868
  {
796
- result = s(:not, new_match(val[0], val[2]))
869
+ lhs, _, rhs = val
870
+ result = s(:not, new_match(lhs, rhs)).line lhs.line
797
871
  }
798
872
  | tBANG arg
799
873
  {
800
- result = new_call val[1], :"!"
874
+ _, arg = val
875
+ result = new_call arg, :"!"
876
+ result.line arg.line
801
877
  }
802
878
  | tTILDE arg
803
879
  {
@@ -825,11 +901,13 @@ rule
825
901
  }
826
902
  | kDEFINED opt_nl arg
827
903
  {
828
- result = s(:defined, val[2])
904
+ (_, line), _, arg = val
905
+ result = s(:defined, arg).line line
829
906
  }
830
907
  | arg tEH arg opt_nl tCOLON arg
831
908
  {
832
- result = s(:if, val[0], val[2], val[5])
909
+ c, _, t, _, _, f = val
910
+ result = s(:if, c, t, f).line c.line
833
911
  }
834
912
  | primary
835
913
 
@@ -872,28 +950,25 @@ rule
872
950
  arg_rhs: arg =tOP_ASGN
873
951
  | arg kRESCUE_MOD arg
874
952
  {
875
- body, _, resbody = val
953
+ body, (_, line), resbody = val
876
954
  body = value_expr body
877
955
  resbody = remove_begin resbody
878
- result = new_rescue(body, new_resbody(s(:array), resbody))
956
+
957
+ ary = s(:array).line line
958
+ result = new_rescue(body, new_resbody(ary, resbody))
879
959
  }
880
960
 
881
961
  paren_args: tLPAREN2 opt_call_args rparen
882
962
  {
883
- result = val[1]
963
+ _, args, _ = val
964
+ result = args
884
965
  }
885
966
 
886
967
  opt_paren_args: none
887
968
  | paren_args
888
969
 
889
970
  opt_call_args: none
890
- {
891
- result = val[0]
892
- }
893
971
  | call_args
894
- {
895
- result = val[0]
896
- }
897
972
  | args tCOMMA
898
973
  {
899
974
  result = args val
@@ -943,7 +1018,8 @@ rule
943
1018
 
944
1019
  block_arg: tAMPER arg_value
945
1020
  {
946
- result = s(:block_pass, val[1])
1021
+ _, arg = val
1022
+ result = s(:block_pass, arg).line arg.line
947
1023
  }
948
1024
 
949
1025
  opt_block_arg: tCOMMA block_arg
@@ -954,19 +1030,24 @@ rule
954
1030
 
955
1031
  args: arg_value
956
1032
  {
957
- result = s(:array, val[0])
1033
+ arg, = val
1034
+
1035
+ result = s(:array, arg).line arg.line
958
1036
  }
959
1037
  | tSTAR arg_value
960
1038
  {
961
- result = s(:array, s(:splat, val[1]))
1039
+ _, arg = val
1040
+ result = s(:array, s(:splat, arg).line(arg.line)).line arg.line
962
1041
  }
963
1042
  | args tCOMMA arg_value
964
1043
  {
965
- result = self.list_append val[0], val[2]
1044
+ args, _, id = val
1045
+ result = self.list_append args, id
966
1046
  }
967
- | args tCOMMA tSTAR arg_value
1047
+ | args tCOMMA tSTAR { result = lexer.lineno } arg_value
968
1048
  {
969
- result = self.list_append val[0], s(:splat, val[3])
1049
+ args, _, _, line, id = val
1050
+ result = self.list_append args, s(:splat, id).line(line)
970
1051
  }
971
1052
 
972
1053
  mrhs_arg: mrhs
@@ -984,11 +1065,15 @@ rule
984
1065
  }
985
1066
  | args tCOMMA tSTAR arg_value
986
1067
  {
987
- result = self.arg_concat val[0], val[3]
1068
+ # FIX: bad shift/reduce conflict with rhs' comma star prod
1069
+ # TODO: make all tXXXX terminals include lexer.lineno
1070
+ arg, _, _, splat = val
1071
+ result = self.arg_concat arg, splat
988
1072
  }
989
1073
  | tSTAR arg_value
990
1074
  {
991
- result = s(:splat, val[1])
1075
+ _, arg = val
1076
+ result = s(:splat, arg).line arg.line
992
1077
  }
993
1078
 
994
1079
  primary: literal
@@ -1003,7 +1088,8 @@ rule
1003
1088
  | backref
1004
1089
  | tFID
1005
1090
  {
1006
- result = new_call nil, val[0].to_sym
1091
+ msg, = val
1092
+ result = new_call nil, msg.to_sym
1007
1093
  }
1008
1094
  | k_begin
1009
1095
  {
@@ -1023,16 +1109,19 @@ rule
1023
1109
 
1024
1110
  result.line = val[1]
1025
1111
  }
1026
- | tLPAREN_ARG rparen
1112
+ | tLPAREN_ARG
1027
1113
  {
1028
- # TODO: lex_state = EXPR_ENDARG in between
1029
- debug20 13, val, result
1114
+ lexer.lex_state = EXPR_ENDARG
1115
+ result = lexer.lineno
1116
+ }
1117
+ rparen
1118
+ {
1119
+ _, line, _ = val
1120
+ result = s(:begin).line line
1030
1121
  }
1031
1122
  | tLPAREN_ARG
1032
1123
  {
1033
1124
  result = lexer.cmdarg.store false
1034
- # result = self.lexer.cmdarg.stack.dup
1035
- # lexer.cmdarg.stack.replace [false] # TODO add api for these
1036
1125
  }
1037
1126
  stmt
1038
1127
  {
@@ -1047,21 +1136,29 @@ rule
1047
1136
  }
1048
1137
  | tLPAREN compstmt tRPAREN
1049
1138
  {
1050
- result = val[1] || s(:nil)
1139
+ _, stmt, _ = val
1140
+ result = stmt
1141
+ result ||= s(:nil).line lexer.lineno
1051
1142
  result.paren = true
1052
1143
  }
1053
1144
  | primary_value tCOLON2 tCONSTANT
1054
1145
  {
1055
- result = s(:colon2, val[0], val[2].to_sym)
1146
+ expr, _, id = val
1147
+
1148
+ result = s(:colon2, expr, id.to_sym).line expr.line
1056
1149
  }
1057
1150
  | tCOLON3 tCONSTANT
1058
1151
  {
1059
- result = s(:colon3, val[1].to_sym)
1152
+ _, id = val
1153
+
1154
+ result = s(:colon3, id.to_sym).line lexer.lineno
1060
1155
  }
1061
- | tLBRACK aref_args tRBRACK
1156
+ | tLBRACK { result = lexer.lineno } aref_args tRBRACK
1062
1157
  {
1063
- result = val[1] || s(:array)
1158
+ _, line, args, _ = val
1159
+ result = args || s(:array)
1064
1160
  result.sexp_type = :array # aref_args is :args
1161
+ result.line line
1065
1162
  }
1066
1163
  | tLBRACE
1067
1164
  {
@@ -1073,7 +1170,8 @@ rule
1073
1170
  }
1074
1171
  | k_return
1075
1172
  {
1076
- result = s(:return)
1173
+ (_, line), = val
1174
+ result = s(:return).line line
1077
1175
  }
1078
1176
  | kYIELD tLPAREN2 call_args rparen
1079
1177
  {
@@ -1089,11 +1187,14 @@ rule
1089
1187
  }
1090
1188
  | kDEFINED opt_nl tLPAREN2 expr rparen
1091
1189
  {
1092
- result = s(:defined, val[3])
1190
+ (_, line), _, _, arg, _ = val
1191
+
1192
+ result = s(:defined, arg).line line
1093
1193
  }
1094
1194
  | kNOT tLPAREN2 expr rparen
1095
1195
  {
1096
- result = s(:call, val[2], :"!")
1196
+ _, _, lhs, _ = val
1197
+ result = new_call lhs, :"!"
1097
1198
  }
1098
1199
  | kNOT tLPAREN2 rparen
1099
1200
  {
@@ -1101,11 +1202,11 @@ rule
1101
1202
  }
1102
1203
  | fcall brace_block
1103
1204
  {
1104
- oper, iter = val[0], val[1]
1105
- call = oper # FIX
1205
+ call, iter = val
1206
+
1106
1207
  iter.insert 1, call
1107
1208
  result = iter
1108
- call.line = iter.line
1209
+ # FIX: probably not: call.line = iter.line
1109
1210
  }
1110
1211
  | method_call
1111
1212
  | method_call brace_block
@@ -1222,7 +1323,7 @@ rule
1222
1323
  # TODO: port local_push_gen and local_pop_gen
1223
1324
  lexer.cmdarg.stack.replace [false]
1224
1325
  }
1225
- f_arglist bodystmt k_end
1326
+ f_arglist bodystmt { result = lexer.lineno } k_end
1226
1327
  {
1227
1328
  in_def, cmdarg = val[2]
1228
1329
 
@@ -1248,9 +1349,8 @@ rule
1248
1349
  }
1249
1350
  f_arglist bodystmt k_end
1250
1351
  {
1251
- line, cmdarg = val[5]
1352
+ _, cmdarg = val[5]
1252
1353
  result = new_defs val
1253
- result[3].line line
1254
1354
 
1255
1355
  lexer.cmdarg.stack.replace cmdarg
1256
1356
 
@@ -1260,19 +1360,23 @@ rule
1260
1360
  }
1261
1361
  | kBREAK
1262
1362
  {
1263
- result = s(:break)
1363
+ (_, line), = val
1364
+ result = s(:break).line line
1264
1365
  }
1265
1366
  | kNEXT
1266
1367
  {
1267
- result = s(:next)
1368
+ (_, line), = val
1369
+ result = s(:next).line line
1268
1370
  }
1269
1371
  | kREDO
1270
1372
  {
1271
- result = s(:redo)
1373
+ (_, line), = val
1374
+ result = s(:redo).line line
1272
1375
  }
1273
1376
  | kRETRY
1274
1377
  {
1275
- result = s(:retry)
1378
+ (_, line), = val
1379
+ result = s(:retry).line line
1276
1380
  }
1277
1381
 
1278
1382
  primary_value: primary
@@ -1311,7 +1415,9 @@ rule
1311
1415
  if_tail: opt_else
1312
1416
  | k_elsif expr_value then compstmt if_tail
1313
1417
  {
1314
- result = s(:if, val[1], val[3], val[4])
1418
+ (_, line), c, _, t, rest = val
1419
+
1420
+ result = s(:if, c, t, rest).line line
1315
1421
  }
1316
1422
 
1317
1423
  opt_else: none
@@ -1334,7 +1440,9 @@ rule
1334
1440
 
1335
1441
  f_marg_list: f_marg
1336
1442
  {
1337
- result = s(:array, val[0])
1443
+ sym, = val
1444
+
1445
+ result = s(:array, sym).line lexer.lineno
1338
1446
  }
1339
1447
  | f_marg_list tCOMMA f_marg
1340
1448
  {
@@ -1408,7 +1516,9 @@ rule
1408
1516
  }
1409
1517
  | f_block_arg
1410
1518
  {
1411
- result = call_args val
1519
+ line = lexer.lineno
1520
+ result = call_args val # TODO: push line down
1521
+ result.line line
1412
1522
  }
1413
1523
 
1414
1524
  opt_block_args_tail: tCOMMA block_args_tail
@@ -1439,7 +1549,7 @@ opt_block_args_tail: tCOMMA block_args_tail
1439
1549
  }
1440
1550
  | f_arg tCOMMA
1441
1551
  {
1442
- result = args val
1552
+ result = args(val) << nil
1443
1553
  }
1444
1554
  | f_arg tCOMMA f_rest_arg tCOMMA f_arg opt_block_args_tail
1445
1555
  {
@@ -1491,7 +1601,7 @@ opt_block_args_tail: tCOMMA block_args_tail
1491
1601
  }
1492
1602
  | tOROP
1493
1603
  {
1494
- result = s(:args)
1604
+ result = s(:args).line lexer.lineno
1495
1605
  }
1496
1606
  | tPIPE block_param opt_bv_decl tPIPE
1497
1607
  {
@@ -1516,33 +1626,33 @@ opt_block_args_tail: tCOMMA block_args_tail
1516
1626
 
1517
1627
  bvar: tIDENTIFIER
1518
1628
  {
1519
- result = s(:shadow, val[0].to_sym)
1629
+ id, = val
1630
+ line = lexer.lineno
1631
+ result = s(:shadow, id.to_sym).line line
1520
1632
  }
1521
1633
  | f_bad_arg
1522
1634
 
1523
1635
  lambda: {
1524
1636
  self.env.extend :dynamic
1525
- result = self.lexer.lineno
1526
-
1527
- result = lexer.lpar_beg
1637
+ result = [lexer.lineno, lexer.lpar_beg]
1528
1638
  lexer.paren_nest += 1
1529
1639
  lexer.lpar_beg = lexer.paren_nest
1530
1640
  }
1531
1641
  f_larglist
1532
1642
  {
1533
- result = [lexer.cmdarg.store(false), self.lexer.lineno]
1643
+ result = lexer.cmdarg.store(false)
1534
1644
  }
1535
1645
  lambda_body
1536
1646
  {
1537
- lpar, args, (cmdarg, lineno), body = val
1647
+ (line, lpar), args, cmdarg, body = val
1538
1648
  lexer.lpar_beg = lpar
1539
1649
 
1540
1650
  lexer.cmdarg.restore cmdarg
1541
1651
  lexer.cmdarg.lexpop
1542
1652
 
1543
- call = new_call nil, :lambda
1653
+ call = s(:lambda).line line
1544
1654
  result = new_iter call, args, body
1545
- result.line = lineno
1655
+ result.line = line
1546
1656
  self.env.unextend
1547
1657
  }
1548
1658
 
@@ -1567,8 +1677,8 @@ opt_block_args_tail: tCOMMA block_args_tail
1567
1677
 
1568
1678
  do_block: k_do_block do_body kEND
1569
1679
  {
1570
- # TODO: maybe fix lineno to kDO's lineno?
1571
- result = val[1]
1680
+ (_, line), iter, _ = val
1681
+ result = iter.line line
1572
1682
  }
1573
1683
 
1574
1684
  block_call: command do_block
@@ -1582,8 +1692,10 @@ opt_block_args_tail: tCOMMA block_args_tail
1582
1692
 
1583
1693
  val = invert_block_call val if inverted? val
1584
1694
 
1585
- result = val[1]
1586
- result.insert 1, val[0]
1695
+ cmd, blk = val
1696
+
1697
+ result = blk
1698
+ result.insert 1, cmd
1587
1699
  }
1588
1700
  | block_call call_op2 operation2 opt_paren_args
1589
1701
  {
@@ -1614,8 +1726,10 @@ opt_block_args_tail: tCOMMA block_args_tail
1614
1726
  }
1615
1727
  paren_args
1616
1728
  {
1617
- args = self.call_args val[2..-1]
1618
- result = val[0].concat args.sexp_body
1729
+ call, lineno, args = val
1730
+
1731
+ result = call.concat args.sexp_body if args
1732
+ result.line lineno
1619
1733
  }
1620
1734
  | primary_value call_op operation2 opt_paren_args
1621
1735
  {
@@ -1643,7 +1757,7 @@ opt_block_args_tail: tCOMMA block_args_tail
1643
1757
  }
1644
1758
  | kSUPER
1645
1759
  {
1646
- result = s(:zsuper)
1760
+ result = s(:zsuper).line lexer.lineno
1647
1761
  }
1648
1762
  | primary_value tLBRACK2 opt_call_args rbracket
1649
1763
  {
@@ -1721,7 +1835,7 @@ opt_block_args_tail: tCOMMA block_args_tail
1721
1835
  (_, line), klasses, var, _, body, rest = val
1722
1836
 
1723
1837
  klasses ||= s(:array)
1724
- klasses << new_assign(var, s(:gvar, :"$!")) if var
1838
+ klasses << new_assign(var, s(:gvar, :"$!").line(var.line)) if var
1725
1839
  klasses.line line
1726
1840
 
1727
1841
  result = new_resbody(klasses, body)
@@ -1734,7 +1848,8 @@ opt_block_args_tail: tCOMMA block_args_tail
1734
1848
 
1735
1849
  exc_list: arg_value
1736
1850
  {
1737
- result = s(:array, val[0])
1851
+ arg, = val
1852
+ result = s(:array, arg).line arg.line
1738
1853
  }
1739
1854
  | mrhs
1740
1855
  | none
@@ -1747,26 +1862,31 @@ opt_block_args_tail: tCOMMA block_args_tail
1747
1862
 
1748
1863
  opt_ensure: k_ensure compstmt
1749
1864
  {
1750
- _, body = val
1865
+ (_, line), body = val
1751
1866
 
1752
- result = body || s(:nil)
1867
+ result = body || s(:nil).line(line)
1753
1868
  }
1754
1869
  | none
1755
1870
 
1756
1871
  literal: numeric
1757
1872
  {
1873
+ line = lexer.lineno
1758
1874
  result = s(:lit, val[0])
1875
+ result.line = line
1759
1876
  }
1760
1877
  | symbol
1761
1878
  {
1879
+ line = lexer.lineno
1762
1880
  result = s(:lit, val[0])
1881
+ result.line = line
1763
1882
  }
1764
1883
  | dsym
1765
1884
 
1766
1885
  strings: string
1767
1886
  {
1768
- val[0] = s(:dstr, val[0].value) if val[0].sexp_type == :evstr
1769
- result = val[0]
1887
+ str, = val
1888
+ str = s(:dstr, str.value) if str.sexp_type == :evstr
1889
+ result = str
1770
1890
  }
1771
1891
 
1772
1892
  string: tCHAR
@@ -1781,7 +1901,11 @@ opt_block_args_tail: tCOMMA block_args_tail
1781
1901
 
1782
1902
  string1: tSTRING_BEG string_contents tSTRING_END
1783
1903
  {
1784
- result = val[1]
1904
+ _, str, (_, func) = val
1905
+
1906
+ str = dedent str if func =~ RubyLexer::STR_FUNC_ICNTNT
1907
+
1908
+ result = str
1785
1909
  }
1786
1910
  | tSTRING
1787
1911
  {
@@ -1791,6 +1915,7 @@ opt_block_args_tail: tCOMMA block_args_tail
1791
1915
  xstring: tXSTRING_BEG xstring_contents tSTRING_END
1792
1916
  {
1793
1917
  result = new_xstring val[1]
1918
+ # TODO: dedent?!?! SERIOUSLY?!?
1794
1919
  }
1795
1920
 
1796
1921
  regexp: tREGEXP_BEG regexp_contents tREGEXP_END
@@ -1800,7 +1925,7 @@ opt_block_args_tail: tCOMMA block_args_tail
1800
1925
 
1801
1926
  words: tWORDS_BEG tSPACE tSTRING_END
1802
1927
  {
1803
- result = s(:array)
1928
+ result = s(:array).line lexer.lineno
1804
1929
  }
1805
1930
  | tWORDS_BEG word_list tSTRING_END
1806
1931
  {
@@ -1824,25 +1949,28 @@ opt_block_args_tail: tCOMMA block_args_tail
1824
1949
 
1825
1950
  symbols: tSYMBOLS_BEG tSPACE tSTRING_END
1826
1951
  {
1827
- result = s(:array)
1952
+ result = s(:array).line lexer.lineno
1828
1953
  }
1829
- | tSYMBOLS_BEG symbol_list tSTRING_END
1954
+ | tSYMBOLS_BEG { result = lexer.lineno } symbol_list tSTRING_END
1830
1955
  {
1831
- result = val[1]
1956
+ _, line, list, _, = val
1957
+ list.line = line
1958
+ result = list
1832
1959
  }
1833
1960
 
1834
1961
  symbol_list: none
1835
1962
  {
1836
- result = new_symbol_list
1963
+ result = new_symbol_list.line lexer.lineno
1837
1964
  }
1838
1965
  | symbol_list word tSPACE
1839
1966
  {
1840
- result = val[0].dup << new_symbol_list_entry(val)
1967
+ list, * = val
1968
+ result = list.dup << new_symbol_list_entry(val)
1841
1969
  }
1842
1970
 
1843
1971
  qwords: tQWORDS_BEG tSPACE tSTRING_END
1844
1972
  {
1845
- result = s(:array)
1973
+ result = s(:array).line lexer.lineno
1846
1974
  }
1847
1975
  | tQWORDS_BEG qword_list tSTRING_END
1848
1976
  {
@@ -1851,7 +1979,7 @@ opt_block_args_tail: tCOMMA block_args_tail
1851
1979
 
1852
1980
  qsymbols: tQSYMBOLS_BEG tSPACE tSTRING_END
1853
1981
  {
1854
- result = s(:array)
1982
+ result = s(:array).line lexer.lineno # FIX
1855
1983
  }
1856
1984
  | tQSYMBOLS_BEG qsym_list tSTRING_END
1857
1985
  {
@@ -1878,11 +2006,12 @@ opt_block_args_tail: tCOMMA block_args_tail
1878
2006
 
1879
2007
  string_contents: none
1880
2008
  {
1881
- result = s(:str, "")
2009
+ result = s(:str, "").line lexer.lineno
1882
2010
  }
1883
2011
  | string_contents string_content
1884
2012
  {
1885
- result = literal_concat(val[0], val[1])
2013
+ v1, v2 = val
2014
+ result = literal_concat v1, v2
1886
2015
  }
1887
2016
 
1888
2017
  xstring_contents: none
@@ -1891,7 +2020,8 @@ xstring_contents: none
1891
2020
  }
1892
2021
  | xstring_contents string_content
1893
2022
  {
1894
- result = literal_concat(val[0], val[1])
2023
+ v1, v2 = val
2024
+ result = literal_concat v1, v2
1895
2025
  }
1896
2026
 
1897
2027
  regexp_contents: none
@@ -1900,7 +2030,8 @@ regexp_contents: none
1900
2030
  }
1901
2031
  | regexp_contents string_content
1902
2032
  {
1903
- result = literal_concat(val[0], val[1])
2033
+ v1, v2 = val
2034
+ result = literal_concat v1, v2
1904
2035
  }
1905
2036
 
1906
2037
  string_content: tSTRING_CONTENT
@@ -1916,8 +2047,9 @@ regexp_contents: none
1916
2047
  }
1917
2048
  string_dvar
1918
2049
  {
1919
- lexer.lex_strterm = val[1]
1920
- result = s(:evstr, val[2])
2050
+ _, strterm, str = val
2051
+ lexer.lex_strterm = strterm
2052
+ result = s(:evstr, str).line str.line
1921
2053
  }
1922
2054
  | tSTRING_DBEG
1923
2055
  {
@@ -1927,6 +2059,7 @@ regexp_contents: none
1927
2059
  lexer.cond.store,
1928
2060
  lexer.cmdarg.store,
1929
2061
  lexer.lex_state,
2062
+ lexer.lineno,
1930
2063
  ]
1931
2064
 
1932
2065
  lexer.lex_strterm = nil
@@ -1940,7 +2073,7 @@ regexp_contents: none
1940
2073
  {
1941
2074
  _, memo, stmt, _ = val
1942
2075
 
1943
- lex_strterm, brace_nest, string_nest, oldcond, oldcmdarg, oldlex_state = memo
2076
+ lex_strterm, brace_nest, string_nest, oldcond, oldcmdarg, oldlex_state, line = memo
1944
2077
 
1945
2078
  lexer.lex_strterm = lex_strterm
1946
2079
  lexer.brace_nest = brace_nest
@@ -1957,19 +2090,19 @@ regexp_contents: none
1957
2090
  when :str, :dstr, :evstr then
1958
2091
  result = stmt
1959
2092
  else
1960
- result = s(:evstr, stmt)
2093
+ result = s(:evstr, stmt).line line
1961
2094
  end
1962
2095
  when nil then
1963
- result = s(:evstr)
2096
+ result = s(:evstr).line line
1964
2097
  else
1965
2098
  debug20 25
1966
2099
  raise "unknown string body: #{stmt.inspect}"
1967
2100
  end
1968
2101
  }
1969
2102
 
1970
- string_dvar: tGVAR { result = s(:gvar, val[0].to_sym) }
1971
- | tIVAR { result = s(:ivar, val[0].to_sym) }
1972
- | tCVAR { result = s(:cvar, val[0].to_sym) }
2103
+ string_dvar: tGVAR { result = s(:gvar, val[0].to_sym).line lexer.lineno }
2104
+ | tIVAR { result = s(:ivar, val[0].to_sym).line lexer.lineno }
2105
+ | tCVAR { result = s(:cvar, val[0].to_sym).line lexer.lineno }
1973
2106
  | backref
1974
2107
 
1975
2108
  symbol: tSYMBEG sym
@@ -1986,18 +2119,19 @@ regexp_contents: none
1986
2119
 
1987
2120
  dsym: tSYMBEG xstring_contents tSTRING_END
1988
2121
  {
2122
+ _, result, _ = val
2123
+
1989
2124
  lexer.lex_state = EXPR_END
1990
- result = val[1]
1991
2125
 
1992
- result ||= s(:str, "")
2126
+ result ||= s(:str, "").line lexer.lineno
1993
2127
 
1994
2128
  case result.sexp_type
1995
2129
  when :dstr then
1996
2130
  result.sexp_type = :dsym
1997
2131
  when :str then
1998
- result = s(:lit, result.last.to_sym)
2132
+ result = s(:lit, result.last.to_sym).line result.line
1999
2133
  when :evstr then
2000
- result = s(:dsym, "", result)
2134
+ result = s(:dsym, "", result).line result.line
2001
2135
  else
2002
2136
  debug20 26, val, result
2003
2137
  end
@@ -2020,19 +2154,20 @@ regexp_contents: none
2020
2154
  | tCONSTANT
2021
2155
  | tCVAR
2022
2156
 
2023
- keyword_variable: kNIL { result = s(:nil) }
2024
- | kSELF { result = s(:self) }
2025
- | kTRUE { result = s(:true) }
2026
- | kFALSE { result = s(:false) }
2027
- | k__FILE__ { result = s(:str, self.file) }
2028
- | k__LINE__ { result = s(:lit, lexer.lineno) }
2157
+ keyword_variable: kNIL { result = s(:nil).line lexer.lineno }
2158
+ | kSELF { result = s(:self).line lexer.lineno }
2159
+ | kTRUE { result = s(:true).line lexer.lineno }
2160
+ | kFALSE { result = s(:false).line lexer.lineno }
2161
+ | k__FILE__ { result = s(:str, self.file).line lexer.lineno }
2162
+ | k__LINE__ { result = s(:lit, lexer.lineno).line lexer.lineno }
2029
2163
  | k__ENCODING__
2030
2164
  {
2165
+ l = lexer.lineno
2031
2166
  result =
2032
2167
  if defined? Encoding then
2033
- s(:colon2, s(:const, :Encoding), :UTF_8)
2168
+ s(:colon2, s(:const, :Encoding).line(l), :UTF_8).line l
2034
2169
  else
2035
- s(:str, "Unsupported!")
2170
+ s(:str, "Unsupported!").line l
2036
2171
  end
2037
2172
  }
2038
2173
 
@@ -2057,8 +2192,8 @@ keyword_variable: kNIL { result = s(:nil) }
2057
2192
  debug20 29, val, result
2058
2193
  }
2059
2194
 
2060
- backref: tNTH_REF { result = s(:nth_ref, val[0]) }
2061
- | tBACK_REF { result = s(:back_ref, val[0]) }
2195
+ backref: tNTH_REF { result = s(:nth_ref, val[0]).line lexer.lineno }
2196
+ | tBACK_REF { result = s(:back_ref, val[0]).line lexer.lineno }
2062
2197
 
2063
2198
  superclass: tLT
2064
2199
  {
@@ -2213,12 +2348,13 @@ keyword_variable: kNIL { result = s(:nil) }
2213
2348
 
2214
2349
  f_arg: f_arg_item
2215
2350
  {
2216
- case val[0]
2351
+ arg, = val
2352
+
2353
+ case arg
2217
2354
  when Symbol then
2218
- result = s(:args)
2219
- result << val[0]
2355
+ result = s(:args, arg).line lexer.lineno
2220
2356
  when Sexp then
2221
- result = val[0]
2357
+ result = arg
2222
2358
  else
2223
2359
  debug20 32
2224
2360
  raise "Unknown f_arg type: #{val.inspect}"
@@ -2231,7 +2367,7 @@ keyword_variable: kNIL { result = s(:nil) }
2231
2367
  if list.sexp_type == :args then
2232
2368
  result = list
2233
2369
  else
2234
- result = s(:args, list)
2370
+ result = s(:args, list).line list.line
2235
2371
  end
2236
2372
 
2237
2373
  result << item
@@ -2241,38 +2377,42 @@ keyword_variable: kNIL { result = s(:nil) }
2241
2377
 
2242
2378
  f_kw: f_label arg_value
2243
2379
  {
2244
- # TODO: call_args
2245
- label, _ = val[0] # TODO: fix lineno?
2380
+ # TODO: new_kw_arg
2381
+ (label, line), arg = val
2382
+
2246
2383
  identifier = label.to_sym
2247
2384
  self.env[identifier] = :lvar
2248
2385
 
2249
- result = s(:array, s(:kwarg, identifier, val[1]))
2386
+ kwarg = s(:kwarg, identifier, arg).line line
2387
+ result = s(:array, kwarg).line line
2250
2388
  }
2251
2389
  | f_label
2252
2390
  {
2253
- label, _ = val[0] # TODO: fix lineno?
2254
- identifier = label.to_sym
2255
- self.env[identifier] = :lvar
2391
+ (label, line), = val
2256
2392
 
2257
- result = s(:array, s(:kwarg, identifier))
2393
+ id = label.to_sym
2394
+ self.env[id] = :lvar
2395
+
2396
+ result = s(:array, s(:kwarg, id).line(line)).line line
2258
2397
  }
2259
2398
 
2260
2399
  f_block_kw: f_label primary_value
2261
2400
  {
2262
- # TODO: call_args
2263
- label, _ = val[0] # TODO: fix lineno?
2264
- identifier = label.to_sym
2265
- self.env[identifier] = :lvar
2401
+ # TODO: new_kw_arg
2402
+ (label, line), expr = val
2403
+ id = label.to_sym
2404
+ self.env[id] = :lvar
2266
2405
 
2267
- result = s(:array, s(:kwarg, identifier, val[1]))
2406
+ result = s(:array, s(:kwarg, id, expr).line(line)).line line
2268
2407
  }
2269
2408
  | f_label
2270
2409
  {
2271
- label, _ = val[0] # TODO: fix lineno?
2272
- identifier = label.to_sym
2273
- self.env[identifier] = :lvar
2410
+ # TODO: new_kw_arg
2411
+ (label, line), = val
2412
+ id = label.to_sym
2413
+ self.env[id] = :lvar
2274
2414
 
2275
- result = s(:array, s(:kwarg, identifier))
2415
+ result = s(:array, s(:kwarg, id).line(line)).line line
2276
2416
  }
2277
2417
 
2278
2418
  f_block_kwarg: f_block_kw
@@ -2315,17 +2455,20 @@ keyword_variable: kNIL { result = s(:nil) }
2315
2455
 
2316
2456
  f_block_optarg: f_block_opt
2317
2457
  {
2318
- result = s(:block, val[0])
2458
+ optblk, = val
2459
+ result = s(:block, optblk).line optblk.line
2319
2460
  }
2320
2461
  | f_block_optarg tCOMMA f_block_opt
2321
2462
  {
2322
- result = val[0]
2323
- result << val[2]
2463
+ optarg, _, optblk = val
2464
+ result = optarg
2465
+ result << optblk
2324
2466
  }
2325
2467
 
2326
2468
  f_optarg: f_opt
2327
2469
  {
2328
- result = s(:block, val[0])
2470
+ opt, = val
2471
+ result = s(:block, opt).line opt.line
2329
2472
  }
2330
2473
  | f_optarg tCOMMA f_opt
2331
2474
  {
@@ -2379,14 +2522,11 @@ keyword_variable: kNIL { result = s(:nil) }
2379
2522
  result.sexp_type == :lit
2380
2523
  }
2381
2524
 
2382
- assoc_list: none # [!nil]
2525
+ assoc_list: none
2383
2526
  {
2384
- result = s(:array)
2385
- }
2386
- | assocs trailer # [!nil]
2387
- {
2388
- result = val[0]
2527
+ result = s(:array).line lexer.lineno
2389
2528
  }
2529
+ | assocs trailer
2390
2530
 
2391
2531
  assocs: assoc
2392
2532
  | assocs tCOMMA assoc
@@ -2400,16 +2540,21 @@ keyword_variable: kNIL { result = s(:nil) }
2400
2540
 
2401
2541
  assoc: arg_value tASSOC arg_value
2402
2542
  {
2403
- result = s(:array, val[0], val[2])
2543
+ v1, _, v2 = val
2544
+ result = s(:array, v1, v2).line v1.line
2404
2545
  }
2405
2546
  | tLABEL arg_value
2406
2547
  {
2407
- (label, _), arg = val
2408
- result = s(:array, s(:lit, label.to_sym), arg)
2548
+ (label, line), arg = val
2549
+
2550
+ lit = s(:lit, label.to_sym).line line
2551
+ result = s(:array, lit, arg).line line
2409
2552
  }
2410
2553
  | tDSTAR arg_value
2411
2554
  {
2412
- result = s(:array, s(:kwsplat, val[1]))
2555
+ _, arg = val
2556
+ line = arg.line
2557
+ result = s(:array, s(:kwsplat, arg).line(line)).line line
2413
2558
  }
2414
2559
 
2415
2560
  operation: tIDENTIFIER | tCONSTANT | tFID