brakeman 4.5.1 → 5.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (597) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +347 -110
  3. data/README.md +24 -8
  4. data/bundle/load.rb +15 -13
  5. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/erubis-2.7.0/CHANGES.txt +0 -0
  6. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/erubis-2.7.0/MIT-LICENSE +0 -0
  7. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/erubis-2.7.0/README.txt +0 -0
  8. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/erubis-2.7.0/contrib/erubis +0 -0
  9. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/erubis-2.7.0/contrib/erubis-run.rb +0 -0
  10. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/erubis-2.7.0/contrib/inline-require +0 -0
  11. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/context.rb +0 -0
  12. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/converter.rb +0 -0
  13. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/engine/ec.rb +0 -0
  14. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/engine/ecpp.rb +0 -0
  15. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/engine/ejava.rb +0 -0
  16. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/engine/ejavascript.rb +0 -0
  17. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/engine/enhanced.rb +0 -0
  18. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/engine/eperl.rb +0 -0
  19. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/engine/ephp.rb +0 -0
  20. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/engine/eruby.rb +0 -0
  21. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/engine/escheme.rb +0 -0
  22. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/engine/optimized.rb +0 -0
  23. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/engine.rb +0 -0
  24. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/enhancer.rb +0 -0
  25. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/error.rb +0 -0
  26. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/evaluator.rb +0 -0
  27. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/generator.rb +0 -0
  28. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/helper.rb +0 -0
  29. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/helpers/rails_form_helper.rb +0 -0
  30. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/helpers/rails_helper.rb +0 -0
  31. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/local-setting.rb +0 -0
  32. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/main.rb +0 -0
  33. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/preprocessing.rb +0 -0
  34. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/tiny.rb +0 -0
  35. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/util.rb +0 -0
  36. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis.rb +0 -0
  37. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/erubis-2.7.0/setup.rb +0 -0
  38. data/bundle/ruby/{2.5.0/gems/haml-4.0.7 → 2.7.0/gems/haml-5.2.2}/CHANGELOG.md +146 -4
  39. data/bundle/ruby/{2.5.0/gems/haml-4.0.7 → 2.7.0/gems/haml-5.2.2}/FAQ.md +4 -14
  40. data/bundle/ruby/2.7.0/gems/haml-5.2.2/Gemfile +16 -0
  41. data/bundle/ruby/2.7.0/gems/haml-5.2.2/MIT-LICENSE +20 -0
  42. data/bundle/ruby/{2.5.0/gems/haml-4.0.7 → 2.7.0/gems/haml-5.2.2}/README.md +90 -47
  43. data/bundle/ruby/{2.5.0/gems/haml-4.0.7 → 2.7.0/gems/haml-5.2.2}/REFERENCE.md +160 -74
  44. data/bundle/ruby/2.7.0/gems/haml-5.2.2/TODO +24 -0
  45. data/bundle/ruby/2.7.0/gems/haml-5.2.2/haml.gemspec +45 -0
  46. data/bundle/ruby/2.7.0/gems/haml-5.2.2/lib/haml/attribute_builder.rb +219 -0
  47. data/bundle/ruby/2.7.0/gems/haml-5.2.2/lib/haml/attribute_compiler.rb +237 -0
  48. data/bundle/ruby/2.7.0/gems/haml-5.2.2/lib/haml/attribute_parser.rb +150 -0
  49. data/bundle/ruby/2.7.0/gems/haml-5.2.2/lib/haml/buffer.rb +182 -0
  50. data/bundle/ruby/2.7.0/gems/haml-5.2.2/lib/haml/compiler.rb +330 -0
  51. data/bundle/ruby/{2.5.0/gems/haml-4.0.7 → 2.7.0/gems/haml-5.2.2}/lib/haml/engine.rb +34 -41
  52. data/bundle/ruby/2.7.0/gems/haml-5.2.2/lib/haml/error.rb +65 -0
  53. data/bundle/ruby/2.7.0/gems/haml-5.2.2/lib/haml/escapable.rb +77 -0
  54. data/bundle/ruby/{2.5.0/gems/haml-4.0.7 → 2.7.0/gems/haml-5.2.2}/lib/haml/exec.rb +38 -20
  55. data/bundle/ruby/{2.5.0/gems/haml-4.0.7 → 2.7.0/gems/haml-5.2.2}/lib/haml/filters.rb +22 -27
  56. data/bundle/ruby/2.7.0/gems/haml-5.2.2/lib/haml/generator.rb +42 -0
  57. data/bundle/ruby/{2.5.0/gems/haml-4.0.7 → 2.7.0/gems/haml-5.2.2}/lib/haml/helpers/action_view_extensions.rb +4 -2
  58. data/bundle/ruby/{2.5.0/gems/haml-4.0.7 → 2.7.0/gems/haml-5.2.2}/lib/haml/helpers/action_view_mods.rb +45 -60
  59. data/bundle/ruby/{2.5.0/gems/haml-4.0.7 → 2.7.0/gems/haml-5.2.2}/lib/haml/helpers/action_view_xss_mods.rb +2 -0
  60. data/bundle/ruby/2.7.0/gems/haml-5.2.2/lib/haml/helpers/safe_erubi_template.rb +20 -0
  61. data/bundle/ruby/{2.5.0/gems/haml-4.0.7 → 2.7.0/gems/haml-5.2.2}/lib/haml/helpers/safe_erubis_template.rb +5 -1
  62. data/bundle/ruby/{2.5.0/gems/haml-4.0.7 → 2.7.0/gems/haml-5.2.2}/lib/haml/helpers/xss_mods.rb +23 -13
  63. data/bundle/ruby/{2.5.0/gems/haml-4.0.7 → 2.7.0/gems/haml-5.2.2}/lib/haml/helpers.rb +134 -89
  64. data/bundle/ruby/{2.5.0/gems/haml-4.0.7 → 2.7.0/gems/haml-5.2.2}/lib/haml/options.rb +63 -69
  65. data/bundle/ruby/{2.5.0/gems/haml-4.0.7 → 2.7.0/gems/haml-5.2.2}/lib/haml/parser.rb +319 -227
  66. data/bundle/ruby/2.7.0/gems/haml-5.2.2/lib/haml/plugin.rb +54 -0
  67. data/bundle/ruby/2.7.0/gems/haml-5.2.2/lib/haml/railtie.rb +53 -0
  68. data/bundle/ruby/{2.5.0/gems/haml-4.0.7 → 2.7.0/gems/haml-5.2.2}/lib/haml/sass_rails_filter.rb +18 -4
  69. data/bundle/ruby/{2.5.0/gems/haml-4.0.7 → 2.7.0/gems/haml-5.2.2}/lib/haml/template/options.rb +13 -2
  70. data/bundle/ruby/{2.5.0/gems/haml-4.0.7 → 2.7.0/gems/haml-5.2.2}/lib/haml/template.rb +13 -6
  71. data/bundle/ruby/2.7.0/gems/haml-5.2.2/lib/haml/temple_engine.rb +124 -0
  72. data/bundle/ruby/2.7.0/gems/haml-5.2.2/lib/haml/temple_line_counter.rb +30 -0
  73. data/bundle/ruby/2.7.0/gems/haml-5.2.2/lib/haml/util.rb +258 -0
  74. data/bundle/ruby/2.7.0/gems/haml-5.2.2/lib/haml/version.rb +5 -0
  75. data/bundle/ruby/{2.5.0/gems/haml-4.0.7 → 2.7.0/gems/haml-5.2.2}/lib/haml.rb +2 -0
  76. data/bundle/ruby/2.7.0/gems/haml-5.2.2/yard/default/fulldoc/html/css/common.sass +15 -0
  77. data/bundle/ruby/2.7.0/gems/haml-5.2.2/yard/default/layout/html/footer.erb +12 -0
  78. data/bundle/ruby/{2.5.0/gems/highline-2.0.2 → 2.7.0/gems/highline-2.0.3}/AUTHORS +0 -0
  79. data/bundle/ruby/{2.5.0/gems/highline-2.0.2 → 2.7.0/gems/highline-2.0.3}/COPYING +0 -0
  80. data/bundle/ruby/{2.5.0/gems/highline-2.0.2 → 2.7.0/gems/highline-2.0.3}/Changelog.md +3 -0
  81. data/bundle/ruby/{2.5.0/gems/highline-2.0.2 → 2.7.0/gems/highline-2.0.3}/Gemfile +0 -0
  82. data/bundle/ruby/{2.5.0/gems/highline-2.0.2 → 2.7.0/gems/highline-2.0.3}/LICENSE +0 -0
  83. data/bundle/ruby/{2.5.0/gems/highline-2.0.2 → 2.7.0/gems/highline-2.0.3}/README.md +0 -0
  84. data/bundle/ruby/{2.5.0/gems/highline-2.0.2 → 2.7.0/gems/highline-2.0.3}/TODO +0 -0
  85. data/bundle/ruby/{2.5.0/gems/highline-2.0.2 → 2.7.0/gems/highline-2.0.3}/appveyor.yml +0 -0
  86. data/bundle/ruby/{2.5.0/gems/highline-2.0.2 → 2.7.0/gems/highline-2.0.3}/highline.gemspec +0 -0
  87. data/bundle/ruby/{2.5.0/gems/highline-2.0.2 → 2.7.0/gems/highline-2.0.3}/lib/highline/builtin_styles.rb +0 -0
  88. data/bundle/ruby/{2.5.0/gems/highline-2.0.2 → 2.7.0/gems/highline-2.0.3}/lib/highline/color_scheme.rb +0 -0
  89. data/bundle/ruby/{2.5.0/gems/highline-2.0.2 → 2.7.0/gems/highline-2.0.3}/lib/highline/compatibility.rb +0 -0
  90. data/bundle/ruby/{2.5.0/gems/highline-2.0.2 → 2.7.0/gems/highline-2.0.3}/lib/highline/custom_errors.rb +0 -0
  91. data/bundle/ruby/{2.5.0/gems/highline-2.0.2 → 2.7.0/gems/highline-2.0.3}/lib/highline/import.rb +0 -0
  92. data/bundle/ruby/{2.5.0/gems/highline-2.0.2 → 2.7.0/gems/highline-2.0.3}/lib/highline/io_console_compatible.rb +0 -0
  93. data/bundle/ruby/{2.5.0/gems/highline-2.0.2 → 2.7.0/gems/highline-2.0.3}/lib/highline/list.rb +0 -0
  94. data/bundle/ruby/{2.5.0/gems/highline-2.0.2 → 2.7.0/gems/highline-2.0.3}/lib/highline/list_renderer.rb +0 -0
  95. data/bundle/ruby/{2.5.0/gems/highline-2.0.2 → 2.7.0/gems/highline-2.0.3}/lib/highline/menu/item.rb +0 -0
  96. data/bundle/ruby/{2.5.0/gems/highline-2.0.2 → 2.7.0/gems/highline-2.0.3}/lib/highline/menu.rb +0 -0
  97. data/bundle/ruby/{2.5.0/gems/highline-2.0.2 → 2.7.0/gems/highline-2.0.3}/lib/highline/paginator.rb +0 -0
  98. data/bundle/ruby/{2.5.0/gems/highline-2.0.2 → 2.7.0/gems/highline-2.0.3}/lib/highline/question/answer_converter.rb +0 -0
  99. data/bundle/ruby/{2.5.0/gems/highline-2.0.2 → 2.7.0/gems/highline-2.0.3}/lib/highline/question.rb +0 -0
  100. data/bundle/ruby/{2.5.0/gems/highline-2.0.2 → 2.7.0/gems/highline-2.0.3}/lib/highline/question_asker.rb +0 -0
  101. data/bundle/ruby/{2.5.0/gems/highline-2.0.2 → 2.7.0/gems/highline-2.0.3}/lib/highline/simulate.rb +0 -0
  102. data/bundle/ruby/{2.5.0/gems/highline-2.0.2 → 2.7.0/gems/highline-2.0.3}/lib/highline/statement.rb +0 -0
  103. data/bundle/ruby/{2.5.0/gems/highline-2.0.2 → 2.7.0/gems/highline-2.0.3}/lib/highline/string.rb +0 -0
  104. data/bundle/ruby/{2.5.0/gems/highline-2.0.2 → 2.7.0/gems/highline-2.0.3}/lib/highline/string_extensions.rb +0 -0
  105. data/bundle/ruby/{2.5.0/gems/highline-2.0.2 → 2.7.0/gems/highline-2.0.3}/lib/highline/style.rb +0 -0
  106. data/bundle/ruby/{2.5.0/gems/highline-2.0.2 → 2.7.0/gems/highline-2.0.3}/lib/highline/template_renderer.rb +0 -0
  107. data/bundle/ruby/{2.5.0/gems/highline-2.0.2 → 2.7.0/gems/highline-2.0.3}/lib/highline/terminal/io_console.rb +0 -0
  108. data/bundle/ruby/{2.5.0/gems/highline-2.0.2 → 2.7.0/gems/highline-2.0.3}/lib/highline/terminal/ncurses.rb +0 -0
  109. data/bundle/ruby/{2.5.0/gems/highline-2.0.2 → 2.7.0/gems/highline-2.0.3}/lib/highline/terminal/unix_stty.rb +0 -0
  110. data/bundle/ruby/{2.5.0/gems/highline-2.0.2 → 2.7.0/gems/highline-2.0.3}/lib/highline/terminal.rb +0 -0
  111. data/bundle/ruby/{2.5.0/gems/highline-2.0.2 → 2.7.0/gems/highline-2.0.3}/lib/highline/version.rb +1 -1
  112. data/bundle/ruby/{2.5.0/gems/highline-2.0.2 → 2.7.0/gems/highline-2.0.3}/lib/highline/wrapper.rb +0 -0
  113. data/bundle/ruby/{2.5.0/gems/highline-2.0.2 → 2.7.0/gems/highline-2.0.3}/lib/highline.rb +0 -0
  114. data/bundle/ruby/2.7.0/gems/parallel-1.22.1/MIT-LICENSE.txt +20 -0
  115. data/bundle/ruby/2.7.0/gems/parallel-1.22.1/lib/parallel/processor_count.rb +44 -0
  116. data/bundle/ruby/2.7.0/gems/parallel-1.22.1/lib/parallel/version.rb +4 -0
  117. data/bundle/ruby/2.7.0/gems/parallel-1.22.1/lib/parallel.rb +612 -0
  118. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/LICENSE.txt +22 -0
  119. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/NEWS.md +178 -0
  120. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/README.md +48 -0
  121. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/attlistdecl.rb +63 -0
  122. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/attribute.rb +205 -0
  123. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/cdata.rb +68 -0
  124. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/child.rb +97 -0
  125. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/comment.rb +80 -0
  126. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/doctype.rb +311 -0
  127. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/document.rb +451 -0
  128. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/dtd/attlistdecl.rb +11 -0
  129. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/dtd/dtd.rb +47 -0
  130. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/dtd/elementdecl.rb +18 -0
  131. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/dtd/entitydecl.rb +57 -0
  132. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/dtd/notationdecl.rb +40 -0
  133. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/element.rb +2599 -0
  134. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/encoding.rb +51 -0
  135. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/entity.rb +171 -0
  136. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/formatters/default.rb +116 -0
  137. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/formatters/pretty.rb +142 -0
  138. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/formatters/transitive.rb +58 -0
  139. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/functions.rb +447 -0
  140. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/instruction.rb +79 -0
  141. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/light/node.rb +188 -0
  142. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/namespace.rb +59 -0
  143. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/node.rb +76 -0
  144. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/output.rb +30 -0
  145. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/parent.rb +166 -0
  146. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/parseexception.rb +52 -0
  147. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb +694 -0
  148. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/parsers/lightparser.rb +59 -0
  149. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/parsers/pullparser.rb +197 -0
  150. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/parsers/sax2parser.rb +273 -0
  151. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/parsers/streamparser.rb +61 -0
  152. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/parsers/treeparser.rb +101 -0
  153. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/parsers/ultralightparser.rb +57 -0
  154. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/parsers/xpathparser.rb +689 -0
  155. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/quickpath.rb +266 -0
  156. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/rexml.rb +37 -0
  157. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/sax2listener.rb +98 -0
  158. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/security.rb +28 -0
  159. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/source.rb +298 -0
  160. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/streamlistener.rb +93 -0
  161. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/text.rb +424 -0
  162. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/undefinednamespaceexception.rb +9 -0
  163. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/validation/relaxng.rb +539 -0
  164. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/validation/validation.rb +144 -0
  165. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/validation/validationexception.rb +10 -0
  166. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/xmldecl.rb +130 -0
  167. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/xmltokens.rb +85 -0
  168. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/xpath.rb +81 -0
  169. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml/xpath_parser.rb +974 -0
  170. data/bundle/ruby/2.7.0/gems/rexml-3.2.5/lib/rexml.rb +3 -0
  171. data/bundle/ruby/{2.5.0/gems/ruby2ruby-2.4.2 → 2.7.0/gems/ruby2ruby-2.4.4}/History.rdoc +19 -5
  172. data/bundle/ruby/{2.5.0/gems/ruby2ruby-2.4.2 → 2.7.0/gems/ruby2ruby-2.4.4}/Manifest.txt +0 -0
  173. data/bundle/ruby/{2.5.0/gems/ruby2ruby-2.4.2 → 2.7.0/gems/ruby2ruby-2.4.4}/README.rdoc +0 -0
  174. data/bundle/ruby/{2.5.0/gems/ruby2ruby-2.4.2 → 2.7.0/gems/ruby2ruby-2.4.4}/lib/ruby2ruby.rb +122 -112
  175. data/bundle/ruby/{2.5.0/gems/ruby_parser-3.13.1 → 2.7.0/gems/ruby_parser-3.19.1}/History.rdoc +232 -0
  176. data/bundle/ruby/{2.5.0/gems/ruby_parser-3.13.1 → 2.7.0/gems/ruby_parser-3.19.1}/Manifest.txt +9 -0
  177. data/bundle/ruby/{2.5.0/gems/ruby_parser-3.13.1 → 2.7.0/gems/ruby_parser-3.19.1}/README.rdoc +12 -9
  178. data/bundle/ruby/{2.5.0/gems/ruby_parser-3.13.1 → 2.7.0/gems/ruby_parser-3.19.1}/compare/normalize.rb +51 -6
  179. data/bundle/ruby/2.7.0/gems/ruby_parser-3.19.1/debugging.md +190 -0
  180. data/bundle/ruby/2.7.0/gems/ruby_parser-3.19.1/gauntlet.md +107 -0
  181. data/bundle/ruby/{2.5.0/gems/ruby_parser-3.13.1 → 2.7.0/gems/ruby_parser-3.19.1}/lib/rp_extensions.rb +15 -36
  182. data/bundle/ruby/2.7.0/gems/ruby_parser-3.19.1/lib/rp_stringscanner.rb +33 -0
  183. data/bundle/ruby/2.7.0/gems/ruby_parser-3.19.1/lib/ruby20_parser.rb +10973 -0
  184. data/bundle/ruby/{2.5.0/gems/ruby_parser-3.13.1/lib/ruby_parser.yy → 2.7.0/gems/ruby_parser-3.19.1/lib/ruby20_parser.y} +710 -609
  185. data/bundle/ruby/2.7.0/gems/ruby_parser-3.19.1/lib/ruby21_parser.rb +10980 -0
  186. data/bundle/ruby/{2.5.0/gems/ruby_parser-3.13.1 → 2.7.0/gems/ruby_parser-3.19.1}/lib/ruby21_parser.y +718 -467
  187. data/bundle/ruby/2.7.0/gems/ruby_parser-3.19.1/lib/ruby22_parser.rb +11123 -0
  188. data/bundle/ruby/{2.5.0/gems/ruby_parser-3.13.1/lib/ruby24_parser.y → 2.7.0/gems/ruby_parser-3.19.1/lib/ruby22_parser.y} +723 -478
  189. data/bundle/ruby/2.7.0/gems/ruby_parser-3.19.1/lib/ruby23_parser.rb +11132 -0
  190. data/bundle/ruby/{2.5.0/gems/ruby_parser-3.13.1/lib/ruby26_parser.y → 2.7.0/gems/ruby_parser-3.19.1/lib/ruby23_parser.y} +722 -487
  191. data/bundle/ruby/2.7.0/gems/ruby_parser-3.19.1/lib/ruby24_parser.rb +11231 -0
  192. data/bundle/ruby/2.7.0/gems/ruby_parser-3.19.1/lib/ruby24_parser.y +2721 -0
  193. data/bundle/ruby/2.7.0/gems/ruby_parser-3.19.1/lib/ruby25_parser.rb +11231 -0
  194. data/bundle/ruby/{2.5.0/gems/ruby_parser-3.13.1 → 2.7.0/gems/ruby_parser-3.19.1}/lib/ruby25_parser.y +726 -471
  195. data/bundle/ruby/2.7.0/gems/ruby_parser-3.19.1/lib/ruby26_parser.rb +11253 -0
  196. data/bundle/ruby/2.7.0/gems/ruby_parser-3.19.1/lib/ruby26_parser.y +2736 -0
  197. data/bundle/ruby/2.7.0/gems/ruby_parser-3.19.1/lib/ruby27_parser.rb +12980 -0
  198. data/bundle/ruby/2.7.0/gems/ruby_parser-3.19.1/lib/ruby27_parser.y +3324 -0
  199. data/bundle/ruby/2.7.0/gems/ruby_parser-3.19.1/lib/ruby30_parser.rb +13242 -0
  200. data/bundle/ruby/2.7.0/gems/ruby_parser-3.19.1/lib/ruby30_parser.y +3447 -0
  201. data/bundle/ruby/2.7.0/gems/ruby_parser-3.19.1/lib/ruby31_parser.rb +13622 -0
  202. data/bundle/ruby/2.7.0/gems/ruby_parser-3.19.1/lib/ruby31_parser.y +3481 -0
  203. data/bundle/ruby/2.7.0/gems/ruby_parser-3.19.1/lib/ruby3_parser.yy +3536 -0
  204. data/bundle/ruby/2.7.0/gems/ruby_parser-3.19.1/lib/ruby_lexer.rb +1144 -0
  205. data/bundle/ruby/{2.5.0/gems/ruby_parser-3.13.1 → 2.7.0/gems/ruby_parser-3.19.1}/lib/ruby_lexer.rex +33 -27
  206. data/bundle/ruby/{2.5.0/gems/ruby_parser-3.13.1 → 2.7.0/gems/ruby_parser-3.19.1}/lib/ruby_lexer.rex.rb +65 -31
  207. data/bundle/ruby/2.7.0/gems/ruby_parser-3.19.1/lib/ruby_lexer_strings.rb +638 -0
  208. data/bundle/ruby/{2.5.0/gems/ruby_parser-3.13.1 → 2.7.0/gems/ruby_parser-3.19.1}/lib/ruby_parser.rb +33 -27
  209. data/bundle/ruby/2.7.0/gems/ruby_parser-3.19.1/lib/ruby_parser.yy +3465 -0
  210. data/bundle/ruby/{2.5.0/gems/ruby_parser-3.13.1 → 2.7.0/gems/ruby_parser-3.19.1}/lib/ruby_parser_extras.rb +949 -465
  211. data/bundle/ruby/{2.5.0/gems/ruby_parser-3.13.1 → 2.7.0/gems/ruby_parser-3.19.1}/tools/munge.rb +44 -11
  212. data/bundle/ruby/2.7.0/gems/ruby_parser-3.19.1/tools/ripper.rb +44 -0
  213. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/ruby_parser-legacy-1.0.0/History.rdoc +0 -0
  214. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/ruby_parser-legacy-1.0.0/Manifest.txt +0 -0
  215. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/ruby_parser-legacy-1.0.0/README.rdoc +0 -0
  216. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy/ruby18_parser.rb +0 -0
  217. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy/ruby18_parser.y +0 -0
  218. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy/ruby19_parser.rb +0 -0
  219. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy/ruby19_parser.y +0 -0
  220. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy/ruby_lexer.rb +0 -0
  221. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy/ruby_lexer.rex +0 -0
  222. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy/ruby_lexer.rex.rb +0 -0
  223. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy/ruby_parser.rb +0 -0
  224. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy/ruby_parser_extras.rb +0 -0
  225. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy.rb +0 -0
  226. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/safe_yaml-1.0.5/CHANGES.md +0 -0
  227. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/safe_yaml-1.0.5/Gemfile +0 -0
  228. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/safe_yaml-1.0.5/LICENSE.txt +0 -0
  229. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/safe_yaml-1.0.5/README.md +0 -0
  230. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/safe_yaml-1.0.5/bundle_install_all_ruby_versions.sh +0 -0
  231. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/deep.rb +0 -0
  232. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/libyaml_checker.rb +0 -0
  233. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/load.rb +0 -0
  234. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/parse/date.rb +0 -0
  235. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/parse/hexadecimal.rb +0 -0
  236. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/parse/sexagesimal.rb +0 -0
  237. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/psych_handler.rb +0 -0
  238. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/psych_resolver.rb +0 -0
  239. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/resolver.rb +0 -0
  240. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/safe_to_ruby_visitor.rb +0 -0
  241. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/store.rb +0 -0
  242. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/syck_hack.rb +0 -0
  243. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/syck_node_monkeypatch.rb +0 -0
  244. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/syck_resolver.rb +0 -0
  245. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/transform/to_boolean.rb +0 -0
  246. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/transform/to_date.rb +0 -0
  247. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/transform/to_float.rb +0 -0
  248. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/transform/to_integer.rb +0 -0
  249. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/transform/to_nil.rb +0 -0
  250. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/transform/to_symbol.rb +0 -0
  251. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/transform/transformation_map.rb +0 -0
  252. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/transform.rb +0 -0
  253. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/version.rb +0 -0
  254. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml.rb +0 -0
  255. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/safe_yaml-1.0.5/run_specs_all_ruby_versions.sh +0 -0
  256. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/safe_yaml-1.0.5/safe_yaml.gemspec +0 -0
  257. data/bundle/ruby/{2.5.0/gems/sexp_processor-4.12.0 → 2.7.0/gems/sexp_processor-4.16.1}/History.rdoc +86 -0
  258. data/bundle/ruby/{2.5.0/gems/sexp_processor-4.12.0 → 2.7.0/gems/sexp_processor-4.16.1}/Manifest.txt +1 -0
  259. data/bundle/ruby/{2.5.0/gems/sexp_processor-4.12.0 → 2.7.0/gems/sexp_processor-4.16.1}/README.rdoc +0 -0
  260. data/bundle/ruby/{2.5.0/gems/sexp_processor-4.12.0 → 2.7.0/gems/sexp_processor-4.16.1}/lib/composite_sexp_processor.rb +0 -0
  261. data/bundle/ruby/{2.5.0/gems/sexp_processor-4.12.0 → 2.7.0/gems/sexp_processor-4.16.1}/lib/pt_testcase.rb +27 -20
  262. data/bundle/ruby/2.7.0/gems/sexp_processor-4.16.1/lib/sexp.rb +391 -0
  263. data/bundle/ruby/{2.5.0/gems/sexp_processor-4.12.0/lib/sexp.rb → 2.7.0/gems/sexp_processor-4.16.1/lib/sexp_matcher.rb} +67 -387
  264. data/bundle/ruby/{2.5.0/gems/sexp_processor-4.12.0 → 2.7.0/gems/sexp_processor-4.16.1}/lib/sexp_processor.rb +2 -2
  265. data/bundle/ruby/{2.5.0/gems/sexp_processor-4.12.0 → 2.7.0/gems/sexp_processor-4.16.1}/lib/strict_sexp.rb +25 -3
  266. data/bundle/ruby/{2.5.0/gems/sexp_processor-4.12.0 → 2.7.0/gems/sexp_processor-4.16.1}/lib/unique.rb +0 -0
  267. data/bundle/ruby/{2.5.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/CHANGES +4 -0
  268. data/bundle/ruby/{2.5.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/Gemfile +12 -13
  269. data/bundle/ruby/{2.5.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/LICENSE +0 -0
  270. data/bundle/ruby/{2.5.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/README.jp.md +0 -0
  271. data/bundle/ruby/{2.5.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/README.md +0 -0
  272. data/bundle/ruby/{2.5.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/code_attributes.rb +0 -0
  273. data/bundle/ruby/{2.5.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/command.rb +13 -13
  274. data/bundle/ruby/{2.5.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/controls.rb +0 -0
  275. data/bundle/ruby/{2.5.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/do_inserter.rb +0 -0
  276. data/bundle/ruby/{2.5.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/embedded.rb +0 -0
  277. data/bundle/ruby/{2.5.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/end_inserter.rb +0 -0
  278. data/bundle/ruby/{2.5.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/engine.rb +0 -0
  279. data/bundle/ruby/{2.5.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/erb_converter.rb +0 -0
  280. data/bundle/ruby/{2.5.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/filter.rb +0 -0
  281. data/bundle/ruby/{2.5.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/grammar.rb +0 -0
  282. data/bundle/ruby/{2.5.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/include.rb +0 -0
  283. data/bundle/ruby/{2.5.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/interpolation.rb +0 -0
  284. data/bundle/ruby/{2.5.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/logic_less/context.rb +0 -0
  285. data/bundle/ruby/{2.5.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/logic_less/filter.rb +0 -0
  286. data/bundle/ruby/{2.5.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/logic_less.rb +0 -0
  287. data/bundle/ruby/{2.5.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/parser.rb +1 -1
  288. data/bundle/ruby/{2.5.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/smart/escaper.rb +0 -0
  289. data/bundle/ruby/{2.5.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/smart/filter.rb +0 -0
  290. data/bundle/ruby/{2.5.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/smart/parser.rb +0 -0
  291. data/bundle/ruby/{2.5.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/smart.rb +0 -0
  292. data/bundle/ruby/{2.5.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/splat/builder.rb +0 -0
  293. data/bundle/ruby/{2.5.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/splat/filter.rb +0 -0
  294. data/bundle/ruby/{2.5.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/template.rb +0 -0
  295. data/bundle/ruby/{2.5.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/translator.rb +0 -0
  296. data/bundle/ruby/{2.5.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/version.rb +1 -1
  297. data/bundle/ruby/{2.5.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim.rb +0 -0
  298. data/bundle/ruby/{2.5.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/slim.gemspec +0 -0
  299. data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/CHANGES +5 -0
  300. data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/EXPRESSIONS.md +0 -0
  301. data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/Gemfile +0 -0
  302. data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/LICENSE +0 -0
  303. data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/README.md +1 -1
  304. data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/engine.rb +0 -0
  305. data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/erb/engine.rb +0 -0
  306. data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/erb/parser.rb +0 -0
  307. data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/erb/template.rb +0 -0
  308. data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/erb/trimming.rb +0 -0
  309. data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/exceptions.rb +0 -0
  310. data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/filter.rb +0 -0
  311. data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/filters/code_merger.rb +0 -0
  312. data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/filters/control_flow.rb +0 -0
  313. data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/filters/dynamic_inliner.rb +0 -0
  314. data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/filters/encoding.rb +0 -0
  315. data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/filters/eraser.rb +0 -0
  316. data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/filters/escapable.rb +0 -0
  317. data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/filters/multi_flattener.rb +0 -0
  318. data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/filters/remove_bom.rb +0 -0
  319. data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/filters/static_analyzer.rb +0 -0
  320. data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/filters/static_merger.rb +0 -0
  321. data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/filters/string_splitter.rb +1 -1
  322. data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/filters/validator.rb +0 -0
  323. data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/generator.rb +0 -0
  324. data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/generators/array.rb +0 -0
  325. data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/generators/array_buffer.rb +0 -0
  326. data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/generators/erb.rb +0 -0
  327. data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/generators/rails_output_buffer.rb +0 -0
  328. data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/generators/string_buffer.rb +0 -0
  329. data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/grammar.rb +0 -0
  330. data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/html/attribute_merger.rb +0 -0
  331. data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/html/attribute_remover.rb +0 -0
  332. data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/html/attribute_sorter.rb +0 -0
  333. data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/html/dispatcher.rb +0 -0
  334. data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/html/fast.rb +0 -0
  335. data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/html/filter.rb +0 -0
  336. data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/html/pretty.rb +0 -0
  337. data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/html/safe.rb +0 -0
  338. data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/map.rb +0 -0
  339. data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/mixins/dispatcher.rb +0 -0
  340. data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/mixins/engine_dsl.rb +0 -0
  341. data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/mixins/grammar_dsl.rb +0 -0
  342. data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/mixins/options.rb +0 -0
  343. data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/mixins/template.rb +0 -0
  344. data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/parser.rb +0 -0
  345. data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/static_analyzer.rb +1 -1
  346. data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/templates/rails.rb +0 -0
  347. data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/templates/tilt.rb +0 -0
  348. data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/templates.rb +0 -0
  349. data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple/utils.rb +0 -0
  350. data/bundle/ruby/2.7.0/gems/temple-0.8.2/lib/temple/version.rb +3 -0
  351. data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/lib/temple.rb +0 -0
  352. data/bundle/ruby/{2.5.0/gems/temple-0.8.1 → 2.7.0/gems/temple-0.8.2}/temple.gemspec +0 -0
  353. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/terminal-table-1.8.0/Gemfile +0 -0
  354. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/terminal-table-1.8.0/History.rdoc +0 -0
  355. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/terminal-table-1.8.0/LICENSE.txt +0 -0
  356. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/terminal-table-1.8.0/Manifest +0 -0
  357. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/terminal-table-1.8.0/README.rdoc +0 -0
  358. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/terminal-table-1.8.0/Todo.rdoc +0 -0
  359. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/terminal-table-1.8.0/lib/terminal-table/cell.rb +0 -0
  360. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/terminal-table-1.8.0/lib/terminal-table/import.rb +0 -0
  361. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/terminal-table-1.8.0/lib/terminal-table/row.rb +0 -0
  362. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/terminal-table-1.8.0/lib/terminal-table/separator.rb +0 -0
  363. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/terminal-table-1.8.0/lib/terminal-table/style.rb +0 -0
  364. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/terminal-table-1.8.0/lib/terminal-table/table.rb +0 -0
  365. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/terminal-table-1.8.0/lib/terminal-table/table_helper.rb +0 -0
  366. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/terminal-table-1.8.0/lib/terminal-table/version.rb +0 -0
  367. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/terminal-table-1.8.0/lib/terminal-table.rb +0 -0
  368. data/bundle/ruby/{2.5.0 → 2.7.0}/gems/terminal-table-1.8.0/terminal-table.gemspec +0 -0
  369. data/bundle/ruby/{2.5.0/gems/tilt-2.0.9 → 2.7.0/gems/tilt-2.0.11}/COPYING +0 -0
  370. data/bundle/ruby/{2.5.0/gems/tilt-2.0.9 → 2.7.0/gems/tilt-2.0.11}/lib/tilt/asciidoc.rb +0 -0
  371. data/bundle/ruby/{2.5.0/gems/tilt-2.0.9 → 2.7.0/gems/tilt-2.0.11}/lib/tilt/babel.rb +0 -0
  372. data/bundle/ruby/{2.5.0/gems/tilt-2.0.9 → 2.7.0/gems/tilt-2.0.11}/lib/tilt/bluecloth.rb +0 -0
  373. data/bundle/ruby/{2.5.0/gems/tilt-2.0.9 → 2.7.0/gems/tilt-2.0.11}/lib/tilt/builder.rb +0 -0
  374. data/bundle/ruby/{2.5.0/gems/tilt-2.0.9 → 2.7.0/gems/tilt-2.0.11}/lib/tilt/coffee.rb +0 -0
  375. data/bundle/ruby/{2.5.0/gems/tilt-2.0.9 → 2.7.0/gems/tilt-2.0.11}/lib/tilt/commonmarker.rb +11 -1
  376. data/bundle/ruby/{2.5.0/gems/tilt-2.0.9 → 2.7.0/gems/tilt-2.0.11}/lib/tilt/creole.rb +0 -0
  377. data/bundle/ruby/{2.5.0/gems/tilt-2.0.9 → 2.7.0/gems/tilt-2.0.11}/lib/tilt/csv.rb +1 -1
  378. data/bundle/ruby/{2.5.0/gems/tilt-2.0.9 → 2.7.0/gems/tilt-2.0.11}/lib/tilt/dummy.rb +0 -0
  379. data/bundle/ruby/{2.5.0/gems/tilt-2.0.9 → 2.7.0/gems/tilt-2.0.11}/lib/tilt/erb.rb +0 -0
  380. data/bundle/ruby/{2.5.0/gems/tilt-2.0.9 → 2.7.0/gems/tilt-2.0.11}/lib/tilt/erubi.rb +0 -0
  381. data/bundle/ruby/{2.5.0/gems/tilt-2.0.9 → 2.7.0/gems/tilt-2.0.11}/lib/tilt/erubis.rb +0 -0
  382. data/bundle/ruby/{2.5.0/gems/tilt-2.0.9 → 2.7.0/gems/tilt-2.0.11}/lib/tilt/etanni.rb +0 -0
  383. data/bundle/ruby/{2.5.0/gems/tilt-2.0.9 → 2.7.0/gems/tilt-2.0.11}/lib/tilt/haml.rb +0 -0
  384. data/bundle/ruby/{2.5.0/gems/tilt-2.0.9 → 2.7.0/gems/tilt-2.0.11}/lib/tilt/kramdown.rb +0 -0
  385. data/bundle/ruby/{2.5.0/gems/tilt-2.0.9 → 2.7.0/gems/tilt-2.0.11}/lib/tilt/less.rb +0 -0
  386. data/bundle/ruby/{2.5.0/gems/tilt-2.0.9 → 2.7.0/gems/tilt-2.0.11}/lib/tilt/liquid.rb +0 -0
  387. data/bundle/ruby/{2.5.0/gems/tilt-2.0.9 → 2.7.0/gems/tilt-2.0.11}/lib/tilt/livescript.rb +0 -0
  388. data/bundle/ruby/{2.5.0/gems/tilt-2.0.9 → 2.7.0/gems/tilt-2.0.11}/lib/tilt/mapping.rb +0 -0
  389. data/bundle/ruby/{2.5.0/gems/tilt-2.0.9 → 2.7.0/gems/tilt-2.0.11}/lib/tilt/markaby.rb +0 -0
  390. data/bundle/ruby/{2.5.0/gems/tilt-2.0.9 → 2.7.0/gems/tilt-2.0.11}/lib/tilt/maruku.rb +0 -0
  391. data/bundle/ruby/{2.5.0/gems/tilt-2.0.9 → 2.7.0/gems/tilt-2.0.11}/lib/tilt/nokogiri.rb +0 -0
  392. data/bundle/ruby/{2.5.0/gems/tilt-2.0.9 → 2.7.0/gems/tilt-2.0.11}/lib/tilt/pandoc.rb +23 -15
  393. data/bundle/ruby/{2.5.0/gems/tilt-2.0.9 → 2.7.0/gems/tilt-2.0.11}/lib/tilt/plain.rb +0 -0
  394. data/bundle/ruby/{2.5.0/gems/tilt-2.0.9 → 2.7.0/gems/tilt-2.0.11}/lib/tilt/prawn.rb +0 -0
  395. data/bundle/ruby/{2.5.0/gems/tilt-2.0.9 → 2.7.0/gems/tilt-2.0.11}/lib/tilt/radius.rb +0 -0
  396. data/bundle/ruby/{2.5.0/gems/tilt-2.0.9 → 2.7.0/gems/tilt-2.0.11}/lib/tilt/rdiscount.rb +0 -0
  397. data/bundle/ruby/{2.5.0/gems/tilt-2.0.9 → 2.7.0/gems/tilt-2.0.11}/lib/tilt/rdoc.rb +0 -0
  398. data/bundle/ruby/{2.5.0/gems/tilt-2.0.9 → 2.7.0/gems/tilt-2.0.11}/lib/tilt/redcarpet.rb +5 -2
  399. data/bundle/ruby/{2.5.0/gems/tilt-2.0.9 → 2.7.0/gems/tilt-2.0.11}/lib/tilt/redcloth.rb +0 -0
  400. data/bundle/ruby/2.7.0/gems/tilt-2.0.11/lib/tilt/rst-pandoc.rb +23 -0
  401. data/bundle/ruby/2.7.0/gems/tilt-2.0.11/lib/tilt/sass.rb +78 -0
  402. data/bundle/ruby/{2.5.0/gems/tilt-2.0.9 → 2.7.0/gems/tilt-2.0.11}/lib/tilt/sigil.rb +0 -0
  403. data/bundle/ruby/{2.5.0/gems/tilt-2.0.9 → 2.7.0/gems/tilt-2.0.11}/lib/tilt/string.rb +0 -0
  404. data/bundle/ruby/{2.5.0/gems/tilt-2.0.9 → 2.7.0/gems/tilt-2.0.11}/lib/tilt/template.rb +18 -12
  405. data/bundle/ruby/{2.5.0/gems/tilt-2.0.9 → 2.7.0/gems/tilt-2.0.11}/lib/tilt/typescript.rb +0 -0
  406. data/bundle/ruby/{2.5.0/gems/tilt-2.0.9 → 2.7.0/gems/tilt-2.0.11}/lib/tilt/wikicloth.rb +0 -0
  407. data/bundle/ruby/{2.5.0/gems/tilt-2.0.9 → 2.7.0/gems/tilt-2.0.11}/lib/tilt/yajl.rb +0 -0
  408. data/bundle/ruby/{2.5.0/gems/tilt-2.0.9 → 2.7.0/gems/tilt-2.0.11}/lib/tilt.rb +2 -1
  409. data/bundle/ruby/{2.5.0/gems/unicode-display_width-1.6.0 → 2.7.0/gems/unicode-display_width-1.8.0}/CHANGELOG.md +12 -0
  410. data/bundle/ruby/{2.5.0/gems/unicode-display_width-1.6.0 → 2.7.0/gems/unicode-display_width-1.8.0}/MIT-LICENSE.txt +1 -1
  411. data/bundle/ruby/{2.5.0/gems/unicode-display_width-1.6.0 → 2.7.0/gems/unicode-display_width-1.8.0}/README.md +3 -3
  412. data/bundle/ruby/2.7.0/gems/unicode-display_width-1.8.0/data/display_width.marshal.gz +0 -0
  413. data/bundle/ruby/{2.5.0/gems/unicode-display_width-1.6.0 → 2.7.0/gems/unicode-display_width-1.8.0}/lib/unicode/display_width/constants.rb +2 -2
  414. data/bundle/ruby/{2.5.0/gems/unicode-display_width-1.6.0 → 2.7.0/gems/unicode-display_width-1.8.0}/lib/unicode/display_width/index.rb +0 -0
  415. data/bundle/ruby/{2.5.0/gems/unicode-display_width-1.6.0 → 2.7.0/gems/unicode-display_width-1.8.0}/lib/unicode/display_width/no_string_ext.rb +0 -0
  416. data/bundle/ruby/{2.5.0/gems/unicode-display_width-1.6.0 → 2.7.0/gems/unicode-display_width-1.8.0}/lib/unicode/display_width/string_ext.rb +0 -0
  417. data/bundle/ruby/{2.5.0/gems/unicode-display_width-1.6.0 → 2.7.0/gems/unicode-display_width-1.8.0}/lib/unicode/display_width.rb +1 -1
  418. data/lib/brakeman/app_tree.rb +45 -4
  419. data/lib/brakeman/call_index.rb +54 -15
  420. data/lib/brakeman/checks/base_check.rb +79 -57
  421. data/lib/brakeman/checks/check_basic_auth.rb +6 -2
  422. data/lib/brakeman/checks/check_basic_auth_timing_attack.rb +2 -1
  423. data/lib/brakeman/checks/check_content_tag.rb +9 -6
  424. data/lib/brakeman/checks/check_cookie_serialization.rb +23 -0
  425. data/lib/brakeman/checks/check_create_with.rb +4 -2
  426. data/lib/brakeman/checks/check_cross_site_scripting.rb +10 -7
  427. data/lib/brakeman/checks/check_csrf_token_forgery_cve.rb +29 -0
  428. data/lib/brakeman/checks/check_default_routes.rb +6 -3
  429. data/lib/brakeman/checks/check_deserialize.rb +26 -8
  430. data/lib/brakeman/checks/check_detailed_exceptions.rb +5 -3
  431. data/lib/brakeman/checks/check_digest_dos.rb +2 -1
  432. data/lib/brakeman/checks/check_divide_by_zero.rb +2 -1
  433. data/lib/brakeman/checks/check_dynamic_finders.rb +2 -1
  434. data/lib/brakeman/checks/check_eol_rails.rb +23 -0
  435. data/lib/brakeman/checks/check_eol_ruby.rb +26 -0
  436. data/lib/brakeman/checks/check_escape_function.rb +2 -1
  437. data/lib/brakeman/checks/check_evaluation.rb +3 -2
  438. data/lib/brakeman/checks/check_execute.rb +82 -8
  439. data/lib/brakeman/checks/check_file_access.rb +9 -2
  440. data/lib/brakeman/checks/check_file_disclosure.rb +2 -1
  441. data/lib/brakeman/checks/check_filter_skipping.rb +2 -1
  442. data/lib/brakeman/checks/check_force_ssl.rb +2 -1
  443. data/lib/brakeman/checks/check_forgery_setting.rb +4 -2
  444. data/lib/brakeman/checks/check_header_dos.rb +4 -3
  445. data/lib/brakeman/checks/check_i18n_xss.rb +4 -3
  446. data/lib/brakeman/checks/check_jruby_xml.rb +4 -3
  447. data/lib/brakeman/checks/check_json_encoding.rb +2 -1
  448. data/lib/brakeman/checks/check_json_entity_escape.rb +40 -0
  449. data/lib/brakeman/checks/check_json_parsing.rb +7 -5
  450. data/lib/brakeman/checks/check_link_to.rb +3 -2
  451. data/lib/brakeman/checks/check_link_to_href.rb +5 -5
  452. data/lib/brakeman/checks/check_mail_to.rb +2 -1
  453. data/lib/brakeman/checks/check_mass_assignment.rb +43 -12
  454. data/lib/brakeman/checks/check_mime_type_dos.rb +4 -3
  455. data/lib/brakeman/checks/check_model_attr_accessible.rb +3 -2
  456. data/lib/brakeman/checks/check_model_attributes.rb +5 -3
  457. data/lib/brakeman/checks/check_model_serialize.rb +2 -1
  458. data/lib/brakeman/checks/check_nested_attributes.rb +2 -1
  459. data/lib/brakeman/checks/check_nested_attributes_bypass.rb +3 -2
  460. data/lib/brakeman/checks/check_number_to_currency.rb +4 -2
  461. data/lib/brakeman/checks/check_page_caching_cve.rb +38 -0
  462. data/lib/brakeman/checks/check_pathname.rb +48 -0
  463. data/lib/brakeman/checks/check_permit_attributes.rb +3 -2
  464. data/lib/brakeman/checks/check_quote_table_name.rb +2 -1
  465. data/lib/brakeman/checks/check_redirect.rb +7 -2
  466. data/lib/brakeman/checks/check_regex_dos.rb +3 -2
  467. data/lib/brakeman/checks/check_render.rb +19 -3
  468. data/lib/brakeman/checks/check_render_dos.rb +2 -1
  469. data/lib/brakeman/checks/check_render_inline.rb +4 -2
  470. data/lib/brakeman/checks/check_response_splitting.rb +2 -1
  471. data/lib/brakeman/checks/check_reverse_tabnabbing.rb +59 -0
  472. data/lib/brakeman/checks/check_route_dos.rb +2 -1
  473. data/lib/brakeman/checks/check_safe_buffer_manipulation.rb +2 -1
  474. data/lib/brakeman/checks/check_sanitize_config_cve.rb +120 -0
  475. data/lib/brakeman/checks/check_sanitize_methods.rb +9 -5
  476. data/lib/brakeman/checks/check_secrets.rb +2 -1
  477. data/lib/brakeman/checks/check_select_tag.rb +2 -1
  478. data/lib/brakeman/checks/check_select_vulnerability.rb +2 -1
  479. data/lib/brakeman/checks/check_send.rb +2 -1
  480. data/lib/brakeman/checks/check_session_manipulation.rb +2 -1
  481. data/lib/brakeman/checks/check_session_settings.rb +11 -5
  482. data/lib/brakeman/checks/check_simple_format.rb +4 -2
  483. data/lib/brakeman/checks/check_single_quotes.rb +2 -1
  484. data/lib/brakeman/checks/check_skip_before_filter.rb +8 -6
  485. data/lib/brakeman/checks/check_sprockets_path_traversal.rb +2 -1
  486. data/lib/brakeman/checks/check_sql.rb +88 -43
  487. data/lib/brakeman/checks/check_sql_cves.rb +4 -2
  488. data/lib/brakeman/checks/check_ssl_verify.rb +2 -1
  489. data/lib/brakeman/checks/check_strip_tags.rb +6 -3
  490. data/lib/brakeman/checks/check_symbol_dos.rb +3 -2
  491. data/lib/brakeman/checks/check_symbol_dos_cve.rb +2 -1
  492. data/lib/brakeman/checks/check_template_injection.rb +33 -0
  493. data/lib/brakeman/checks/check_translate_bug.rb +2 -1
  494. data/lib/brakeman/checks/check_unsafe_reflection.rb +9 -3
  495. data/lib/brakeman/checks/check_unsafe_reflection_methods.rb +69 -0
  496. data/lib/brakeman/checks/check_unscoped_find.rb +2 -1
  497. data/lib/brakeman/checks/check_validation_regex.rb +2 -1
  498. data/lib/brakeman/checks/check_verb_confusion.rb +76 -0
  499. data/lib/brakeman/checks/check_weak_hash.rb +6 -3
  500. data/lib/brakeman/checks/check_weak_rsa_key.rb +112 -0
  501. data/lib/brakeman/checks/check_without_protection.rb +2 -1
  502. data/lib/brakeman/checks/check_xml_dos.rb +4 -3
  503. data/lib/brakeman/checks/check_yaml_parsing.rb +14 -20
  504. data/lib/brakeman/checks/eol_check.rb +49 -0
  505. data/lib/brakeman/commandline.rb +25 -1
  506. data/lib/brakeman/differ.rb +16 -33
  507. data/lib/brakeman/file_parser.rb +60 -28
  508. data/lib/brakeman/file_path.rb +14 -0
  509. data/lib/brakeman/options.rb +39 -2
  510. data/lib/brakeman/parsers/haml_embedded.rb +1 -1
  511. data/lib/brakeman/parsers/template_parser.rb +29 -4
  512. data/lib/brakeman/processor.rb +2 -2
  513. data/lib/brakeman/processors/alias_processor.rb +216 -32
  514. data/lib/brakeman/processors/base_processor.rb +6 -4
  515. data/lib/brakeman/processors/controller_alias_processor.rb +6 -43
  516. data/lib/brakeman/processors/controller_processor.rb +5 -5
  517. data/lib/brakeman/processors/gem_processor.rb +13 -2
  518. data/lib/brakeman/processors/haml_template_processor.rb +103 -123
  519. data/lib/brakeman/processors/lib/call_conversion_helper.rb +18 -11
  520. data/lib/brakeman/processors/lib/file_type_detector.rb +64 -0
  521. data/lib/brakeman/processors/lib/find_all_calls.rb +58 -18
  522. data/lib/brakeman/processors/lib/find_call.rb +3 -64
  523. data/lib/brakeman/processors/lib/rails2_config_processor.rb +1 -1
  524. data/lib/brakeman/processors/lib/rails3_config_processor.rb +16 -16
  525. data/lib/brakeman/processors/lib/rails3_route_processor.rb +2 -0
  526. data/lib/brakeman/processors/lib/rails4_config_processor.rb +2 -1
  527. data/lib/brakeman/processors/lib/render_helper.rb +3 -1
  528. data/lib/brakeman/processors/library_processor.rb +9 -0
  529. data/lib/brakeman/processors/model_processor.rb +32 -0
  530. data/lib/brakeman/processors/output_processor.rb +1 -1
  531. data/lib/brakeman/processors/template_alias_processor.rb +33 -0
  532. data/lib/brakeman/processors/template_processor.rb +10 -6
  533. data/lib/brakeman/report/ignore/config.rb +10 -2
  534. data/lib/brakeman/report/ignore/interactive.rb +3 -3
  535. data/lib/brakeman/report/report_base.rb +0 -2
  536. data/lib/brakeman/report/report_codeclimate.rb +1 -1
  537. data/lib/brakeman/report/report_csv.rb +39 -60
  538. data/lib/brakeman/report/report_github.rb +31 -0
  539. data/lib/brakeman/report/report_junit.rb +104 -0
  540. data/lib/brakeman/report/report_markdown.rb +0 -1
  541. data/lib/brakeman/report/report_sarif.rb +133 -0
  542. data/lib/brakeman/report/report_sonar.rb +38 -0
  543. data/lib/brakeman/report/report_table.rb +5 -5
  544. data/lib/brakeman/report/report_tabs.rb +1 -1
  545. data/lib/brakeman/report/report_text.rb +43 -21
  546. data/lib/brakeman/report/templates/controller_warnings.html.erb +2 -0
  547. data/lib/brakeman/report/templates/ignored_warnings.html.erb +2 -0
  548. data/lib/brakeman/report/templates/model_warnings.html.erb +2 -0
  549. data/lib/brakeman/report/templates/security_warnings.html.erb +2 -0
  550. data/lib/brakeman/report/templates/view_warnings.html.erb +2 -0
  551. data/lib/brakeman/report.rb +22 -1
  552. data/lib/brakeman/rescanner.rb +11 -5
  553. data/lib/brakeman/scanner.rb +65 -31
  554. data/lib/brakeman/tracker/collection.rb +57 -7
  555. data/lib/brakeman/tracker/config.rb +116 -66
  556. data/lib/brakeman/tracker/constants.rb +10 -8
  557. data/lib/brakeman/tracker/controller.rb +1 -1
  558. data/lib/brakeman/tracker/method_info.rb +70 -0
  559. data/lib/brakeman/tracker.rb +68 -7
  560. data/lib/brakeman/util.rb +63 -24
  561. data/lib/brakeman/version.rb +1 -1
  562. data/lib/brakeman/warning.rb +18 -3
  563. data/lib/brakeman/warning_codes.rb +21 -0
  564. data/lib/brakeman.rb +49 -6
  565. data/lib/ruby_parser/bm_sexp.rb +40 -11
  566. metadata +445 -344
  567. data/bundle/ruby/2.5.0/gems/haml-4.0.7/MIT-LICENSE +0 -20
  568. data/bundle/ruby/2.5.0/gems/haml-4.0.7/lib/haml/buffer.rb +0 -345
  569. data/bundle/ruby/2.5.0/gems/haml-4.0.7/lib/haml/compiler.rb +0 -540
  570. data/bundle/ruby/2.5.0/gems/haml-4.0.7/lib/haml/error.rb +0 -61
  571. data/bundle/ruby/2.5.0/gems/haml-4.0.7/lib/haml/railtie.rb +0 -22
  572. data/bundle/ruby/2.5.0/gems/haml-4.0.7/lib/haml/template/plugin.rb +0 -41
  573. data/bundle/ruby/2.5.0/gems/haml-4.0.7/lib/haml/util.rb +0 -377
  574. data/bundle/ruby/2.5.0/gems/haml-4.0.7/lib/haml/version.rb +0 -3
  575. data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.1/debugging.md +0 -18
  576. data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.1/lib/rp_stringscanner.rb +0 -64
  577. data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.1/lib/ruby20_parser.rb +0 -6869
  578. data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.1/lib/ruby20_parser.y +0 -2431
  579. data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.1/lib/ruby21_parser.rb +0 -6944
  580. data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.1/lib/ruby22_parser.rb +0 -6968
  581. data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.1/lib/ruby22_parser.y +0 -2458
  582. data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.1/lib/ruby23_parser.rb +0 -6987
  583. data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.1/lib/ruby23_parser.y +0 -2460
  584. data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.1/lib/ruby24_parser.rb +0 -6994
  585. data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.1/lib/ruby25_parser.rb +0 -6994
  586. data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.1/lib/ruby26_parser.rb +0 -7012
  587. data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.1/lib/ruby_lexer.rb +0 -1449
  588. data/bundle/ruby/2.5.0/gems/ruby_parser-3.13.1/tools/ripper.rb +0 -28
  589. data/bundle/ruby/2.5.0/gems/temple-0.8.1/lib/temple/version.rb +0 -3
  590. data/bundle/ruby/2.5.0/gems/tilt-2.0.9/CHANGELOG.md +0 -132
  591. data/bundle/ruby/2.5.0/gems/tilt-2.0.9/Gemfile +0 -70
  592. data/bundle/ruby/2.5.0/gems/tilt-2.0.9/HACKING +0 -16
  593. data/bundle/ruby/2.5.0/gems/tilt-2.0.9/README.md +0 -233
  594. data/bundle/ruby/2.5.0/gems/tilt-2.0.9/lib/tilt/rst-pandoc.rb +0 -18
  595. data/bundle/ruby/2.5.0/gems/tilt-2.0.9/lib/tilt/sass.rb +0 -52
  596. data/bundle/ruby/2.5.0/gems/tilt-2.0.9/tilt.gemspec +0 -130
  597. data/bundle/ruby/2.5.0/gems/unicode-display_width-1.6.0/data/display_width.marshal.gz +0 -0
@@ -1,6 +1,6 @@
1
1
  # -*- racc -*-
2
2
 
3
- class Ruby26Parser
3
+ class Ruby23Parser
4
4
 
5
5
  token kCLASS kMODULE kDEF kUNDEF kBEGIN kRESCUE kENSURE kEND kIF kUNLESS
6
6
  kTHEN kELSIF kELSE kCASE kWHEN kWHILE kUNTIL kFOR kBREAK kNEXT
@@ -18,35 +18,35 @@ token kCLASS kMODULE kDEF kUNDEF kBEGIN kRESCUE kENSURE kEND kIF kUNLESS
18
18
  tBACK_REF2 tSYMBEG tSTRING_BEG tXSTRING_BEG tREGEXP_BEG
19
19
  tWORDS_BEG tQWORDS_BEG tSTRING_DBEG tSTRING_DVAR tSTRING_END
20
20
  tSTRING tSYMBOL tNL tEH tCOLON tCOMMA tSPACE tSEMI tLAMBDA
21
- tLAMBEG tDSTAR tCHAR tSYMBOLS_BEG tQSYMBOLS_BEG tSTRING_DEND tUBANG
21
+ tLAMBEG tDSTAR tCHAR tSYMBOLS_BEG tQSYMBOLS_BEG tSTRING_DEND
22
22
  tRATIONAL tIMAGINARY
23
23
  tLABEL_END
24
24
  tLONELY
25
25
 
26
- prechigh
27
- right tBANG tTILDE tUPLUS
28
- right tPOW
29
- right tUMINUS_NUM tUMINUS
30
- left tSTAR2 tDIVIDE tPERCENT
31
- left tPLUS tMINUS
32
- left tLSHFT tRSHFT
33
- left tAMPER2
34
- left tPIPE tCARET
35
- left tGT tGEQ tLT tLEQ
36
- nonassoc tCMP tEQ tEQQ tNEQ tMATCH tNMATCH
37
- left tANDOP
38
- left tOROP
39
- nonassoc tDOT2 tDOT3
40
- right tEH tCOLON
41
- left kRESCUE_MOD
42
- right tEQL tOP_ASGN
43
- nonassoc kDEFINED
44
- right kNOT
45
- left kOR kAND
46
- nonassoc kIF_MOD kUNLESS_MOD kWHILE_MOD kUNTIL_MOD
47
- nonassoc tLBRACE_ARG
48
- nonassoc tLOWEST
49
26
  preclow
27
+ nonassoc tLOWEST
28
+ nonassoc tLBRACE_ARG
29
+ nonassoc kIF_MOD kUNLESS_MOD kWHILE_MOD kUNTIL_MOD
30
+ left kOR kAND
31
+ right kNOT
32
+ nonassoc kDEFINED
33
+ right tEQL tOP_ASGN
34
+ left kRESCUE_MOD
35
+ right tEH tCOLON
36
+ nonassoc tDOT2 tDOT3 tBDOT2 tBDOT3
37
+ left tOROP
38
+ left tANDOP
39
+ nonassoc tCMP tEQ tEQQ tNEQ tMATCH tNMATCH
40
+ left tGT tGEQ tLT tLEQ
41
+ left tPIPE tCARET
42
+ left tAMPER2
43
+ left tLSHFT tRSHFT
44
+ left tPLUS tMINUS
45
+ left tSTAR2 tDIVIDE tPERCENT # TODO: tSTAR2 -> tMULT
46
+ right tUMINUS_NUM tUMINUS
47
+ right tPOW
48
+ right tBANG tTILDE tUPLUS
49
+ prechigh
50
50
 
51
51
  rule
52
52
 
@@ -56,11 +56,15 @@ rule
56
56
  top_compstmt
57
57
  {
58
58
  result = new_compstmt val
59
+
60
+ lexer.cond.pop # local_pop
61
+ lexer.cmdarg.pop
59
62
  }
60
63
 
61
64
  top_compstmt: top_stmts opt_terms
62
65
  {
63
- result = val[0]
66
+ stmt, _ = val
67
+ result = stmt
64
68
  }
65
69
 
66
70
  top_stmts: none
@@ -72,38 +76,37 @@ rule
72
76
  | error top_stmt
73
77
 
74
78
  top_stmt: stmt
75
- {
76
- result = val[0]
77
-
78
- # TODO: remove once I have more confidence this is fixed
79
- # result.each_of_type :call_args do |s|
80
- # debug20 666, s, result
81
- # end
82
- }
83
79
  | klBEGIN
84
80
  {
85
81
  if (self.in_def || self.in_single > 0) then
86
- debug20 1
82
+ debug 11
87
83
  yyerror "BEGIN in method"
88
84
  end
89
85
  self.env.extend
90
86
  }
91
87
  begin_block
92
88
  {
93
- _, _, block = val
94
- result = block
89
+ (_, lineno), _, iter = val
90
+ iter.line lineno
91
+
92
+ (_, preexe,) = iter
93
+ preexe.line lineno
94
+
95
+ result = iter
95
96
  }
96
97
 
97
- begin_block: tLCURLY top_compstmt tRCURLY
98
+ begin_block: tLCURLY { result = lexer.lineno } top_compstmt tRCURLY
98
99
  {
99
- _, stmt, _ = val
100
- result = new_iter s(:preexe), 0, stmt
100
+ _, line, stmt, _ = val
101
+ result = new_iter s(:preexe).line(line), 0, stmt
101
102
  }
102
103
 
103
104
  bodystmt: compstmt opt_rescue k_else
104
105
  {
105
106
  res = _values[-2]
106
- yyerror "else without rescue is useless" unless res
107
+ # TODO: move down to main match so I can just use val
108
+
109
+ warn "else without rescue is useless" unless res
107
110
  }
108
111
  compstmt
109
112
  opt_ensure
@@ -133,40 +136,37 @@ rule
133
136
  | error stmt
134
137
  {
135
138
  result = val[1]
136
- debug20 2, val, result
139
+ debug 12
137
140
  }
138
141
 
139
142
  stmt_or_begin: stmt
140
143
  | klBEGIN
141
144
  {
142
- if (self.in_def || self.in_single > 0) then
143
- debug20 1
144
- yyerror "BEGIN in method"
145
- end
146
- self.env.extend
145
+ yyerror "BEGIN is permitted only at toplevel"
147
146
  }
148
- begin_block
147
+ begin_block
149
148
  {
150
- _, _, stmt = val
151
- result = stmt
149
+ result = val[2] # wtf?
152
150
  }
153
151
 
154
152
  stmt: kALIAS fitem
155
153
  {
156
154
  lexer.lex_state = EXPR_FNAME
157
- result = self.lexer.lineno
158
155
  }
159
156
  fitem
160
157
  {
161
- result = s(:alias, val[1], val[3]).line(val[2])
158
+ (_, line), lhs, _, rhs = val
159
+ result = s(:alias, lhs, rhs).line(line).line line
162
160
  }
163
161
  | kALIAS tGVAR tGVAR
164
162
  {
165
- result = s(:valias, val[1].to_sym, val[2].to_sym)
163
+ (_, line), (lhs, _), (rhs, _) = val
164
+ result = s(:valias, lhs.to_sym, rhs.to_sym).line line
166
165
  }
167
166
  | kALIAS tGVAR tBACK_REF
168
167
  {
169
- result = s(:valias, val[1].to_sym, :"$#{val[2]}")
168
+ (_, line), (lhs, _), (rhs, _) = val
169
+ result = s(:valias, lhs.to_sym, :"$#{rhs}").line line
170
170
  }
171
171
  | kALIAS tGVAR tNTH_REF
172
172
  {
@@ -178,32 +178,41 @@ rule
178
178
  }
179
179
  | stmt kIF_MOD expr_value
180
180
  {
181
- result = new_if val[2], val[0], nil
181
+ t, _, c = val
182
+ result = new_if c, t, nil
182
183
  }
183
184
  | stmt kUNLESS_MOD expr_value
184
185
  {
185
- result = new_if val[2], nil, val[0]
186
+ f, _, c = val
187
+ result = new_if c, nil, f
186
188
  }
187
189
  | stmt kWHILE_MOD expr_value
188
190
  {
189
- result = new_while val[0], val[2], true
191
+ e, _, c = val
192
+ result = new_while e, c, true
190
193
  }
191
194
  | stmt kUNTIL_MOD expr_value
192
195
  {
193
- result = new_until val[0], val[2], true
196
+ e, _, c = val
197
+ result = new_until e, c, true
194
198
  }
195
199
  | stmt kRESCUE_MOD stmt
196
200
  {
197
201
  body, _, resbody = val
198
- result = new_rescue body, new_resbody(s(:array), resbody)
202
+
203
+ resbody = new_resbody s(:array).line(resbody.line), resbody
204
+ result = new_rescue body, resbody
199
205
  }
200
206
  | klEND tLCURLY compstmt tRCURLY
201
207
  {
208
+ (_, line), _, stmt, _ = val
209
+
202
210
  if (self.in_def || self.in_single > 0) then
203
- debug20 3
211
+ debug 13
204
212
  yyerror "END in method; use at_exit"
205
213
  end
206
- result = new_iter s(:postexe), 0, val[2]
214
+
215
+ result = new_iter s(:postexe).line(line), 0, stmt
207
216
  }
208
217
  | command_asgn
209
218
  | mlhs tEQL command_call
@@ -212,7 +221,8 @@ rule
212
221
  }
213
222
  | lhs tEQL mrhs
214
223
  {
215
- result = new_assign val[0], s(:svalue, val[2])
224
+ lhs, _, rhs = val
225
+ result = new_assign lhs, s(:svalue, rhs).line(rhs.line)
216
226
  }
217
227
  | mlhs tEQL mrhs_arg
218
228
  {
@@ -234,33 +244,35 @@ rule
234
244
  }
235
245
  | primary_value tLBRACK2 opt_call_args rbracket tOP_ASGN command_rhs
236
246
  {
237
- result = s(:op_asgn1, val[0], val[2], val[4].to_sym, val[5])
247
+ result = new_op_asgn1 val
238
248
  }
239
249
  | primary_value call_op tIDENTIFIER tOP_ASGN command_rhs
240
250
  {
241
- result = s(:op_asgn, val[0], val[4], val[2].to_sym, val[3].to_sym)
242
- if val[1] == '&.'
243
- result.sexp_type = :safe_op_asgn
244
- end
245
- result.line = val[0].line
251
+ prim, (call_op, _), (id, _), (op_asgn, _), rhs = val
252
+
253
+ result = s(:op_asgn, prim, rhs, id.to_sym, op_asgn.to_sym)
254
+ result.sexp_type = :safe_op_asgn if call_op == '&.'
255
+ result.line prim.line
246
256
  }
247
257
  | primary_value call_op tCONSTANT tOP_ASGN command_rhs
248
258
  {
249
- result = s(:op_asgn, val[0], val[4], val[2].to_sym, val[3].to_sym)
250
- if val[1] == '&.'
251
- result.sexp_type = :safe_op_asgn
252
- end
253
- result.line = val[0].line
259
+ prim, (call_op, _), (id, _), (op_asgn, _), rhs = val
260
+
261
+ result = s(:op_asgn, prim, rhs, id.to_sym, op_asgn.to_sym)
262
+ result.sexp_type = :safe_op_asgn if call_op == '&.'
263
+ result.line prim.line
254
264
  }
255
265
  | primary_value tCOLON2 tCONSTANT tOP_ASGN command_rhs
256
266
  {
257
- result = s(:op_asgn, val[0], val[4], val[2], val[3])
258
- debug20 4, val, result
267
+ lhs1, _, (lhs2, line), (id, _), rhs = val
268
+
269
+ result = s(:op_asgn, lhs1, rhs, lhs2.to_sym, id.to_sym).line line
259
270
  }
260
271
  | primary_value tCOLON2 tIDENTIFIER tOP_ASGN command_rhs
261
272
  {
262
- result = s(:op_asgn, val[0], val[4], val[2], val[3])
263
- debug20 5, val, result
273
+ lhs1, _, (lhs2, line), (id, _), rhs = val
274
+
275
+ result = s(:op_asgn, lhs1, rhs, lhs2.to_sym, id.to_sym).line line
264
276
  }
265
277
  | backref tOP_ASGN command_rhs
266
278
  {
@@ -272,32 +284,33 @@ rule
272
284
  expr, = val
273
285
  result = value_expr expr
274
286
  }
275
- | command_call kRESCUE_MOD stmt
276
- {
277
- expr, _, resbody = val
278
- expr = value_expr expr
279
- result = new_rescue(expr, new_resbody(s(:array), resbody))
280
- }
281
287
  | command_asgn
282
288
 
283
289
  expr: command_call
284
290
  | expr kAND expr
285
291
  {
286
- result = logical_op :and, val[0], val[2]
292
+ lhs, _, rhs = val
293
+ result = logical_op :and, lhs, rhs
287
294
  }
288
295
  | expr kOR expr
289
296
  {
290
- result = logical_op :or, val[0], val[2]
297
+ lhs, _, rhs = val
298
+ result = logical_op :or, lhs, rhs
291
299
  }
292
300
  | kNOT opt_nl expr
293
301
  {
294
- result = s(:call, val[2], :"!")
302
+ (_, line), _, expr = val
303
+ result = new_call(expr, :"!").line line
304
+ # REFACTOR: call_uni_op
295
305
  }
296
306
  | tBANG command_call
297
307
  {
298
- result = s(:call, val[1], :"!")
308
+ _, cmd = val
309
+ result = new_call(cmd, :"!").line cmd.line
310
+ # TODO: fix line number to tBANG... but causes BAD shift/reduce conflict
311
+ # REFACTOR: call_uni_op -- see parse26.y
299
312
  }
300
- | arg
313
+ | arg =tLBRACE_ARG
301
314
 
302
315
  expr_value: expr
303
316
  {
@@ -322,7 +335,8 @@ rule
322
335
  block_command: block_call
323
336
  | block_call call_op2 operation2 command_args
324
337
  {
325
- result = new_call val[0], val[2].to_sym, val[3]
338
+ blk, _, (msg, _line), args = val
339
+ result = new_call(blk, msg.to_sym, args).line blk.line
326
340
  }
327
341
 
328
342
  cmd_brace_block: tLBRACE_ARG
@@ -335,37 +349,45 @@ rule
335
349
  _, line, body, _ = val
336
350
 
337
351
  result = body
338
- result.line = line
352
+ result.line line
339
353
 
340
354
  # self.env.unextend
341
355
  }
342
356
 
343
357
  fcall: operation
344
358
  {
345
- result = new_call nil, val[0].to_sym
359
+ (msg, line), = val
360
+ result = new_call(nil, msg.to_sym).line line
346
361
  }
347
362
 
348
363
  command: fcall command_args =tLOWEST
349
364
  {
350
- result = val[0].concat val[1].sexp_body # REFACTOR pattern
365
+ call, args = val
366
+ result = call.concat args.sexp_body
351
367
  }
352
368
  | fcall command_args cmd_brace_block
353
369
  {
354
- result = val[0].concat val[1].sexp_body
355
- if val[2] then
356
- block_dup_check result, val[2]
370
+ call, args, block = val
371
+
372
+ result = call.concat args.sexp_body
373
+
374
+ if block then
375
+ block_dup_check result, block
357
376
 
358
- result, operation = val[2], result
377
+ result, operation = block, result
359
378
  result.insert 1, operation
360
379
  end
361
380
  }
362
381
  | primary_value call_op operation2 command_args =tLOWEST
363
382
  {
364
- result = new_call val[0], val[2].to_sym, val[3], val[1]
383
+ lhs, callop, (op, _), args = val
384
+
385
+ result = new_call lhs, op.to_sym, args, callop
386
+ result.line lhs.line
365
387
  }
366
388
  | primary_value call_op operation2 command_args cmd_brace_block
367
389
  {
368
- recv, _, msg, args, block = val
390
+ recv, _, (msg, _line), args, block = val
369
391
  call = new_call recv, msg.to_sym, args, val[1]
370
392
 
371
393
  block_dup_check call, block
@@ -375,11 +397,14 @@ rule
375
397
  }
376
398
  | primary_value tCOLON2 operation2 command_args =tLOWEST
377
399
  {
378
- result = new_call val[0], val[2].to_sym, val[3]
400
+ lhs, _, (id, line), args = val
401
+
402
+ result = new_call lhs, id.to_sym, args
403
+ result.line line
379
404
  }
380
405
  | primary_value tCOLON2 operation2 command_args cmd_brace_block
381
406
  {
382
- recv, _, msg, args, block = val
407
+ recv, _, (msg, _line), args, block = val
383
408
  call = new_call recv, msg.to_sym, args
384
409
 
385
410
  block_dup_check call, block
@@ -393,7 +418,9 @@ rule
393
418
  }
394
419
  | kYIELD command_args
395
420
  {
396
- result = new_yield val[1]
421
+ (_, line), args = val
422
+ result = new_yield args
423
+ result.line line # TODO: push to new_yield
397
424
  }
398
425
  | k_return call_args
399
426
  {
@@ -402,8 +429,8 @@ rule
402
429
  }
403
430
  | kBREAK call_args
404
431
  {
405
- line = val[0].last
406
- result = s(:break, ret_args(val[1])).line(line)
432
+ (_, line), args = val
433
+ result = s(:break, ret_args(args)).line line
407
434
  }
408
435
  | kNEXT call_args
409
436
  {
@@ -420,56 +447,79 @@ rule
420
447
  mlhs_inner: mlhs_basic
421
448
  | tLPAREN mlhs_inner rparen
422
449
  {
423
- result = s(:masgn, s(:array, val[1]))
450
+ _, arg, _ = val
451
+ l = arg.line
452
+
453
+ result = s(:masgn, s(:array, arg).line(l)).line l
424
454
  }
425
455
 
426
456
  mlhs_basic: mlhs_head
427
457
  {
428
- result = s(:masgn, val[0])
458
+ head, = val
459
+ result = s(:masgn, head).line head.line
429
460
  }
430
461
  | mlhs_head mlhs_item
431
462
  {
432
- result = s(:masgn, val[0] << val[1].compact)
463
+ lhs, rhs = val
464
+ result = s(:masgn, lhs << rhs.compact).line lhs.line
433
465
  }
434
466
  | mlhs_head tSTAR mlhs_node
435
467
  {
436
- result = s(:masgn, val[0] << s(:splat, val[2]))
468
+ head, _, tail = val
469
+ head << s(:splat, tail).line(tail.line)
470
+ result = s(:masgn, head).line head.line
437
471
  }
438
472
  | mlhs_head tSTAR mlhs_node tCOMMA mlhs_post
439
473
  {
440
474
  ary1, _, splat, _, ary2 = val
441
475
 
442
- result = list_append ary1, s(:splat, splat)
476
+ result = list_append ary1, s(:splat, splat).line(splat.line)
443
477
  result.concat ary2.sexp_body
444
- result = s(:masgn, result)
478
+ result = s(:masgn, result).line result.line
445
479
  }
446
480
  | mlhs_head tSTAR
447
481
  {
448
- result = s(:masgn, val[0] << s(:splat))
482
+ head, _ = val
483
+ l = head.line
484
+ result = s(:masgn, head << s(:splat).line(l)).line l
449
485
  }
450
486
  | mlhs_head tSTAR tCOMMA mlhs_post
451
487
  {
452
- ary = list_append val[0], s(:splat)
453
- ary.concat val[3].sexp_body
454
- result = s(:masgn, ary)
488
+ head, _, _, post = val
489
+ ary = list_append head, s(:splat).line(head.line)
490
+ ary.concat post.sexp_body
491
+ result = s(:masgn, ary).line ary.line
455
492
  }
456
493
  | tSTAR mlhs_node
457
494
  {
458
- result = s(:masgn, s(:array, s(:splat, val[1])))
495
+ _, node = val
496
+ l = node.line
497
+ splat = s(:splat, node).line l
498
+ ary = s(:array, splat).line l
499
+ result = s(:masgn, ary).line l
459
500
  }
460
501
  | tSTAR mlhs_node tCOMMA mlhs_post
461
502
  {
462
- ary = s(:array, s(:splat, val[1]))
463
- ary.concat val[3].sexp_body
464
- result = s(:masgn, ary)
503
+ _, node, _, post = val
504
+
505
+ splat = s(:splat, node).line node.line
506
+ ary = s(:array, splat).line splat.line
507
+ ary.concat post.sexp_body
508
+ result = s(:masgn, ary).line ary.line
465
509
  }
466
510
  | tSTAR
467
511
  {
468
- result = s(:masgn, s(:array, s(:splat)))
512
+ l = lexer.lineno
513
+ result = s(:masgn, s(:array, s(:splat).line(l)).line(l)).line l
469
514
  }
470
515
  | tSTAR tCOMMA mlhs_post
471
516
  {
472
- result = s(:masgn, s(:array, s(:splat), *val[2].sexp_body))
517
+ _, _, post = val
518
+ l = post.line
519
+
520
+ splat = s(:splat).line l
521
+ ary = s(:array, splat, *post.sexp_body).line l
522
+ result = s(:masgn, ary).line l
473
523
  }
474
524
 
475
525
  mlhs_item: mlhs_node
@@ -480,7 +530,8 @@ rule
480
530
 
481
531
  mlhs_head: mlhs_item tCOMMA
482
532
  {
483
- result = s(:array, val[0])
533
+ lhs, _ = val
534
+ result = s(:array, lhs).line lhs.line
484
535
  }
485
536
  | mlhs_head mlhs_item tCOMMA
486
537
  {
@@ -489,7 +540,8 @@ rule
489
540
 
490
541
  mlhs_post: mlhs_item
491
542
  {
492
- result = s(:array, val[0])
543
+ item, = val
544
+ result = s(:array, item).line item.line
493
545
  }
494
546
  | mlhs_post tCOMMA mlhs_item
495
547
  {
@@ -510,81 +562,111 @@ rule
510
562
  }
511
563
  | primary_value call_op tIDENTIFIER
512
564
  {
513
- result = new_attrasgn val[0], val[2], val[1]
565
+ lhs, call_op, (id, _line) = val
566
+
567
+ result = new_attrasgn lhs, id, call_op
514
568
  }
515
569
  | primary_value tCOLON2 tIDENTIFIER
516
570
  {
517
- result = s(:attrasgn, val[0], :"#{val[2]}=")
571
+ recv, _, (id, _line) = val
572
+ result = new_attrasgn recv, id
518
573
  }
519
574
  | primary_value call_op tCONSTANT
520
575
  {
521
- result = new_attrasgn val[0], val[2], val[1]
576
+ lhs, call_op, (id, _line) = val
577
+
578
+ result = new_attrasgn lhs, id, call_op
522
579
  }
523
580
  | primary_value tCOLON2 tCONSTANT
524
581
  {
525
582
  if (self.in_def || self.in_single > 0) then
526
- debug20 7
583
+ debug 14
527
584
  yyerror "dynamic constant assignment"
528
585
  end
529
586
 
530
- result = s(:const, s(:colon2, val[0], val[2].to_sym), nil)
587
+ expr, _, (id, _line) = val
588
+ l = expr.line
589
+
590
+ result = s(:const, s(:colon2, expr, id.to_sym).line(l), nil).line l
531
591
  }
532
592
  | tCOLON3 tCONSTANT
533
593
  {
534
594
  if (self.in_def || self.in_single > 0) then
535
- debug20 8
595
+ debug 15
536
596
  yyerror "dynamic constant assignment"
537
597
  end
538
598
 
539
- result = s(:const, nil, s(:colon3, val[1].to_sym))
599
+ _, (id, l) = val
600
+
601
+ result = s(:const, nil, s(:colon3, id.to_sym).line(l)).line l
540
602
  }
541
603
  | backref
542
604
  {
543
- self.backref_assign_error val[0]
605
+ ref, = val
606
+
607
+ self.backref_assign_error ref
544
608
  }
545
609
 
546
610
  lhs: user_variable
547
611
  {
548
- result = self.assignable val[0]
612
+ var, = val
613
+
614
+ result = self.assignable var
549
615
  }
550
616
  | keyword_variable
551
617
  {
552
- result = self.assignable val[0]
553
- debug20 9, val, result
618
+ var, = val
619
+
620
+ result = self.assignable var
621
+
622
+ debug 16
554
623
  }
555
624
  | primary_value tLBRACK2 opt_call_args rbracket
556
625
  {
557
- result = self.aryset val[0], val[2]
626
+ lhs, _, args, _ = val
627
+
628
+ result = self.aryset lhs, args
558
629
  }
559
630
  | primary_value call_op tIDENTIFIER # REFACTOR
560
631
  {
561
- result = new_attrasgn val[0], val[2], val[1]
632
+ lhs, op, (id, _line) = val
633
+
634
+ result = new_attrasgn lhs, id, op
562
635
  }
563
636
  | primary_value tCOLON2 tIDENTIFIER
564
637
  {
565
- result = s(:attrasgn, val[0], :"#{val[2]}=")
638
+ lhs, _, (id, _line) = val
639
+
640
+ result = new_attrasgn lhs, id
566
641
  }
567
642
  | primary_value call_op tCONSTANT # REFACTOR?
568
643
  {
569
- result = new_attrasgn val[0], val[2], val[1]
644
+ lhs, call_op, (id, _line) = val
645
+
646
+ result = new_attrasgn lhs, id, call_op
570
647
  }
571
648
  | primary_value tCOLON2 tCONSTANT
572
649
  {
650
+ expr, _, (id, _line) = val
651
+
573
652
  if (self.in_def || self.in_single > 0) then
574
- debug20 10
653
+ debug 17
575
654
  yyerror "dynamic constant assignment"
576
655
  end
577
656
 
578
- result = s(:const, s(:colon2, val[0], val[2].to_sym))
657
+ l = expr.line
658
+ result = s(:const, s(:colon2, expr, id.to_sym).line(l)).line l
579
659
  }
580
660
  | tCOLON3 tCONSTANT
581
661
  {
662
+ _, (id, l) = val
663
+
582
664
  if (self.in_def || self.in_single > 0) then
583
- debug20 11
665
+ debug 18
584
666
  yyerror "dynamic constant assignment"
585
667
  end
586
668
 
587
- result = s(:const, s(:colon3, val[1].to_sym))
669
+ result = s(:const, s(:colon3, id.to_sym).line(l)).line l
588
670
  }
589
671
  | backref
590
672
  {
@@ -599,38 +681,34 @@ rule
599
681
 
600
682
  cpath: tCOLON3 cname
601
683
  {
602
- result = s(:colon3, val[1].to_sym)
684
+ result = wrap :colon3, val[1]
603
685
  }
604
686
  | cname
605
687
  {
606
- result = val[0].to_sym
688
+ (id, line), = val
689
+ result = [id.to_sym, line] # TODO: sexp?
607
690
  }
608
691
  | primary_value tCOLON2 cname
609
692
  {
610
- result = s(:colon2, val[0], val[2].to_sym)
693
+ pval, _, (name, _line) = val
694
+
695
+ result = s(:colon2, pval, name.to_sym)
696
+ result.line pval.line
611
697
  }
612
698
 
613
699
  fname: tIDENTIFIER | tCONSTANT | tFID
614
700
  | op
615
701
  {
616
702
  lexer.lex_state = EXPR_END
617
- result = val[0]
618
703
  }
619
704
 
620
705
  | reswords
621
- {
622
- (sym, _line), = val
623
- lexer.lex_state = EXPR_END
624
- result = sym
625
- }
626
-
627
- fsym: fname | symbol
628
706
 
629
- fitem: fsym
707
+ fitem: fname
630
708
  {
631
- result = s(:lit, val[0].to_sym)
709
+ result = wrap :lit, val[0]
632
710
  }
633
- | dsym
711
+ | symbol
634
712
 
635
713
  undef_list: fitem
636
714
  {
@@ -651,7 +729,6 @@ rule
651
729
  | tNEQ | tLSHFT | tRSHFT | tPLUS | tMINUS | tSTAR2
652
730
  | tSTAR | tDIVIDE | tPERCENT | tPOW | tDSTAR | tBANG | tTILDE
653
731
  | tUPLUS | tUMINUS | tAREF | tASET | tBACK_REF2
654
- | tUBANG
655
732
 
656
733
  reswords: k__LINE__ | k__FILE__ | k__ENCODING__ | klBEGIN | klEND
657
734
  | kALIAS | kAND | kBEGIN | kBREAK | kCASE
@@ -673,8 +750,7 @@ rule
673
750
  }
674
751
  | primary_value tLBRACK2 opt_call_args rbracket tOP_ASGN arg_rhs
675
752
  {
676
- val[2].sexp_type = :arglist if val[2]
677
- result = s(:op_asgn1, val[0], val[2], val[4].to_sym, val[5])
753
+ result = new_op_asgn1 val
678
754
  }
679
755
  | primary_value call_op tIDENTIFIER tOP_ASGN arg_rhs
680
756
  {
@@ -686,24 +762,22 @@ rule
686
762
  }
687
763
  | primary_value tCOLON2 tIDENTIFIER tOP_ASGN arg_rhs
688
764
  {
689
- result = s(:op_asgn, val[0], val[4], val[2].to_sym, val[3].to_sym)
765
+ lhs, _, (id, _line), (op, _), rhs = val
766
+
767
+ result = s(:op_asgn, lhs, rhs, id.to_sym, op.to_sym).line lhs.line
690
768
  }
691
769
  | primary_value tCOLON2 tCONSTANT tOP_ASGN arg_rhs
692
770
  {
693
- lhs1, _, lhs2, op, rhs = val
771
+ lhs1, _, (lhs2, _line), op, rhs = val
694
772
 
695
773
  lhs = s(:colon2, lhs1, lhs2.to_sym).line lhs1.line
696
774
  result = new_const_op_asgn [lhs, op, rhs]
697
775
  }
698
- | tCOLON3 tCONSTANT
776
+ | tCOLON3 tCONSTANT tOP_ASGN arg_rhs
699
777
  {
700
- result = self.lexer.lineno
701
- }
702
- tOP_ASGN arg_rhs
703
- {
704
- _, lhs, line, op, rhs = val
778
+ _, lhs, op, rhs = val
705
779
 
706
- lhs = s(:colon3, lhs.to_sym).line line
780
+ lhs = wrap :colon3, lhs
707
781
  result = new_const_op_asgn [lhs, op, rhs]
708
782
  }
709
783
  | backref tOP_ASGN arg_rhs
@@ -715,33 +789,23 @@ rule
715
789
  | arg tDOT2 arg
716
790
  {
717
791
  v1, v2 = val[0], val[2]
718
- if v1.node_type == :lit and v2.node_type == :lit and Integer === v1.last and Integer === v2.last then
719
- result = s(:lit, (v1.last)..(v2.last))
792
+ if v1.sexp_type == :lit and v2.sexp_type == :lit and Integer === v1.last and Integer === v2.last then
793
+ result = s(:lit, (v1.last)..(v2.last)).line v1.line
720
794
  else
721
- result = s(:dot2, v1, v2)
795
+ result = s(:dot2, v1, v2).line v1.line
722
796
  end
723
797
  }
724
798
  | arg tDOT3 arg
725
799
  {
726
800
  v1, v2 = val[0], val[2]
727
- if v1.node_type == :lit and v2.node_type == :lit and Integer === v1.last and Integer === v2.last then
728
- result = s(:lit, (v1.last)...(v2.last))
801
+ if v1.sexp_type == :lit and v2.sexp_type == :lit and Integer === v1.last and Integer === v2.last then
802
+ result = s(:lit, (v1.last)...(v2.last)).line v1.line
729
803
  else
730
- result = s(:dot3, v1, v2)
804
+ result = s(:dot3, v1, v2).line v1.line
731
805
  end
732
806
  }
733
- | arg tDOT2
734
- {
735
- v1, v2 = val[0], nil
736
807
 
737
- result = s(:dot2, v1, v2)
738
- }
739
- | arg tDOT3
740
- {
741
- v1, v2 = val[0], nil
742
808
 
743
- result = s(:dot3, v1, v2)
744
- }
745
809
  | arg tPLUS arg
746
810
  {
747
811
  result = new_call val[0], :+, argl(val[2])
@@ -768,7 +832,10 @@ rule
768
832
  }
769
833
  | tUMINUS_NUM simple_numeric tPOW arg
770
834
  {
771
- result = new_call(new_call(s(:lit, val[1]), :"**", argl(val[3])), :"-@")
835
+ _, (num, line), _, arg = val
836
+ lit = s(:lit, num).line line
837
+ result = new_call(new_call(lit, :"**", argl(arg)), :"-@")
838
+
772
839
  }
773
840
  | tUPLUS arg
774
841
  {
@@ -809,15 +876,19 @@ rule
809
876
  }
810
877
  | arg tMATCH arg
811
878
  {
812
- result = new_match val[0], val[2]
879
+ lhs, _, rhs = val
880
+ result = new_match lhs, rhs
813
881
  }
814
882
  | arg tNMATCH arg
815
883
  {
816
- result = s(:not, new_match(val[0], val[2]))
884
+ lhs, _, rhs = val
885
+ result = s(:not, new_match(lhs, rhs)).line lhs.line
817
886
  }
818
887
  | tBANG arg
819
888
  {
820
- result = new_call val[1], :"!"
889
+ _, arg = val
890
+ result = new_call arg, :"!"
891
+ result.line arg.line
821
892
  }
822
893
  | tTILDE arg
823
894
  {
@@ -845,11 +916,13 @@ rule
845
916
  }
846
917
  | kDEFINED opt_nl arg
847
918
  {
848
- result = s(:defined, val[2])
919
+ (_, line), _, arg = val
920
+ result = s(:defined, arg).line line
849
921
  }
850
922
  | arg tEH arg opt_nl tCOLON arg
851
923
  {
852
- result = s(:if, val[0], val[2], val[5])
924
+ c, _, t, _, _, f = val
925
+ result = s(:if, c, t, f).line c.line
853
926
  }
854
927
  | primary
855
928
 
@@ -860,12 +933,12 @@ rule
860
933
 
861
934
  rel_expr: arg relop arg =tGT
862
935
  {
863
- lhs, op, rhs = val
936
+ lhs, (op, _), rhs = val
864
937
  result = new_call lhs, op.to_sym, argl(rhs)
865
938
  }
866
939
  | rel_expr relop arg =tGT
867
940
  {
868
- lhs, op, rhs = val
941
+ lhs, (op, _), rhs = val
869
942
  warn "comparison '%s' after comparison", op
870
943
  result = new_call lhs, op.to_sym, argl(rhs)
871
944
  }
@@ -892,28 +965,25 @@ rule
892
965
  arg_rhs: arg =tOP_ASGN
893
966
  | arg kRESCUE_MOD arg
894
967
  {
895
- body, _, resbody = val
968
+ body, (_, line), resbody = val
896
969
  body = value_expr body
897
970
  resbody = remove_begin resbody
898
- result = new_rescue(body, new_resbody(s(:array), resbody))
971
+
972
+ ary = s(:array).line line
973
+ result = new_rescue(body, new_resbody(ary, resbody))
899
974
  }
900
975
 
901
976
  paren_args: tLPAREN2 opt_call_args rparen
902
977
  {
903
- result = val[1]
978
+ _, args, _ = val
979
+ result = args
904
980
  }
905
981
 
906
982
  opt_paren_args: none
907
983
  | paren_args
908
984
 
909
985
  opt_call_args: none
910
- {
911
- result = val[0]
912
- }
913
986
  | call_args
914
- {
915
- result = val[0]
916
- }
917
987
  | args tCOMMA
918
988
  {
919
989
  result = args val
@@ -935,17 +1005,14 @@ rule
935
1005
  | args opt_block_arg
936
1006
  {
937
1007
  result = call_args val
938
- result = self.arg_blk_pass val[0], val[1]
939
1008
  }
940
1009
  | assocs opt_block_arg
941
1010
  {
942
- result = call_args [array_to_hash(val[0])]
943
- result = self.arg_blk_pass result, val[1]
1011
+ result = call_args [array_to_hash(val[0]), val[1]]
944
1012
  }
945
1013
  | args tCOMMA assocs opt_block_arg
946
1014
  {
947
- result = call_args [val[0], array_to_hash(val[2])]
948
- result = self.arg_blk_pass result, val[3]
1015
+ result = call_args [val[0], array_to_hash(val[2]), val[3]]
949
1016
  }
950
1017
  | block_arg
951
1018
  {
@@ -953,17 +1020,45 @@ rule
953
1020
  }
954
1021
 
955
1022
  command_args: {
956
- result = lexer.cmdarg.store true
1023
+ # parse26.y line 2200
1024
+
1025
+ # If call_args starts with a open paren '(' or
1026
+ # '[', look-ahead reading of the letters calls
1027
+ # CMDARG_PUSH(0), but the push must be done
1028
+ # after CMDARG_PUSH(1). So this code makes them
1029
+ # consistent by first cancelling the premature
1030
+ # CMDARG_PUSH(0), doing CMDARG_PUSH(1), and
1031
+ # finally redoing CMDARG_PUSH(0).
1032
+
1033
+ result = yychar = self.last_token_type.first
1034
+ lookahead = [:tLPAREN, :tLPAREN_ARG, :tLPAREN2, :tLBRACK, :tLBRACK2].include?(yychar)
1035
+ lexer.cmdarg.pop if lookahead
1036
+ lexer.cmdarg.push true
1037
+ lexer.cmdarg.push false if lookahead
957
1038
  }
958
1039
  call_args
959
1040
  {
960
- lexer.cmdarg.restore val[0]
961
- result = val[1]
1041
+ yychar, args = val
1042
+
1043
+ # call_args can be followed by tLBRACE_ARG (that
1044
+ # does CMDARG_PUSH(0) in the lexer) but the push
1045
+ # must be done after CMDARG_POP() in the parser.
1046
+ # So this code does CMDARG_POP() to pop 0 pushed
1047
+ # by tLBRACE_ARG, CMDARG_POP() to pop 1 pushed
1048
+ # by command_args, and CMDARG_PUSH(0) to restore
1049
+ # back the flag set by tLBRACE_ARG.
1050
+
1051
+ lookahead = [:tLBRACE_ARG].include?(yychar)
1052
+ lexer.cmdarg.pop if lookahead
1053
+ lexer.cmdarg.pop
1054
+ lexer.cmdarg.push false if lookahead
1055
+ result = args
962
1056
  }
963
1057
 
964
1058
  block_arg: tAMPER arg_value
965
1059
  {
966
- result = s(:block_pass, val[1])
1060
+ _, arg = val
1061
+ result = s(:block_pass, arg).line arg.line
967
1062
  }
968
1063
 
969
1064
  opt_block_arg: tCOMMA block_arg
@@ -974,19 +1069,27 @@ rule
974
1069
 
975
1070
  args: arg_value
976
1071
  {
977
- result = s(:array, val[0])
1072
+ arg, = val
1073
+ lineno = arg.line || lexer.lineno # HACK
1074
+
1075
+ result = s(:array, arg).line lineno
978
1076
  }
979
1077
  | tSTAR arg_value
980
1078
  {
981
- result = s(:array, s(:splat, val[1]))
1079
+ _, arg = val
1080
+ result = s(:array, s(:splat, arg).line(arg.line)).line arg.line
982
1081
  }
983
1082
  | args tCOMMA arg_value
984
1083
  {
985
- result = self.list_append val[0], val[2]
1084
+ args, _, id = val
1085
+ result = self.list_append args, id
986
1086
  }
987
1087
  | args tCOMMA tSTAR arg_value
988
1088
  {
989
- result = self.list_append val[0], s(:splat, val[3])
1089
+ # TODO: the line number from tSTAR has been dropped
1090
+ args, _, _, id = val
1091
+ line = lexer.lineno
1092
+ result = self.list_append args, s(:splat, id).line(line)
990
1093
  }
991
1094
 
992
1095
  mrhs_arg: mrhs
@@ -1004,11 +1107,14 @@ rule
1004
1107
  }
1005
1108
  | args tCOMMA tSTAR arg_value
1006
1109
  {
1007
- result = self.arg_concat val[0], val[3]
1110
+ # TODO: make all tXXXX terminals include lexer.lineno
1111
+ arg, _, _, splat = val
1112
+ result = self.arg_concat arg, splat
1008
1113
  }
1009
1114
  | tSTAR arg_value
1010
1115
  {
1011
- result = s(:splat, val[1])
1116
+ _, arg = val
1117
+ result = s(:splat, arg).line arg.line
1012
1118
  }
1013
1119
 
1014
1120
  primary: literal
@@ -1023,65 +1129,64 @@ rule
1023
1129
  | backref
1024
1130
  | tFID
1025
1131
  {
1026
- result = new_call nil, val[0].to_sym
1132
+ (msg, line), = val
1133
+ result = new_call nil, msg.to_sym
1134
+ result.line line
1027
1135
  }
1028
1136
  | k_begin
1029
1137
  {
1138
+ lexer.cmdarg.push false
1030
1139
  result = self.lexer.lineno
1031
- # TODO:
1032
- # $<val>1 = cmdarg_stack;
1033
- # CMDARG_SET(0);
1034
1140
  }
1035
1141
  bodystmt k_end
1036
1142
  {
1037
- # TODO: CMDARG_SET($<val>1);
1038
- unless val[2] then
1039
- result = s(:nil)
1040
- else
1041
- result = s(:begin, val[2])
1042
- end
1043
-
1044
- result.line = val[1]
1143
+ lexer.cmdarg.pop
1144
+ result = new_begin val
1045
1145
  }
1046
- | tLPAREN_ARG rparen
1146
+ | tLPAREN_ARG
1047
1147
  {
1048
- # TODO: lex_state = EXPR_ENDARG in between
1049
- debug20 13, val, result
1148
+ lexer.lex_state = EXPR_ENDARG
1149
+ result = lexer.lineno
1050
1150
  }
1051
- | tLPAREN_ARG
1151
+ rparen
1052
1152
  {
1053
- result = lexer.cmdarg.store false
1054
- # result = self.lexer.cmdarg.stack.dup
1055
- # lexer.cmdarg.stack.replace [false] # TODO add api for these
1153
+ _, line, _ = val
1154
+ result = s(:begin).line line
1056
1155
  }
1156
+ | tLPAREN_ARG
1057
1157
  stmt
1058
1158
  {
1059
1159
  lexer.lex_state = EXPR_ENDARG
1060
1160
  }
1061
1161
  rparen
1062
1162
  {
1063
- _, cmdarg, stmt, _, _, = val
1064
- warning "(...) interpreted as grouped expression"
1065
- lexer.cmdarg.restore cmdarg
1163
+ _, stmt, _, _, = val
1164
+ # warning "(...) interpreted as grouped expression"
1066
1165
  result = stmt
1067
1166
  }
1068
1167
  | tLPAREN compstmt tRPAREN
1069
1168
  {
1070
- result = val[1] || s(:nil)
1169
+ _, stmt, _ = val
1170
+ result = stmt
1171
+ result ||= s(:nil).line lexer.lineno
1071
1172
  result.paren = true
1072
1173
  }
1073
1174
  | primary_value tCOLON2 tCONSTANT
1074
1175
  {
1075
- result = s(:colon2, val[0], val[2].to_sym)
1176
+ expr, _, (id, _line) = val
1177
+
1178
+ result = s(:colon2, expr, id.to_sym).line expr.line
1076
1179
  }
1077
1180
  | tCOLON3 tCONSTANT
1078
1181
  {
1079
- result = s(:colon3, val[1].to_sym)
1182
+ result = wrap :colon3, val[1]
1080
1183
  }
1081
- | tLBRACK aref_args tRBRACK
1184
+ | tLBRACK { result = lexer.lineno } aref_args tRBRACK
1082
1185
  {
1083
- result = val[1] || s(:array)
1186
+ _, line, args, _ = val
1187
+ result = args || s(:array)
1084
1188
  result.sexp_type = :array # aref_args is :args
1189
+ result.line line
1085
1190
  }
1086
1191
  | tLBRACE
1087
1192
  {
@@ -1093,39 +1198,49 @@ rule
1093
1198
  }
1094
1199
  | k_return
1095
1200
  {
1096
- result = s(:return)
1201
+ (_, line), = val
1202
+ result = s(:return).line line
1097
1203
  }
1098
1204
  | kYIELD tLPAREN2 call_args rparen
1099
1205
  {
1100
- result = new_yield val[2]
1206
+ (_, line), _, args, _ = val
1207
+
1208
+ result = new_yield(args).line line
1101
1209
  }
1102
1210
  | kYIELD tLPAREN2 rparen
1103
1211
  {
1104
- result = new_yield
1212
+ (_, line), _, _ = val
1213
+
1214
+ result = new_yield.line line
1105
1215
  }
1106
1216
  | kYIELD
1107
1217
  {
1108
- result = new_yield
1218
+ (_, line), = val
1219
+
1220
+ result = new_yield.line line
1109
1221
  }
1110
1222
  | kDEFINED opt_nl tLPAREN2 expr rparen
1111
1223
  {
1112
- result = s(:defined, val[3])
1224
+ (_, line), _, _, arg, _ = val
1225
+
1226
+ result = s(:defined, arg).line line
1113
1227
  }
1114
1228
  | kNOT tLPAREN2 expr rparen
1115
1229
  {
1116
- result = s(:call, val[2], :"!")
1230
+ _, _, lhs, _ = val
1231
+ result = new_call lhs, :"!"
1117
1232
  }
1118
1233
  | kNOT tLPAREN2 rparen
1119
1234
  {
1120
- debug20 14, val, result
1235
+ debug 20
1121
1236
  }
1122
1237
  | fcall brace_block
1123
1238
  {
1124
- oper, iter = val[0], val[1]
1125
- call = oper # FIX
1239
+ call, iter = val
1240
+
1126
1241
  iter.insert 1, call
1127
1242
  result = iter
1128
- call.line = iter.line
1243
+ # FIX: probably not: call.line = iter.line
1129
1244
  }
1130
1245
  | method_call
1131
1246
  | method_call brace_block
@@ -1135,9 +1250,10 @@ rule
1135
1250
  iter.insert 1, call # FIX
1136
1251
  result = iter
1137
1252
  }
1138
- | tLAMBDA lambda
1253
+ | lambda
1139
1254
  {
1140
- result = val[1] # TODO: fix lineno
1255
+ expr, = val
1256
+ result = expr
1141
1257
  }
1142
1258
  | k_if expr_value then compstmt if_tail k_end
1143
1259
  {
@@ -1180,7 +1296,6 @@ rule
1180
1296
  }
1181
1297
  cpath superclass
1182
1298
  {
1183
- self.comments.push self.lexer.comments
1184
1299
  if (self.in_def || self.in_single > 0) then
1185
1300
  yyerror "class definition in method body"
1186
1301
  end
@@ -1190,7 +1305,7 @@ rule
1190
1305
  {
1191
1306
  result = new_class val
1192
1307
  self.env.unextend
1193
- self.lexer.comments # we don't care about comments in the body
1308
+ self.lexer.ignore_body_comments
1194
1309
  }
1195
1310
  | k_class tLSHFT
1196
1311
  {
@@ -1211,7 +1326,7 @@ rule
1211
1326
  {
1212
1327
  result = new_sclass val
1213
1328
  self.env.unextend
1214
- self.lexer.comments # we don't care about comments in the body
1329
+ self.lexer.ignore_body_comments
1215
1330
  }
1216
1331
  | k_module
1217
1332
  {
@@ -1219,7 +1334,6 @@ rule
1219
1334
  }
1220
1335
  cpath
1221
1336
  {
1222
- self.comments.push self.lexer.comments
1223
1337
  yyerror "module definition in method body" if
1224
1338
  self.in_def or self.in_single > 0
1225
1339
 
@@ -1229,70 +1343,87 @@ rule
1229
1343
  {
1230
1344
  result = new_module val
1231
1345
  self.env.unextend
1232
- self.lexer.comments # we don't care about comments in the body
1346
+ self.lexer.ignore_body_comments
1233
1347
  }
1234
1348
  | k_def fname
1235
1349
  {
1236
- result = [self.in_def, self.lexer.cmdarg.stack.dup]
1350
+ result = self.in_def
1237
1351
 
1238
- self.comments.push self.lexer.comments
1239
- self.in_def = true
1352
+ self.in_def = true # group = local_push
1240
1353
  self.env.extend
1241
- # TODO: local->cmdargs = cmdarg_stack;
1242
- # TODO: port local_push_gen and local_pop_gen
1243
- lexer.cmdarg.stack.replace [false]
1354
+ lexer.cmdarg.push false
1355
+ lexer.cond.push false
1244
1356
  }
1245
1357
  f_arglist bodystmt k_end
1246
1358
  {
1247
- in_def, cmdarg = val[2]
1248
-
1249
- result = new_defn val
1359
+ result, in_def = new_defn val
1250
1360
 
1251
- lexer.cmdarg.stack.replace cmdarg
1361
+ lexer.cond.pop # group = local_pop
1362
+ lexer.cmdarg.pop
1252
1363
  self.env.unextend
1253
1364
  self.in_def = in_def
1254
- self.lexer.comments # we don't care about comments in the body
1365
+
1366
+ self.lexer.ignore_body_comments
1255
1367
  }
1256
1368
  | k_def singleton dot_or_colon
1257
1369
  {
1258
- self.comments.push self.lexer.comments
1259
1370
  lexer.lex_state = EXPR_FNAME
1260
1371
  }
1261
1372
  fname
1262
1373
  {
1263
- self.in_single += 1
1374
+ result = self.in_def
1375
+
1376
+ self.in_single += 1 # TODO: remove?
1377
+
1378
+ self.in_def = true # local_push
1264
1379
  self.env.extend
1265
- lexer.lex_state = EXPR_ENDFN # force for args
1266
- result = [lexer.lineno, self.lexer.cmdarg.stack.dup]
1267
- lexer.cmdarg.stack.replace [false]
1380
+ lexer.cmdarg.push false
1381
+ lexer.cond.push false
1382
+
1383
+ lexer.lex_state = EXPR_ENDFN|EXPR_LABEL
1268
1384
  }
1269
1385
  f_arglist bodystmt k_end
1270
1386
  {
1271
- line, cmdarg = val[5]
1272
- result = new_defs val
1273
- result[3].line line
1274
1387
 
1275
- lexer.cmdarg.stack.replace cmdarg
1388
+ # [kdef, recv, _, _, (name, line), in_def, args, body, kend]
1389
+ # =>
1390
+ # [kdef, recv, (name, line), in_def, args, body, kend]
1391
+
1392
+ val.delete_at 3
1393
+ val.delete_at 2
1276
1394
 
1395
+ result, in_def = new_defs val
1396
+
1397
+ lexer.cond.pop # group = local_pop
1398
+ lexer.cmdarg.pop
1277
1399
  self.env.unextend
1400
+ self.in_def = in_def
1401
+
1278
1402
  self.in_single -= 1
1279
- self.lexer.comments # we don't care about comments in the body
1403
+
1404
+ # TODO: restore cur_arg ? what's cur_arg?
1405
+
1406
+ self.lexer.ignore_body_comments
1280
1407
  }
1281
1408
  | kBREAK
1282
1409
  {
1283
- result = s(:break)
1410
+ (_, line), = val
1411
+ result = s(:break).line line
1284
1412
  }
1285
1413
  | kNEXT
1286
1414
  {
1287
- result = s(:next)
1415
+ (_, line), = val
1416
+ result = s(:next).line line
1288
1417
  }
1289
1418
  | kREDO
1290
1419
  {
1291
- result = s(:redo)
1420
+ (_, line), = val
1421
+ result = s(:redo).line line
1292
1422
  }
1293
1423
  | kRETRY
1294
1424
  {
1295
- result = s(:retry)
1425
+ (_, line), = val
1426
+ result = s(:retry).line line
1296
1427
  }
1297
1428
 
1298
1429
  primary_value: primary
@@ -1309,8 +1440,17 @@ rule
1309
1440
  k_case: kCASE
1310
1441
  k_for: kFOR
1311
1442
  k_class: kCLASS
1443
+ {
1444
+ self.comments.push self.lexer.comments
1445
+ }
1312
1446
  k_module: kMODULE
1447
+ {
1448
+ self.comments.push self.lexer.comments
1449
+ }
1313
1450
  k_def: kDEF
1451
+ {
1452
+ self.comments.push self.lexer.comments
1453
+ }
1314
1454
  k_do: kDO
1315
1455
  k_do_block: kDO_BLOCK
1316
1456
  k_rescue: kRESCUE
@@ -1331,7 +1471,9 @@ rule
1331
1471
  if_tail: opt_else
1332
1472
  | k_elsif expr_value then compstmt if_tail
1333
1473
  {
1334
- result = s(:if, val[1], val[3], val[4])
1474
+ (_, line), c, _, t, rest = val
1475
+
1476
+ result = s(:if, c, t, rest).line line
1335
1477
  }
1336
1478
 
1337
1479
  opt_else: none
@@ -1354,7 +1496,9 @@ rule
1354
1496
 
1355
1497
  f_marg_list: f_marg
1356
1498
  {
1357
- result = s(:array, val[0])
1499
+ sym, = val
1500
+
1501
+ result = s(:array, sym).line lexer.lineno
1358
1502
  }
1359
1503
  | f_marg_list tCOMMA f_marg
1360
1504
  {
@@ -1367,51 +1511,42 @@ rule
1367
1511
 
1368
1512
  result = block_var args
1369
1513
  }
1370
- | f_marg_list tCOMMA tSTAR f_norm_arg
1514
+ | f_marg_list tCOMMA f_rest_marg
1371
1515
  {
1372
- args, _, _, splat = val
1516
+ args, _, rest = val
1373
1517
 
1374
- result = block_var args, "*#{splat}".to_sym
1518
+ result = block_var args, rest
1375
1519
  }
1376
- | f_marg_list tCOMMA tSTAR f_norm_arg tCOMMA f_marg_list
1520
+ | f_marg_list tCOMMA f_rest_marg tCOMMA f_marg_list
1377
1521
  {
1378
- args, _, _, splat, _, args2 = val
1522
+ lhs, _, splat, _, rhs = val
1379
1523
 
1380
- result = block_var args, "*#{splat}".to_sym, args2
1524
+ result = block_var lhs, splat, rhs
1381
1525
  }
1382
- | f_marg_list tCOMMA tSTAR
1526
+ | f_rest_marg
1383
1527
  {
1384
- args, _, _ = val
1528
+ rest, = val
1385
1529
 
1386
- result = block_var args, :*
1530
+ result = block_var rest
1387
1531
  }
1388
- | f_marg_list tCOMMA tSTAR tCOMMA f_marg_list
1532
+ | f_rest_marg tCOMMA f_marg_list
1389
1533
  {
1390
- args, _, _, _, args2 = val
1534
+ splat, _, rest = val
1391
1535
 
1392
- result = block_var args, :*, args2
1536
+ result = block_var splat, rest
1393
1537
  }
1394
- | tSTAR f_norm_arg
1395
- {
1396
- _, splat = val
1397
1538
 
1398
- result = block_var :"*#{splat}"
1399
- }
1400
- | tSTAR f_norm_arg tCOMMA f_marg_list
1539
+ f_rest_marg: tSTAR f_norm_arg
1401
1540
  {
1402
- _, splat, _, args = val
1541
+ _, (id, line) = val
1403
1542
 
1404
- result = block_var :"*#{splat}", args
1543
+ result = args ["*#{id}".to_sym]
1544
+ result.line line
1405
1545
  }
1406
1546
  | tSTAR
1407
1547
  {
1408
- result = block_var :*
1409
- }
1410
- | tSTAR tCOMMA f_marg_list
1411
- {
1412
- _, _, args = val
1413
-
1414
- result = block_var :*, args
1548
+ result = args [:*]
1549
+ result.line lexer.lineno # FIX: tSTAR -> line
1415
1550
  }
1416
1551
 
1417
1552
  block_args_tail: f_block_kwarg tCOMMA f_kwrest opt_f_block_arg
@@ -1428,7 +1563,9 @@ rule
1428
1563
  }
1429
1564
  | f_block_arg
1430
1565
  {
1431
- result = call_args val
1566
+ (id, line), = val
1567
+ result = call_args [id]
1568
+ result.line line
1432
1569
  }
1433
1570
 
1434
1571
  opt_block_args_tail: tCOMMA block_args_tail
@@ -1459,7 +1596,7 @@ opt_block_args_tail: tCOMMA block_args_tail
1459
1596
  }
1460
1597
  | f_arg tCOMMA
1461
1598
  {
1462
- result = args val
1599
+ result = args(val) << nil
1463
1600
  }
1464
1601
  | f_arg tCOMMA f_rest_arg tCOMMA f_arg opt_block_args_tail
1465
1602
  {
@@ -1511,7 +1648,7 @@ opt_block_args_tail: tCOMMA block_args_tail
1511
1648
  }
1512
1649
  | tOROP
1513
1650
  {
1514
- result = s(:args)
1651
+ result = s(:args).line lexer.lineno
1515
1652
  }
1516
1653
  | tPIPE block_param opt_bv_decl tPIPE
1517
1654
  {
@@ -1536,34 +1673,32 @@ opt_block_args_tail: tCOMMA block_args_tail
1536
1673
 
1537
1674
  bvar: tIDENTIFIER
1538
1675
  {
1539
- result = s(:shadow, val[0].to_sym)
1676
+ result = wrap :shadow, val[0]
1540
1677
  }
1541
1678
  | f_bad_arg
1542
1679
 
1543
- lambda: {
1680
+ lambda: tLAMBDA
1681
+ {
1544
1682
  self.env.extend :dynamic
1545
- result = self.lexer.lineno
1546
-
1547
- result = lexer.lpar_beg
1683
+ result = [lexer.lineno, lexer.lpar_beg]
1548
1684
  lexer.paren_nest += 1
1549
1685
  lexer.lpar_beg = lexer.paren_nest
1550
1686
  }
1551
1687
  f_larglist
1552
1688
  {
1553
- result = [lexer.cmdarg.store(false), self.lexer.lineno]
1689
+ lexer.cmdarg.push false
1554
1690
  }
1555
1691
  lambda_body
1556
1692
  {
1557
- lpar, args, (cmdarg, lineno), body = val
1693
+ _, (line, lpar), args, _cmdarg, body = val
1558
1694
  lexer.lpar_beg = lpar
1559
1695
 
1560
- lexer.cmdarg.restore cmdarg
1561
- lexer.cmdarg.lexpop
1696
+ lexer.cmdarg.pop
1562
1697
 
1563
- call = new_call nil, :lambda
1698
+ call = s(:lambda).line line
1564
1699
  result = new_iter call, args, body
1565
- result.line = lineno
1566
- self.env.unextend
1700
+ result.line line
1701
+ self.env.unextend # TODO: dynapush & dynapop
1567
1702
  }
1568
1703
 
1569
1704
  f_larglist: tLPAREN2 f_args opt_bv_decl rparen
@@ -1587,8 +1722,8 @@ opt_block_args_tail: tCOMMA block_args_tail
1587
1722
 
1588
1723
  do_block: k_do_block do_body kEND
1589
1724
  {
1590
- # TODO: maybe fix lineno to kDO's lineno?
1591
- result = val[1]
1725
+ (_, line), iter, _ = val
1726
+ result = iter.line line
1592
1727
  }
1593
1728
 
1594
1729
  block_call: command do_block
@@ -1597,21 +1732,28 @@ opt_block_args_tail: tCOMMA block_args_tail
1597
1732
  ## if (nd_type($1) == NODE_YIELD) {
1598
1733
  ## compile_error(PARSER_ARG "block given to yield");
1599
1734
 
1735
+ cmd, blk = val
1736
+
1600
1737
  syntax_error "Both block arg and actual block given." if
1601
- val[0].block_pass?
1738
+ cmd.block_pass?
1602
1739
 
1603
- val = invert_block_call val if inverted? val
1740
+ if inverted? val then
1741
+ val = invert_block_call val
1742
+ cmd, blk = val
1743
+ end
1604
1744
 
1605
- result = val[1]
1606
- result.insert 1, val[0]
1745
+ result = blk
1746
+ result.insert 1, cmd
1607
1747
  }
1608
1748
  | block_call call_op2 operation2 opt_paren_args
1609
1749
  {
1610
- result = new_call val[0], val[2].to_sym, val[3]
1750
+ lhs, _, (id, _line), args = val
1751
+
1752
+ result = new_call lhs, id.to_sym, args
1611
1753
  }
1612
1754
  | block_call call_op2 operation2 opt_paren_args brace_block
1613
1755
  {
1614
- iter1, _, name, args, iter2 = val
1756
+ iter1, _, (name, _line), args, iter2 = val
1615
1757
 
1616
1758
  call = new_call iter1, name.to_sym, args
1617
1759
  iter2.insert 1, call
@@ -1620,7 +1762,7 @@ opt_block_args_tail: tCOMMA block_args_tail
1620
1762
  }
1621
1763
  | block_call call_op2 operation2 command_args do_block
1622
1764
  {
1623
- iter1, _, name, args, iter2 = val
1765
+ iter1, _, (name, _line), args, iter2 = val
1624
1766
 
1625
1767
  call = new_call iter1, name.to_sym, args
1626
1768
  iter2.insert 1, call
@@ -1628,26 +1770,29 @@ opt_block_args_tail: tCOMMA block_args_tail
1628
1770
  result = iter2
1629
1771
  }
1630
1772
 
1631
- method_call: fcall
1773
+ method_call: fcall paren_args
1632
1774
  {
1633
- result = self.lexer.lineno
1634
- }
1635
- paren_args
1636
- {
1637
- args = self.call_args val[2..-1]
1638
- result = val[0].concat args.sexp_body
1775
+ call, args = val
1776
+
1777
+ result = call.concat args.sexp_body if args
1639
1778
  }
1640
1779
  | primary_value call_op operation2 opt_paren_args
1641
1780
  {
1642
- result = new_call val[0], val[2].to_sym, val[3], val[1]
1781
+ recv, call_op, (op, _line), args = val
1782
+
1783
+ result = new_call recv, op.to_sym, args, call_op
1643
1784
  }
1644
1785
  | primary_value tCOLON2 operation2 paren_args
1645
1786
  {
1646
- result = new_call val[0], val[2].to_sym, val[3]
1787
+ recv, _, (op, _line), args = val
1788
+
1789
+ result = new_call recv, op.to_sym, args
1647
1790
  }
1648
1791
  | primary_value tCOLON2 operation3
1649
1792
  {
1650
- result = new_call val[0], val[2].to_sym
1793
+ lhs, _, (id, _line) = val
1794
+
1795
+ result = new_call lhs, id.to_sym
1651
1796
  }
1652
1797
  | primary_value call_op paren_args
1653
1798
  {
@@ -1663,7 +1808,7 @@ opt_block_args_tail: tCOMMA block_args_tail
1663
1808
  }
1664
1809
  | kSUPER
1665
1810
  {
1666
- result = s(:zsuper)
1811
+ result = s(:zsuper).line lexer.lineno
1667
1812
  }
1668
1813
  | primary_value tLBRACK2 opt_call_args rbracket
1669
1814
  {
@@ -1680,7 +1825,7 @@ opt_block_args_tail: tCOMMA block_args_tail
1680
1825
  _, line, body, _ = val
1681
1826
 
1682
1827
  result = body
1683
- result.line = line
1828
+ result.line line
1684
1829
 
1685
1830
  self.env.unextend
1686
1831
  }
@@ -1694,7 +1839,7 @@ opt_block_args_tail: tCOMMA block_args_tail
1694
1839
  _, line, body, _ = val
1695
1840
 
1696
1841
  result = body
1697
- result.line = line
1842
+ result.line line
1698
1843
 
1699
1844
  self.env.unextend
1700
1845
  }
@@ -1712,25 +1857,50 @@ opt_block_args_tail: tCOMMA block_args_tail
1712
1857
  }
1713
1858
 
1714
1859
  do_body: { self.env.extend :dynamic; result = self.lexer.lineno }
1715
- { result = lexer.cmdarg.store(false) }
1860
+ { lexer.cmdarg.push false }
1716
1861
  opt_block_param
1717
- bodystmt
1862
+ compstmt
1718
1863
  {
1719
- line, cmdarg, param, cmpstmt = val
1864
+ line, _cmdarg, param, cmpstmt = val
1720
1865
 
1721
1866
  result = new_do_body param, cmpstmt, line
1867
+ lexer.cmdarg.pop
1722
1868
  self.env.unextend
1723
- lexer.cmdarg.restore cmdarg
1869
+ }
1870
+
1871
+ case_args: arg_value
1872
+ {
1873
+ arg, = val
1874
+
1875
+ result = s(:array, arg).line arg.line
1876
+ }
1877
+ | tSTAR arg_value
1878
+ {
1879
+ _, arg = val
1880
+
1881
+ result = s(:array, s(:splat, arg).line(arg.line)).line arg.line
1882
+ }
1883
+ | case_args tCOMMA arg_value
1884
+ {
1885
+ args, _, id = val
1886
+
1887
+ result = self.list_append args, id
1888
+ }
1889
+ | case_args tCOMMA tSTAR arg_value
1890
+ {
1891
+ args, _, _, id = val
1892
+
1893
+ result = self.list_append args, s(:splat, id).line(id.line)
1724
1894
  }
1725
1895
 
1726
1896
  case_body: k_when
1727
1897
  {
1728
1898
  result = self.lexer.lineno
1729
1899
  }
1730
- args then compstmt cases
1900
+ case_args then compstmt cases
1731
1901
  {
1732
1902
  result = new_when(val[2], val[4])
1733
- result.line = val[1]
1903
+ result.line val[1]
1734
1904
  result << val[5] if val[5]
1735
1905
  }
1736
1906
 
@@ -1741,7 +1911,7 @@ opt_block_args_tail: tCOMMA block_args_tail
1741
1911
  (_, line), klasses, var, _, body, rest = val
1742
1912
 
1743
1913
  klasses ||= s(:array)
1744
- klasses << new_assign(var, s(:gvar, :"$!")) if var
1914
+ klasses << new_assign(var, s(:gvar, :"$!").line(var.line)) if var
1745
1915
  klasses.line line
1746
1916
 
1747
1917
  result = new_resbody(klasses, body)
@@ -1754,7 +1924,8 @@ opt_block_args_tail: tCOMMA block_args_tail
1754
1924
 
1755
1925
  exc_list: arg_value
1756
1926
  {
1757
- result = s(:array, val[0])
1927
+ arg, = val
1928
+ result = s(:array, arg).line arg.line
1758
1929
  }
1759
1930
  | mrhs
1760
1931
  | none
@@ -1767,31 +1938,29 @@ opt_block_args_tail: tCOMMA block_args_tail
1767
1938
 
1768
1939
  opt_ensure: k_ensure compstmt
1769
1940
  {
1770
- _, body = val
1941
+ (_, line), body = val
1771
1942
 
1772
- result = body || s(:nil)
1943
+ result = body || s(:nil).line(line)
1773
1944
  }
1774
1945
  | none
1775
1946
 
1776
1947
  literal: numeric
1777
1948
  {
1778
- result = s(:lit, val[0])
1949
+ (lit, line), = val
1950
+ result = s(:lit, lit).line line
1779
1951
  }
1780
1952
  | symbol
1781
- {
1782
- result = s(:lit, val[0])
1783
- }
1784
- | dsym
1785
1953
 
1786
1954
  strings: string
1787
1955
  {
1788
- val[0] = s(:dstr, val[0].value) if val[0].sexp_type == :evstr
1789
- result = val[0]
1956
+ str, = val
1957
+ str = s(:dstr, str.value) if str.sexp_type == :evstr
1958
+ result = str
1790
1959
  }
1791
1960
 
1792
1961
  string: tCHAR
1793
1962
  {
1794
- debug20 23, val, result
1963
+ debug 37
1795
1964
  }
1796
1965
  | string1
1797
1966
  | string string1
@@ -1801,7 +1970,11 @@ opt_block_args_tail: tCOMMA block_args_tail
1801
1970
 
1802
1971
  string1: tSTRING_BEG string_contents tSTRING_END
1803
1972
  {
1804
- result = val[1]
1973
+ (_, line), str, (_, func) = val
1974
+
1975
+ str = dedent str if func =~ RubyLexer::STR_FUNC_DEDENT
1976
+
1977
+ result = str.line line
1805
1978
  }
1806
1979
  | tSTRING
1807
1980
  {
@@ -1810,7 +1983,8 @@ opt_block_args_tail: tCOMMA block_args_tail
1810
1983
 
1811
1984
  xstring: tXSTRING_BEG xstring_contents tSTRING_END
1812
1985
  {
1813
- result = new_xstring val[1]
1986
+ result = new_xstring val
1987
+ # TODO: dedent?!?! SERIOUSLY?!?
1814
1988
  }
1815
1989
 
1816
1990
  regexp: tREGEXP_BEG regexp_contents tREGEXP_END
@@ -1820,11 +1994,15 @@ opt_block_args_tail: tCOMMA block_args_tail
1820
1994
 
1821
1995
  words: tWORDS_BEG tSPACE tSTRING_END
1822
1996
  {
1823
- result = s(:array)
1997
+ (_, line), _, _ = val
1998
+
1999
+ result = s(:array).line line
1824
2000
  }
1825
2001
  | tWORDS_BEG word_list tSTRING_END
1826
2002
  {
1827
- result = val[1]
2003
+ (_, line), list, _ = val
2004
+
2005
+ result = list.line line
1828
2006
  }
1829
2007
 
1830
2008
  word_list: none
@@ -1844,11 +2022,15 @@ opt_block_args_tail: tCOMMA block_args_tail
1844
2022
 
1845
2023
  symbols: tSYMBOLS_BEG tSPACE tSTRING_END
1846
2024
  {
1847
- result = s(:array)
2025
+ (_, line), _, _ = val
2026
+
2027
+ result = s(:array).line line
1848
2028
  }
1849
2029
  | tSYMBOLS_BEG symbol_list tSTRING_END
1850
2030
  {
1851
- result = val[1]
2031
+ (_, line), list, _, = val
2032
+ list.line line
2033
+ result = list
1852
2034
  }
1853
2035
 
1854
2036
  symbol_list: none
@@ -1857,25 +2039,34 @@ opt_block_args_tail: tCOMMA block_args_tail
1857
2039
  }
1858
2040
  | symbol_list word tSPACE
1859
2041
  {
1860
- result = val[0].dup << new_symbol_list_entry(val)
2042
+ list, * = val
2043
+ result = list.dup << new_symbol_list_entry(val)
1861
2044
  }
1862
2045
 
1863
2046
  qwords: tQWORDS_BEG tSPACE tSTRING_END
1864
2047
  {
1865
- result = s(:array)
2048
+ (_, line), _, _ = val
2049
+
2050
+ result = s(:array).line line
1866
2051
  }
1867
2052
  | tQWORDS_BEG qword_list tSTRING_END
1868
2053
  {
1869
- result = val[1]
2054
+ (_, line), list, _ = val
2055
+
2056
+ result = list.line line
1870
2057
  }
1871
2058
 
1872
2059
  qsymbols: tQSYMBOLS_BEG tSPACE tSTRING_END
1873
2060
  {
1874
- result = s(:array)
2061
+ (_, line), _, _ = val
2062
+
2063
+ result = s(:array).line line
1875
2064
  }
1876
2065
  | tQSYMBOLS_BEG qsym_list tSTRING_END
1877
2066
  {
1878
- result = val[1]
2067
+ (_, line), list, _ = val
2068
+
2069
+ result = list.line line
1879
2070
  }
1880
2071
 
1881
2072
  qword_list: none
@@ -1898,11 +2089,13 @@ opt_block_args_tail: tCOMMA block_args_tail
1898
2089
 
1899
2090
  string_contents: none
1900
2091
  {
1901
- result = s(:str, "")
2092
+ line = prev_value_to_lineno _values.last
2093
+ result = s(:str, +"").line line
1902
2094
  }
1903
2095
  | string_contents string_content
1904
2096
  {
1905
- result = literal_concat(val[0], val[1])
2097
+ v1, v2 = val
2098
+ result = literal_concat v1, v2
1906
2099
  }
1907
2100
 
1908
2101
  xstring_contents: none
@@ -1911,7 +2104,8 @@ xstring_contents: none
1911
2104
  }
1912
2105
  | xstring_contents string_content
1913
2106
  {
1914
- result = literal_concat(val[0], val[1])
2107
+ v1, v2 = val
2108
+ result = literal_concat v1, v2
1915
2109
  }
1916
2110
 
1917
2111
  regexp_contents: none
@@ -1920,7 +2114,8 @@ regexp_contents: none
1920
2114
  }
1921
2115
  | regexp_contents string_content
1922
2116
  {
1923
- result = literal_concat(val[0], val[1])
2117
+ v1, v2 = val
2118
+ result = literal_concat v1, v2
1924
2119
  }
1925
2120
 
1926
2121
  string_content: tSTRING_CONTENT
@@ -1936,19 +2131,22 @@ regexp_contents: none
1936
2131
  }
1937
2132
  string_dvar
1938
2133
  {
1939
- lexer.lex_strterm = val[1]
1940
- result = s(:evstr, val[2])
2134
+ _, strterm, str = val
2135
+ lexer.lex_strterm = strterm
2136
+ result = s(:evstr, str).line str.line
1941
2137
  }
1942
2138
  | tSTRING_DBEG
1943
2139
  {
1944
2140
  result = [lexer.lex_strterm,
1945
2141
  lexer.brace_nest,
1946
2142
  lexer.string_nest, # TODO: remove
1947
- lexer.cond.store,
1948
- lexer.cmdarg.store,
1949
2143
  lexer.lex_state,
2144
+ lexer.lineno,
1950
2145
  ]
1951
2146
 
2147
+ lexer.cmdarg.push false
2148
+ lexer.cond.push false
2149
+
1952
2150
  lexer.lex_strterm = nil
1953
2151
  lexer.brace_nest = 0
1954
2152
  lexer.string_nest = 0
@@ -1960,14 +2158,15 @@ regexp_contents: none
1960
2158
  {
1961
2159
  _, memo, stmt, _ = val
1962
2160
 
1963
- lex_strterm, brace_nest, string_nest, oldcond, oldcmdarg, oldlex_state = memo
2161
+ lex_strterm, brace_nest, string_nest, oldlex_state, line = memo
2162
+ # TODO: heredoc_indent
1964
2163
 
1965
2164
  lexer.lex_strterm = lex_strterm
1966
2165
  lexer.brace_nest = brace_nest
1967
2166
  lexer.string_nest = string_nest
1968
2167
 
1969
- lexer.cond.restore oldcond
1970
- lexer.cmdarg.restore oldcmdarg
2168
+ lexer.cond.pop
2169
+ lexer.cmdarg.pop
1971
2170
 
1972
2171
  lexer.lex_state = oldlex_state
1973
2172
 
@@ -1977,56 +2176,71 @@ regexp_contents: none
1977
2176
  when :str, :dstr, :evstr then
1978
2177
  result = stmt
1979
2178
  else
1980
- result = s(:evstr, stmt)
2179
+ result = s(:evstr, stmt).line line
1981
2180
  end
1982
2181
  when nil then
1983
- result = s(:evstr)
2182
+ result = s(:evstr).line line
1984
2183
  else
1985
- debug20 25
2184
+ debug 38
1986
2185
  raise "unknown string body: #{stmt.inspect}"
1987
2186
  end
1988
2187
  }
1989
2188
 
1990
- string_dvar: tGVAR { result = s(:gvar, val[0].to_sym) }
1991
- | tIVAR { result = s(:ivar, val[0].to_sym) }
1992
- | tCVAR { result = s(:cvar, val[0].to_sym) }
2189
+ string_dvar: tGVAR
2190
+ {
2191
+ result = wrap :gvar, val[0]
2192
+ }
2193
+ | tIVAR
2194
+ {
2195
+ result = wrap :ivar, val[0]
2196
+ }
2197
+ | tCVAR
2198
+ {
2199
+ result = wrap :cvar, val[0]
2200
+ }
1993
2201
  | backref
1994
2202
 
1995
- symbol: tSYMBEG sym
2203
+ symbol: ssym
2204
+ | dsym
2205
+
2206
+ ssym: tSYMBEG sym
1996
2207
  {
1997
2208
  lexer.lex_state = EXPR_END
1998
- result = val[1].to_sym
2209
+ result = wrap :lit, val[1]
1999
2210
  }
2000
2211
  | tSYMBOL
2001
2212
  {
2002
- result = val[0].to_sym
2213
+ lexer.lex_state = EXPR_END
2214
+ result = wrap :lit, val[0]
2003
2215
  }
2004
2216
 
2005
2217
  sym: fname | tIVAR | tGVAR | tCVAR
2006
2218
 
2007
- dsym: tSYMBEG xstring_contents tSTRING_END
2219
+ dsym: tSYMBEG string_contents tSTRING_END
2008
2220
  {
2221
+ _, result, _ = val
2222
+
2009
2223
  lexer.lex_state = EXPR_END
2010
- result = val[1]
2011
2224
 
2012
- result ||= s(:str, "")
2225
+ result ||= s(:str, "").line lexer.lineno
2013
2226
 
2014
2227
  case result.sexp_type
2015
2228
  when :dstr then
2016
2229
  result.sexp_type = :dsym
2017
2230
  when :str then
2018
- result = s(:lit, result.last.to_sym)
2231
+ result = s(:lit, result.last.to_sym).line result.line
2019
2232
  when :evstr then
2020
- result = s(:dsym, "", result)
2233
+ result = s(:dsym, "", result).line result.line
2021
2234
  else
2022
- debug20 26, val, result
2235
+ debug 39
2023
2236
  end
2024
2237
  }
2025
2238
 
2026
2239
  numeric: simple_numeric
2027
- | tUMINUS_NUM simple_numeric
2240
+ | tUMINUS_NUM simple_numeric =tLOWEST
2028
2241
  {
2029
- result = -val[1] # TODO: pt_testcase
2242
+ _, (num, line) = val
2243
+ result = [-num, line]
2030
2244
  }
2031
2245
 
2032
2246
  simple_numeric: tINTEGER
@@ -2040,26 +2254,29 @@ regexp_contents: none
2040
2254
  | tCONSTANT
2041
2255
  | tCVAR
2042
2256
 
2043
- keyword_variable: kNIL { result = s(:nil) }
2044
- | kSELF { result = s(:self) }
2045
- | kTRUE { result = s(:true) }
2046
- | kFALSE { result = s(:false) }
2047
- | k__FILE__ { result = s(:str, self.file) }
2048
- | k__LINE__ { result = s(:lit, lexer.lineno) }
2257
+ keyword_variable: kNIL { result = s(:nil).line lexer.lineno }
2258
+ | kSELF { result = s(:self).line lexer.lineno }
2259
+ | kTRUE { result = s(:true).line lexer.lineno }
2260
+ | kFALSE { result = s(:false).line lexer.lineno }
2261
+ | k__FILE__ { result = s(:str, self.file).line lexer.lineno }
2262
+ | k__LINE__ { result = s(:lit, lexer.lineno).line lexer.lineno }
2049
2263
  | k__ENCODING__
2050
2264
  {
2265
+ l = lexer.lineno
2051
2266
  result =
2052
2267
  if defined? Encoding then
2053
- s(:colon2, s(:const, :Encoding), :UTF_8)
2268
+ s(:colon2, s(:const, :Encoding).line(l), :UTF_8).line l
2054
2269
  else
2055
- s(:str, "Unsupported!")
2270
+ s(:str, "Unsupported!").line l
2056
2271
  end
2057
2272
  }
2058
2273
 
2059
2274
  var_ref: user_variable
2060
2275
  {
2061
- var = val[0]
2276
+ raise "NO: #{val.inspect}" if Sexp === val.first
2277
+ (var, line), = val
2062
2278
  result = Sexp === var ? var : self.gettable(var)
2279
+ result.line line
2063
2280
  }
2064
2281
  | keyword_variable
2065
2282
  {
@@ -2074,11 +2291,19 @@ keyword_variable: kNIL { result = s(:nil) }
2074
2291
  | keyword_variable
2075
2292
  {
2076
2293
  result = self.assignable val[0]
2077
- debug20 29, val, result
2294
+ debug 40
2078
2295
  }
2079
2296
 
2080
- backref: tNTH_REF { result = s(:nth_ref, val[0]) }
2081
- | tBACK_REF { result = s(:back_ref, val[0]) }
2297
+ backref: tNTH_REF
2298
+ {
2299
+ (ref, line), = val
2300
+ result = s(:nth_ref, ref).line line
2301
+ }
2302
+ | tBACK_REF
2303
+ {
2304
+ (ref, line), = val
2305
+ result = s(:back_ref, ref).line line
2306
+ }
2082
2307
 
2083
2308
  superclass: tLT
2084
2309
  {
@@ -2096,9 +2321,7 @@ keyword_variable: kNIL { result = s(:nil) }
2096
2321
 
2097
2322
  f_arglist: tLPAREN2 f_args rparen
2098
2323
  {
2099
- result = val[1]
2100
- self.lexer.lex_state = EXPR_BEG
2101
- self.lexer.command_start = true
2324
+ result = end_args val
2102
2325
  }
2103
2326
  | {
2104
2327
  result = self.in_kwarg
@@ -2107,12 +2330,7 @@ keyword_variable: kNIL { result = s(:nil) }
2107
2330
  }
2108
2331
  f_args term
2109
2332
  {
2110
- kwarg, args, _ = val
2111
-
2112
- self.in_kwarg = kwarg
2113
- result = args
2114
- lexer.lex_state = EXPR_BEG
2115
- lexer.command_start = true
2333
+ result = end_args val
2116
2334
  }
2117
2335
 
2118
2336
  args_tail: f_kwarg tCOMMA f_kwrest opt_f_block_arg
@@ -2197,8 +2415,10 @@ keyword_variable: kNIL { result = s(:nil) }
2197
2415
  |
2198
2416
  {
2199
2417
  result = args val
2418
+ # result.line lexer.lineno
2200
2419
  }
2201
2420
 
2421
+
2202
2422
  f_bad_arg: tCONSTANT
2203
2423
  {
2204
2424
  yyerror "formal argument cannot be a constant"
@@ -2219,10 +2439,11 @@ keyword_variable: kNIL { result = s(:nil) }
2219
2439
  f_norm_arg: f_bad_arg
2220
2440
  | tIDENTIFIER
2221
2441
  {
2222
- identifier = val[0].to_sym
2442
+ (id, line), = val
2443
+ identifier = id.to_sym
2223
2444
  self.env[identifier] = :lvar
2224
2445
 
2225
- result = identifier
2446
+ result = [identifier, line]
2226
2447
  }
2227
2448
 
2228
2449
  f_arg_asgn: f_norm_arg
@@ -2230,21 +2451,14 @@ keyword_variable: kNIL { result = s(:nil) }
2230
2451
  f_arg_item: f_arg_asgn
2231
2452
  | tLPAREN f_margs rparen
2232
2453
  {
2233
- result = val[1]
2454
+ _, margs, _ = val
2455
+
2456
+ result = margs
2234
2457
  }
2235
2458
 
2236
2459
  f_arg: f_arg_item
2237
2460
  {
2238
- case val[0]
2239
- when Symbol then
2240
- result = s(:args)
2241
- result << val[0]
2242
- when Sexp then
2243
- result = val[0]
2244
- else
2245
- debug20 32
2246
- raise "Unknown f_arg type: #{val.inspect}"
2247
- end
2461
+ result = new_arg val
2248
2462
  }
2249
2463
  | f_arg tCOMMA f_arg_item
2250
2464
  {
@@ -2253,48 +2467,52 @@ keyword_variable: kNIL { result = s(:nil) }
2253
2467
  if list.sexp_type == :args then
2254
2468
  result = list
2255
2469
  else
2256
- result = s(:args, list)
2470
+ result = s(:args, list).line list.line
2257
2471
  end
2258
2472
 
2259
- result << item
2473
+ result << (Sexp === item ? item : item.first)
2260
2474
  }
2261
2475
 
2262
2476
  f_label: tLABEL
2263
2477
 
2264
2478
  f_kw: f_label arg_value
2265
2479
  {
2266
- # TODO: call_args
2267
- label, _ = val[0] # TODO: fix lineno?
2480
+ # TODO: new_kw_arg
2481
+ (label, line), arg = val
2482
+
2268
2483
  identifier = label.to_sym
2269
2484
  self.env[identifier] = :lvar
2270
2485
 
2271
- result = s(:array, s(:kwarg, identifier, val[1]))
2486
+ kwarg = s(:kwarg, identifier, arg).line line
2487
+ result = s(:array, kwarg).line line
2272
2488
  }
2273
2489
  | f_label
2274
2490
  {
2275
- label, _ = val[0] # TODO: fix lineno?
2276
- identifier = label.to_sym
2277
- self.env[identifier] = :lvar
2491
+ (label, line), = val
2492
+
2493
+ id = label.to_sym
2494
+ self.env[id] = :lvar
2278
2495
 
2279
- result = s(:array, s(:kwarg, identifier))
2496
+ result = s(:array, s(:kwarg, id).line(line)).line line
2280
2497
  }
2281
2498
 
2282
2499
  f_block_kw: f_label primary_value
2283
2500
  {
2284
- # TODO: call_args
2285
- label, _ = val[0] # TODO: fix lineno?
2286
- identifier = label.to_sym
2287
- self.env[identifier] = :lvar
2501
+ # TODO: new_kw_arg
2502
+ (label, line), expr = val
2503
+ id = label.to_sym
2504
+ self.env[id] = :lvar
2288
2505
 
2289
- result = s(:array, s(:kwarg, identifier, val[1]))
2506
+ result = s(:array, s(:kwarg, id, expr).line(line)).line line
2290
2507
  }
2291
2508
  | f_label
2292
2509
  {
2293
- label, _ = val[0] # TODO: fix lineno?
2294
- identifier = label.to_sym
2295
- self.env[identifier] = :lvar
2510
+ # TODO: new_kw_arg
2511
+ (label, line), = val
2512
+ id = label.to_sym
2513
+ self.env[id] = :lvar
2296
2514
 
2297
- result = s(:array, s(:kwarg, identifier))
2515
+ result = s(:array, s(:kwarg, id).line(line)).line line
2298
2516
  }
2299
2517
 
2300
2518
  f_block_kwarg: f_block_kw
@@ -2313,41 +2531,51 @@ keyword_variable: kNIL { result = s(:nil) }
2313
2531
  kwrest_mark: tPOW
2314
2532
  | tDSTAR
2315
2533
 
2534
+
2316
2535
  f_kwrest: kwrest_mark tIDENTIFIER
2317
2536
  {
2318
- name = val[1].to_sym
2319
- self.assignable name
2320
- result = :"**#{name}"
2537
+ _, (id, line) = val
2538
+
2539
+ name = id.to_sym
2540
+ self.assignable [name, line]
2541
+ result = [:"**#{name}", line]
2321
2542
  }
2322
2543
  | kwrest_mark
2323
2544
  {
2324
- result = :"**"
2545
+ id = :"**"
2546
+ self.env[id] = :lvar # TODO: needed?!?
2547
+ result = [id, lexer.lineno] # TODO: tPOW/tDSTAR include lineno
2325
2548
  }
2326
2549
 
2327
2550
  f_opt: f_arg_asgn tEQL arg_value
2328
2551
  {
2329
- result = self.assignable val[0], val[2]
2552
+ lhs, _, rhs = val
2553
+ result = self.assignable lhs, rhs
2330
2554
  # TODO: detect duplicate names
2331
2555
  }
2332
2556
 
2333
2557
  f_block_opt: f_arg_asgn tEQL primary_value
2334
2558
  {
2335
- result = self.assignable val[0], val[2]
2559
+ lhs, _, rhs = val
2560
+ result = self.assignable lhs, rhs
2336
2561
  }
2337
2562
 
2338
2563
  f_block_optarg: f_block_opt
2339
2564
  {
2340
- result = s(:block, val[0])
2565
+ optblk, = val
2566
+ result = s(:block, optblk).line optblk.line
2341
2567
  }
2342
2568
  | f_block_optarg tCOMMA f_block_opt
2343
2569
  {
2344
- result = val[0]
2345
- result << val[2]
2570
+ optarg, _, optblk = val
2571
+ result = optarg
2572
+ result << optblk
2346
2573
  }
2347
2574
 
2348
2575
  f_optarg: f_opt
2349
2576
  {
2350
- result = s(:block, val[0])
2577
+ opt, = val
2578
+ result = s(:block, opt).line opt.line
2351
2579
  }
2352
2580
  | f_optarg tCOMMA f_opt
2353
2581
  {
@@ -2359,30 +2587,33 @@ keyword_variable: kNIL { result = s(:nil) }
2359
2587
  f_rest_arg: restarg_mark tIDENTIFIER
2360
2588
  {
2361
2589
  # TODO: differs from parse.y - needs tests
2362
- name = val[1].to_sym
2363
- self.assignable name
2364
- result = :"*#{name}"
2590
+ _, (id, line) = val
2591
+ name = id.to_sym
2592
+ self.assignable [name, line]
2593
+ result = [:"*#{name}", line]
2365
2594
  }
2366
2595
  | restarg_mark
2367
2596
  {
2368
2597
  name = :"*"
2369
2598
  self.env[name] = :lvar
2370
- result = name
2599
+ result = [name, lexer.lineno] # FIX: tSTAR to include lineno
2371
2600
  }
2372
2601
 
2373
2602
  blkarg_mark: tAMPER2 | tAMPER
2374
2603
 
2375
2604
  f_block_arg: blkarg_mark tIDENTIFIER
2376
2605
  {
2377
- identifier = val[1].to_sym
2606
+ _, (id, line) = val
2607
+ identifier = id.to_sym
2378
2608
 
2379
2609
  self.env[identifier] = :lvar
2380
- result = "&#{identifier}".to_sym
2610
+ result = ["&#{identifier}".to_sym, line]
2381
2611
  }
2382
2612
 
2383
2613
  opt_f_block_arg: tCOMMA f_block_arg
2384
2614
  {
2385
- result = val[1]
2615
+ _, arg = val
2616
+ result = arg
2386
2617
  }
2387
2618
  |
2388
2619
  {
@@ -2401,14 +2632,11 @@ keyword_variable: kNIL { result = s(:nil) }
2401
2632
  result.sexp_type == :lit
2402
2633
  }
2403
2634
 
2404
- assoc_list: none # [!nil]
2635
+ assoc_list: none
2405
2636
  {
2406
- result = s(:array)
2407
- }
2408
- | assocs trailer # [!nil]
2409
- {
2410
- result = val[0]
2637
+ result = s(:array).line lexer.lineno
2411
2638
  }
2639
+ | assocs trailer
2412
2640
 
2413
2641
  assocs: assoc
2414
2642
  | assocs tCOMMA assoc
@@ -2422,22 +2650,29 @@ keyword_variable: kNIL { result = s(:nil) }
2422
2650
 
2423
2651
  assoc: arg_value tASSOC arg_value
2424
2652
  {
2425
- result = s(:array, val[0], val[2])
2653
+ v1, _, v2 = val
2654
+ result = s(:array, v1, v2).line v1.line
2426
2655
  }
2427
2656
  | tLABEL arg_value
2428
2657
  {
2429
- (label, _), arg = val
2430
- result = s(:array, s(:lit, label.to_sym), arg)
2658
+ label, arg = val
2659
+
2660
+ lit = wrap :lit, label
2661
+ result = s(:array, lit, arg).line lit.line
2431
2662
  }
2432
2663
  | tSTRING_BEG string_contents tLABEL_END arg_value
2433
2664
  {
2434
- _, sym, _, value = val
2665
+ (_, line), sym, _, value = val
2666
+
2435
2667
  sym.sexp_type = :dsym
2436
- result = s(:array, sym, value)
2668
+
2669
+ result = s(:array, sym, value).line line
2437
2670
  }
2438
2671
  | tDSTAR arg_value
2439
2672
  {
2440
- result = s(:array, s(:kwsplat, val[1]))
2673
+ _, arg = val
2674
+ line = arg.line
2675
+ result = s(:array, s(:kwsplat, arg).line(line)).line line
2441
2676
  }
2442
2677
 
2443
2678
  operation: tIDENTIFIER | tCONSTANT | tFID