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
@@ -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
  {
@@ -274,30 +286,39 @@ rule
274
286
  }
275
287
  | command_call kRESCUE_MOD stmt
276
288
  {
277
- expr, _, resbody = val
289
+ expr, (_, line), resbody = val
290
+
278
291
  expr = value_expr expr
279
- result = new_rescue(expr, new_resbody(s(:array), resbody))
292
+ ary = s(:array).line line
293
+ result = new_rescue(expr, new_resbody(ary, resbody))
280
294
  }
281
295
  | command_asgn
282
296
 
283
297
  expr: command_call
284
298
  | expr kAND expr
285
299
  {
286
- result = logical_op :and, val[0], val[2]
300
+ lhs, _, rhs = val
301
+ result = logical_op :and, lhs, rhs
287
302
  }
288
303
  | expr kOR expr
289
304
  {
290
- result = logical_op :or, val[0], val[2]
305
+ lhs, _, rhs = val
306
+ result = logical_op :or, lhs, rhs
291
307
  }
292
308
  | kNOT opt_nl expr
293
309
  {
294
- result = s(:call, val[2], :"!")
310
+ (_, line), _, expr = val
311
+ result = new_call(expr, :"!").line line
312
+ # REFACTOR: call_uni_op
295
313
  }
296
314
  | tBANG command_call
297
315
  {
298
- result = s(:call, val[1], :"!")
316
+ _, cmd = val
317
+ result = new_call(cmd, :"!").line cmd.line
318
+ # TODO: fix line number to tBANG... but causes BAD shift/reduce conflict
319
+ # REFACTOR: call_uni_op -- see parse26.y
299
320
  }
300
- | arg
321
+ | arg =tLBRACE_ARG
301
322
 
302
323
  expr_value: expr
303
324
  {
@@ -322,7 +343,8 @@ rule
322
343
  block_command: block_call
323
344
  | block_call call_op2 operation2 command_args
324
345
  {
325
- result = new_call val[0], val[2].to_sym, val[3]
346
+ blk, _, (msg, _line), args = val
347
+ result = new_call(blk, msg.to_sym, args).line blk.line
326
348
  }
327
349
 
328
350
  cmd_brace_block: tLBRACE_ARG
@@ -335,37 +357,45 @@ rule
335
357
  _, line, body, _ = val
336
358
 
337
359
  result = body
338
- result.line = line
360
+ result.line line
339
361
 
340
362
  # self.env.unextend
341
363
  }
342
364
 
343
365
  fcall: operation
344
366
  {
345
- result = new_call nil, val[0].to_sym
367
+ (msg, line), = val
368
+ result = new_call(nil, msg.to_sym).line line
346
369
  }
347
370
 
348
371
  command: fcall command_args =tLOWEST
349
372
  {
350
- result = val[0].concat val[1].sexp_body # REFACTOR pattern
373
+ call, args = val
374
+ result = call.concat args.sexp_body
351
375
  }
352
376
  | fcall command_args cmd_brace_block
353
377
  {
354
- result = val[0].concat val[1].sexp_body
355
- if val[2] then
356
- block_dup_check result, val[2]
378
+ call, args, block = val
379
+
380
+ result = call.concat args.sexp_body
381
+
382
+ if block then
383
+ block_dup_check result, block
357
384
 
358
- result, operation = val[2], result
385
+ result, operation = block, result
359
386
  result.insert 1, operation
360
387
  end
361
388
  }
362
389
  | primary_value call_op operation2 command_args =tLOWEST
363
390
  {
364
- result = new_call val[0], val[2].to_sym, val[3], val[1]
391
+ lhs, callop, (op, _), args = val
392
+
393
+ result = new_call lhs, op.to_sym, args, callop
394
+ result.line lhs.line
365
395
  }
366
396
  | primary_value call_op operation2 command_args cmd_brace_block
367
397
  {
368
- recv, _, msg, args, block = val
398
+ recv, _, (msg, _line), args, block = val
369
399
  call = new_call recv, msg.to_sym, args, val[1]
370
400
 
371
401
  block_dup_check call, block
@@ -375,11 +405,14 @@ rule
375
405
  }
376
406
  | primary_value tCOLON2 operation2 command_args =tLOWEST
377
407
  {
378
- result = new_call val[0], val[2].to_sym, val[3]
408
+ lhs, _, (id, line), args = val
409
+
410
+ result = new_call lhs, id.to_sym, args
411
+ result.line line
379
412
  }
380
413
  | primary_value tCOLON2 operation2 command_args cmd_brace_block
381
414
  {
382
- recv, _, msg, args, block = val
415
+ recv, _, (msg, _line), args, block = val
383
416
  call = new_call recv, msg.to_sym, args
384
417
 
385
418
  block_dup_check call, block
@@ -393,7 +426,9 @@ rule
393
426
  }
394
427
  | kYIELD command_args
395
428
  {
396
- result = new_yield val[1]
429
+ (_, line), args = val
430
+ result = new_yield args
431
+ result.line line # TODO: push to new_yield
397
432
  }
398
433
  | k_return call_args
399
434
  {
@@ -402,8 +437,8 @@ rule
402
437
  }
403
438
  | kBREAK call_args
404
439
  {
405
- line = val[0].last
406
- result = s(:break, ret_args(val[1])).line(line)
440
+ (_, line), args = val
441
+ result = s(:break, ret_args(args)).line line
407
442
  }
408
443
  | kNEXT call_args
409
444
  {
@@ -420,56 +455,79 @@ rule
420
455
  mlhs_inner: mlhs_basic
421
456
  | tLPAREN mlhs_inner rparen
422
457
  {
423
- result = s(:masgn, s(:array, val[1]))
458
+ _, arg, _ = val
459
+ l = arg.line
460
+
461
+ result = s(:masgn, s(:array, arg).line(l)).line l
424
462
  }
425
463
 
426
464
  mlhs_basic: mlhs_head
427
465
  {
428
- result = s(:masgn, val[0])
466
+ head, = val
467
+ result = s(:masgn, head).line head.line
429
468
  }
430
469
  | mlhs_head mlhs_item
431
470
  {
432
- result = s(:masgn, val[0] << val[1].compact)
471
+ lhs, rhs = val
472
+ result = s(:masgn, lhs << rhs.compact).line lhs.line
433
473
  }
434
474
  | mlhs_head tSTAR mlhs_node
435
475
  {
436
- result = s(:masgn, val[0] << s(:splat, val[2]))
476
+ head, _, tail = val
477
+ head << s(:splat, tail).line(tail.line)
478
+ result = s(:masgn, head).line head.line
437
479
  }
438
480
  | mlhs_head tSTAR mlhs_node tCOMMA mlhs_post
439
481
  {
440
482
  ary1, _, splat, _, ary2 = val
441
483
 
442
- result = list_append ary1, s(:splat, splat)
484
+ result = list_append ary1, s(:splat, splat).line(splat.line)
443
485
  result.concat ary2.sexp_body
444
- result = s(:masgn, result)
486
+ result = s(:masgn, result).line result.line
445
487
  }
446
488
  | mlhs_head tSTAR
447
489
  {
448
- result = s(:masgn, val[0] << s(:splat))
490
+ head, _ = val
491
+ l = head.line
492
+ result = s(:masgn, head << s(:splat).line(l)).line l
449
493
  }
450
494
  | mlhs_head tSTAR tCOMMA mlhs_post
451
495
  {
452
- ary = list_append val[0], s(:splat)
453
- ary.concat val[3].sexp_body
454
- result = s(:masgn, ary)
496
+ head, _, _, post = val
497
+ ary = list_append head, s(:splat).line(head.line)
498
+ ary.concat post.sexp_body
499
+ result = s(:masgn, ary).line ary.line
455
500
  }
456
501
  | tSTAR mlhs_node
457
502
  {
458
- result = s(:masgn, s(:array, s(:splat, val[1])))
503
+ _, node = val
504
+ l = node.line
505
+ splat = s(:splat, node).line l
506
+ ary = s(:array, splat).line l
507
+ result = s(:masgn, ary).line l
459
508
  }
460
509
  | tSTAR mlhs_node tCOMMA mlhs_post
461
510
  {
462
- ary = s(:array, s(:splat, val[1]))
463
- ary.concat val[3].sexp_body
464
- result = s(:masgn, ary)
511
+ _, node, _, post = val
512
+
513
+ splat = s(:splat, node).line node.line
514
+ ary = s(:array, splat).line splat.line
515
+ ary.concat post.sexp_body
516
+ result = s(:masgn, ary).line ary.line
465
517
  }
466
518
  | tSTAR
467
519
  {
468
- result = s(:masgn, s(:array, s(:splat)))
520
+ l = lexer.lineno
521
+ result = s(:masgn, s(:array, s(:splat).line(l)).line(l)).line l
469
522
  }
470
523
  | tSTAR tCOMMA mlhs_post
471
524
  {
472
- result = s(:masgn, s(:array, s(:splat), *val[2].sexp_body))
525
+ _, _, post = val
526
+ l = post.line
527
+
528
+ splat = s(:splat).line l
529
+ ary = s(:array, splat, *post.sexp_body).line l
530
+ result = s(:masgn, ary).line l
473
531
  }
474
532
 
475
533
  mlhs_item: mlhs_node
@@ -480,7 +538,8 @@ rule
480
538
 
481
539
  mlhs_head: mlhs_item tCOMMA
482
540
  {
483
- result = s(:array, val[0])
541
+ lhs, _ = val
542
+ result = s(:array, lhs).line lhs.line
484
543
  }
485
544
  | mlhs_head mlhs_item tCOMMA
486
545
  {
@@ -489,7 +548,8 @@ rule
489
548
 
490
549
  mlhs_post: mlhs_item
491
550
  {
492
- result = s(:array, val[0])
551
+ item, = val
552
+ result = s(:array, item).line item.line
493
553
  }
494
554
  | mlhs_post tCOMMA mlhs_item
495
555
  {
@@ -510,81 +570,111 @@ rule
510
570
  }
511
571
  | primary_value call_op tIDENTIFIER
512
572
  {
513
- result = new_attrasgn val[0], val[2], val[1]
573
+ lhs, call_op, (id, _line) = val
574
+
575
+ result = new_attrasgn lhs, id, call_op
514
576
  }
515
577
  | primary_value tCOLON2 tIDENTIFIER
516
578
  {
517
- result = s(:attrasgn, val[0], :"#{val[2]}=")
579
+ recv, _, (id, _line) = val
580
+ result = new_attrasgn recv, id
518
581
  }
519
582
  | primary_value call_op tCONSTANT
520
583
  {
521
- result = new_attrasgn val[0], val[2], val[1]
584
+ lhs, call_op, (id, _line) = val
585
+
586
+ result = new_attrasgn lhs, id, call_op
522
587
  }
523
588
  | primary_value tCOLON2 tCONSTANT
524
589
  {
525
590
  if (self.in_def || self.in_single > 0) then
526
- debug20 7
591
+ debug 14
527
592
  yyerror "dynamic constant assignment"
528
593
  end
529
594
 
530
- result = s(:const, s(:colon2, val[0], val[2].to_sym), nil)
595
+ expr, _, (id, _line) = val
596
+ l = expr.line
597
+
598
+ result = s(:const, s(:colon2, expr, id.to_sym).line(l), nil).line l
531
599
  }
532
600
  | tCOLON3 tCONSTANT
533
601
  {
534
602
  if (self.in_def || self.in_single > 0) then
535
- debug20 8
603
+ debug 15
536
604
  yyerror "dynamic constant assignment"
537
605
  end
538
606
 
539
- result = s(:const, nil, s(:colon3, val[1].to_sym))
607
+ _, (id, l) = val
608
+
609
+ result = s(:const, nil, s(:colon3, id.to_sym).line(l)).line l
540
610
  }
541
611
  | backref
542
612
  {
543
- self.backref_assign_error val[0]
613
+ ref, = val
614
+
615
+ self.backref_assign_error ref
544
616
  }
545
617
 
546
618
  lhs: user_variable
547
619
  {
548
- result = self.assignable val[0]
620
+ var, = val
621
+
622
+ result = self.assignable var
549
623
  }
550
624
  | keyword_variable
551
625
  {
552
- result = self.assignable val[0]
553
- debug20 9, val, result
626
+ var, = val
627
+
628
+ result = self.assignable var
629
+
630
+ debug 16
554
631
  }
555
632
  | primary_value tLBRACK2 opt_call_args rbracket
556
633
  {
557
- result = self.aryset val[0], val[2]
634
+ lhs, _, args, _ = val
635
+
636
+ result = self.aryset lhs, args
558
637
  }
559
638
  | primary_value call_op tIDENTIFIER # REFACTOR
560
639
  {
561
- result = new_attrasgn val[0], val[2], val[1]
640
+ lhs, op, (id, _line) = val
641
+
642
+ result = new_attrasgn lhs, id, op
562
643
  }
563
644
  | primary_value tCOLON2 tIDENTIFIER
564
645
  {
565
- result = s(:attrasgn, val[0], :"#{val[2]}=")
646
+ lhs, _, (id, _line) = val
647
+
648
+ result = new_attrasgn lhs, id
566
649
  }
567
650
  | primary_value call_op tCONSTANT # REFACTOR?
568
651
  {
569
- result = new_attrasgn val[0], val[2], val[1]
652
+ lhs, call_op, (id, _line) = val
653
+
654
+ result = new_attrasgn lhs, id, call_op
570
655
  }
571
656
  | primary_value tCOLON2 tCONSTANT
572
657
  {
658
+ expr, _, (id, _line) = val
659
+
573
660
  if (self.in_def || self.in_single > 0) then
574
- debug20 10
661
+ debug 17
575
662
  yyerror "dynamic constant assignment"
576
663
  end
577
664
 
578
- result = s(:const, s(:colon2, val[0], val[2].to_sym))
665
+ l = expr.line
666
+ result = s(:const, s(:colon2, expr, id.to_sym).line(l)).line l
579
667
  }
580
668
  | tCOLON3 tCONSTANT
581
669
  {
670
+ _, (id, l) = val
671
+
582
672
  if (self.in_def || self.in_single > 0) then
583
- debug20 11
673
+ debug 18
584
674
  yyerror "dynamic constant assignment"
585
675
  end
586
676
 
587
- result = s(:const, s(:colon3, val[1].to_sym))
677
+ result = s(:const, s(:colon3, id.to_sym).line(l)).line l
588
678
  }
589
679
  | backref
590
680
  {
@@ -599,38 +689,34 @@ rule
599
689
 
600
690
  cpath: tCOLON3 cname
601
691
  {
602
- result = s(:colon3, val[1].to_sym)
692
+ result = wrap :colon3, val[1]
603
693
  }
604
694
  | cname
605
695
  {
606
- result = val[0].to_sym
696
+ (id, line), = val
697
+ result = [id.to_sym, line] # TODO: sexp?
607
698
  }
608
699
  | primary_value tCOLON2 cname
609
700
  {
610
- result = s(:colon2, val[0], val[2].to_sym)
701
+ pval, _, (name, _line) = val
702
+
703
+ result = s(:colon2, pval, name.to_sym)
704
+ result.line pval.line
611
705
  }
612
706
 
613
707
  fname: tIDENTIFIER | tCONSTANT | tFID
614
708
  | op
615
709
  {
616
710
  lexer.lex_state = EXPR_END
617
- result = val[0]
618
711
  }
619
712
 
620
713
  | reswords
621
- {
622
- (sym, _line), = val
623
- lexer.lex_state = EXPR_END
624
- result = sym
625
- }
626
714
 
627
- fsym: fname | symbol
628
-
629
- fitem: fsym
715
+ fitem: fname
630
716
  {
631
- result = s(:lit, val[0].to_sym)
717
+ result = wrap :lit, val[0]
632
718
  }
633
- | dsym
719
+ | symbol
634
720
 
635
721
  undef_list: fitem
636
722
  {
@@ -651,7 +737,6 @@ rule
651
737
  | tNEQ | tLSHFT | tRSHFT | tPLUS | tMINUS | tSTAR2
652
738
  | tSTAR | tDIVIDE | tPERCENT | tPOW | tDSTAR | tBANG | tTILDE
653
739
  | tUPLUS | tUMINUS | tAREF | tASET | tBACK_REF2
654
- | tUBANG
655
740
 
656
741
  reswords: k__LINE__ | k__FILE__ | k__ENCODING__ | klBEGIN | klEND
657
742
  | kALIAS | kAND | kBEGIN | kBREAK | kCASE
@@ -673,8 +758,7 @@ rule
673
758
  }
674
759
  | primary_value tLBRACK2 opt_call_args rbracket tOP_ASGN arg_rhs
675
760
  {
676
- val[2].sexp_type = :arglist if val[2]
677
- result = s(:op_asgn1, val[0], val[2], val[4].to_sym, val[5])
761
+ result = new_op_asgn1 val
678
762
  }
679
763
  | primary_value call_op tIDENTIFIER tOP_ASGN arg_rhs
680
764
  {
@@ -686,24 +770,22 @@ rule
686
770
  }
687
771
  | primary_value tCOLON2 tIDENTIFIER tOP_ASGN arg_rhs
688
772
  {
689
- result = s(:op_asgn, val[0], val[4], val[2].to_sym, val[3].to_sym)
773
+ lhs, _, (id, _line), (op, _), rhs = val
774
+
775
+ result = s(:op_asgn, lhs, rhs, id.to_sym, op.to_sym).line lhs.line
690
776
  }
691
777
  | primary_value tCOLON2 tCONSTANT tOP_ASGN arg_rhs
692
778
  {
693
- lhs1, _, lhs2, op, rhs = val
779
+ lhs1, _, (lhs2, _line), op, rhs = val
694
780
 
695
781
  lhs = s(:colon2, lhs1, lhs2.to_sym).line lhs1.line
696
782
  result = new_const_op_asgn [lhs, op, rhs]
697
783
  }
698
- | tCOLON3 tCONSTANT
784
+ | tCOLON3 tCONSTANT tOP_ASGN arg_rhs
699
785
  {
700
- result = self.lexer.lineno
701
- }
702
- tOP_ASGN arg_rhs
703
- {
704
- _, lhs, line, op, rhs = val
786
+ _, lhs, op, rhs = val
705
787
 
706
- lhs = s(:colon3, lhs.to_sym).line line
788
+ lhs = wrap :colon3, lhs
707
789
  result = new_const_op_asgn [lhs, op, rhs]
708
790
  }
709
791
  | backref tOP_ASGN arg_rhs
@@ -715,21 +797,23 @@ rule
715
797
  | arg tDOT2 arg
716
798
  {
717
799
  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))
800
+ if v1.sexp_type == :lit and v2.sexp_type == :lit and Integer === v1.last and Integer === v2.last then
801
+ result = s(:lit, (v1.last)..(v2.last)).line v1.line
720
802
  else
721
- result = s(:dot2, v1, v2)
803
+ result = s(:dot2, v1, v2).line v1.line
722
804
  end
723
805
  }
724
806
  | arg tDOT3 arg
725
807
  {
726
808
  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))
809
+ if v1.sexp_type == :lit and v2.sexp_type == :lit and Integer === v1.last and Integer === v2.last then
810
+ result = s(:lit, (v1.last)...(v2.last)).line v1.line
729
811
  else
730
- result = s(:dot3, v1, v2)
812
+ result = s(:dot3, v1, v2).line v1.line
731
813
  end
732
814
  }
815
+
816
+
733
817
  | arg tPLUS arg
734
818
  {
735
819
  result = new_call val[0], :+, argl(val[2])
@@ -756,7 +840,10 @@ rule
756
840
  }
757
841
  | tUMINUS_NUM simple_numeric tPOW arg
758
842
  {
759
- result = new_call(new_call(s(:lit, val[1]), :"**", argl(val[3])), :"-@")
843
+ _, (num, line), _, arg = val
844
+ lit = s(:lit, num).line line
845
+ result = new_call(new_call(lit, :"**", argl(arg)), :"-@")
846
+
760
847
  }
761
848
  | tUPLUS arg
762
849
  {
@@ -797,15 +884,19 @@ rule
797
884
  }
798
885
  | arg tMATCH arg
799
886
  {
800
- result = new_match val[0], val[2]
887
+ lhs, _, rhs = val
888
+ result = new_match lhs, rhs
801
889
  }
802
890
  | arg tNMATCH arg
803
891
  {
804
- result = s(:not, new_match(val[0], val[2]))
892
+ lhs, _, rhs = val
893
+ result = s(:not, new_match(lhs, rhs)).line lhs.line
805
894
  }
806
895
  | tBANG arg
807
896
  {
808
- result = new_call val[1], :"!"
897
+ _, arg = val
898
+ result = new_call arg, :"!"
899
+ result.line arg.line
809
900
  }
810
901
  | tTILDE arg
811
902
  {
@@ -833,11 +924,13 @@ rule
833
924
  }
834
925
  | kDEFINED opt_nl arg
835
926
  {
836
- result = s(:defined, val[2])
927
+ (_, line), _, arg = val
928
+ result = s(:defined, arg).line line
837
929
  }
838
930
  | arg tEH arg opt_nl tCOLON arg
839
931
  {
840
- result = s(:if, val[0], val[2], val[5])
932
+ c, _, t, _, _, f = val
933
+ result = s(:if, c, t, f).line c.line
841
934
  }
842
935
  | primary
843
936
 
@@ -848,12 +941,12 @@ rule
848
941
 
849
942
  rel_expr: arg relop arg =tGT
850
943
  {
851
- lhs, op, rhs = val
944
+ lhs, (op, _), rhs = val
852
945
  result = new_call lhs, op.to_sym, argl(rhs)
853
946
  }
854
947
  | rel_expr relop arg =tGT
855
948
  {
856
- lhs, op, rhs = val
949
+ lhs, (op, _), rhs = val
857
950
  warn "comparison '%s' after comparison", op
858
951
  result = new_call lhs, op.to_sym, argl(rhs)
859
952
  }
@@ -880,28 +973,25 @@ rule
880
973
  arg_rhs: arg =tOP_ASGN
881
974
  | arg kRESCUE_MOD arg
882
975
  {
883
- body, _, resbody = val
976
+ body, (_, line), resbody = val
884
977
  body = value_expr body
885
978
  resbody = remove_begin resbody
886
- result = new_rescue(body, new_resbody(s(:array), resbody))
979
+
980
+ ary = s(:array).line line
981
+ result = new_rescue(body, new_resbody(ary, resbody))
887
982
  }
888
983
 
889
984
  paren_args: tLPAREN2 opt_call_args rparen
890
985
  {
891
- result = val[1]
986
+ _, args, _ = val
987
+ result = args
892
988
  }
893
989
 
894
990
  opt_paren_args: none
895
991
  | paren_args
896
992
 
897
993
  opt_call_args: none
898
- {
899
- result = val[0]
900
- }
901
994
  | call_args
902
- {
903
- result = val[0]
904
- }
905
995
  | args tCOMMA
906
996
  {
907
997
  result = args val
@@ -923,17 +1013,14 @@ rule
923
1013
  | args opt_block_arg
924
1014
  {
925
1015
  result = call_args val
926
- result = self.arg_blk_pass val[0], val[1]
927
1016
  }
928
1017
  | assocs opt_block_arg
929
1018
  {
930
- result = call_args [array_to_hash(val[0])]
931
- result = self.arg_blk_pass result, val[1]
1019
+ result = call_args [array_to_hash(val[0]), val[1]]
932
1020
  }
933
1021
  | args tCOMMA assocs opt_block_arg
934
1022
  {
935
- result = call_args [val[0], array_to_hash(val[2])]
936
- result = self.arg_blk_pass result, val[3]
1023
+ result = call_args [val[0], array_to_hash(val[2]), val[3]]
937
1024
  }
938
1025
  | block_arg
939
1026
  {
@@ -941,17 +1028,45 @@ rule
941
1028
  }
942
1029
 
943
1030
  command_args: {
944
- result = lexer.cmdarg.store true
1031
+ # parse26.y line 2200
1032
+
1033
+ # If call_args starts with a open paren '(' or
1034
+ # '[', look-ahead reading of the letters calls
1035
+ # CMDARG_PUSH(0), but the push must be done
1036
+ # after CMDARG_PUSH(1). So this code makes them
1037
+ # consistent by first cancelling the premature
1038
+ # CMDARG_PUSH(0), doing CMDARG_PUSH(1), and
1039
+ # finally redoing CMDARG_PUSH(0).
1040
+
1041
+ result = yychar = self.last_token_type.first
1042
+ lookahead = [:tLPAREN, :tLPAREN_ARG, :tLPAREN2, :tLBRACK, :tLBRACK2].include?(yychar)
1043
+ lexer.cmdarg.pop if lookahead
1044
+ lexer.cmdarg.push true
1045
+ lexer.cmdarg.push false if lookahead
945
1046
  }
946
1047
  call_args
947
1048
  {
948
- lexer.cmdarg.restore val[0]
949
- result = val[1]
1049
+ yychar, args = val
1050
+
1051
+ # call_args can be followed by tLBRACE_ARG (that
1052
+ # does CMDARG_PUSH(0) in the lexer) but the push
1053
+ # must be done after CMDARG_POP() in the parser.
1054
+ # So this code does CMDARG_POP() to pop 0 pushed
1055
+ # by tLBRACE_ARG, CMDARG_POP() to pop 1 pushed
1056
+ # by command_args, and CMDARG_PUSH(0) to restore
1057
+ # back the flag set by tLBRACE_ARG.
1058
+
1059
+ lookahead = [:tLBRACE_ARG].include?(yychar)
1060
+ lexer.cmdarg.pop if lookahead
1061
+ lexer.cmdarg.pop
1062
+ lexer.cmdarg.push false if lookahead
1063
+ result = args
950
1064
  }
951
1065
 
952
1066
  block_arg: tAMPER arg_value
953
1067
  {
954
- result = s(:block_pass, val[1])
1068
+ _, arg = val
1069
+ result = s(:block_pass, arg).line arg.line
955
1070
  }
956
1071
 
957
1072
  opt_block_arg: tCOMMA block_arg
@@ -962,19 +1077,27 @@ rule
962
1077
 
963
1078
  args: arg_value
964
1079
  {
965
- result = s(:array, val[0])
1080
+ arg, = val
1081
+ lineno = arg.line || lexer.lineno # HACK
1082
+
1083
+ result = s(:array, arg).line lineno
966
1084
  }
967
1085
  | tSTAR arg_value
968
1086
  {
969
- result = s(:array, s(:splat, val[1]))
1087
+ _, arg = val
1088
+ result = s(:array, s(:splat, arg).line(arg.line)).line arg.line
970
1089
  }
971
1090
  | args tCOMMA arg_value
972
1091
  {
973
- result = self.list_append val[0], val[2]
1092
+ args, _, id = val
1093
+ result = self.list_append args, id
974
1094
  }
975
1095
  | args tCOMMA tSTAR arg_value
976
1096
  {
977
- result = self.list_append val[0], s(:splat, val[3])
1097
+ # TODO: the line number from tSTAR has been dropped
1098
+ args, _, _, id = val
1099
+ line = lexer.lineno
1100
+ result = self.list_append args, s(:splat, id).line(line)
978
1101
  }
979
1102
 
980
1103
  mrhs_arg: mrhs
@@ -992,11 +1115,14 @@ rule
992
1115
  }
993
1116
  | args tCOMMA tSTAR arg_value
994
1117
  {
995
- result = self.arg_concat val[0], val[3]
1118
+ # TODO: make all tXXXX terminals include lexer.lineno
1119
+ arg, _, _, splat = val
1120
+ result = self.arg_concat arg, splat
996
1121
  }
997
1122
  | tSTAR arg_value
998
1123
  {
999
- result = s(:splat, val[1])
1124
+ _, arg = val
1125
+ result = s(:splat, arg).line arg.line
1000
1126
  }
1001
1127
 
1002
1128
  primary: literal
@@ -1011,65 +1137,64 @@ rule
1011
1137
  | backref
1012
1138
  | tFID
1013
1139
  {
1014
- result = new_call nil, val[0].to_sym
1140
+ (msg, line), = val
1141
+ result = new_call nil, msg.to_sym
1142
+ result.line line
1015
1143
  }
1016
1144
  | k_begin
1017
1145
  {
1146
+ lexer.cmdarg.push false
1018
1147
  result = self.lexer.lineno
1019
- # TODO:
1020
- # $<val>1 = cmdarg_stack;
1021
- # CMDARG_SET(0);
1022
1148
  }
1023
1149
  bodystmt k_end
1024
1150
  {
1025
- # TODO: CMDARG_SET($<val>1);
1026
- unless val[2] then
1027
- result = s(:nil)
1028
- else
1029
- result = s(:begin, val[2])
1030
- end
1031
-
1032
- result.line = val[1]
1151
+ lexer.cmdarg.pop
1152
+ result = new_begin val
1033
1153
  }
1034
- | tLPAREN_ARG rparen
1154
+ | tLPAREN_ARG
1035
1155
  {
1036
- # TODO: lex_state = EXPR_ENDARG in between
1037
- debug20 13, val, result
1156
+ lexer.lex_state = EXPR_ENDARG
1157
+ result = lexer.lineno
1038
1158
  }
1039
- | tLPAREN_ARG
1159
+ rparen
1040
1160
  {
1041
- result = lexer.cmdarg.store false
1042
- # result = self.lexer.cmdarg.stack.dup
1043
- # lexer.cmdarg.stack.replace [false] # TODO add api for these
1161
+ _, line, _ = val
1162
+ result = s(:begin).line line
1044
1163
  }
1164
+ | tLPAREN_ARG
1045
1165
  stmt
1046
1166
  {
1047
1167
  lexer.lex_state = EXPR_ENDARG
1048
1168
  }
1049
1169
  rparen
1050
1170
  {
1051
- _, cmdarg, stmt, _, _, = val
1052
- warning "(...) interpreted as grouped expression"
1053
- lexer.cmdarg.restore cmdarg
1171
+ _, stmt, _, _, = val
1172
+ # warning "(...) interpreted as grouped expression"
1054
1173
  result = stmt
1055
1174
  }
1056
1175
  | tLPAREN compstmt tRPAREN
1057
1176
  {
1058
- result = val[1] || s(:nil)
1177
+ _, stmt, _ = val
1178
+ result = stmt
1179
+ result ||= s(:nil).line lexer.lineno
1059
1180
  result.paren = true
1060
1181
  }
1061
1182
  | primary_value tCOLON2 tCONSTANT
1062
1183
  {
1063
- result = s(:colon2, val[0], val[2].to_sym)
1184
+ expr, _, (id, _line) = val
1185
+
1186
+ result = s(:colon2, expr, id.to_sym).line expr.line
1064
1187
  }
1065
1188
  | tCOLON3 tCONSTANT
1066
1189
  {
1067
- result = s(:colon3, val[1].to_sym)
1190
+ result = wrap :colon3, val[1]
1068
1191
  }
1069
- | tLBRACK aref_args tRBRACK
1192
+ | tLBRACK { result = lexer.lineno } aref_args tRBRACK
1070
1193
  {
1071
- result = val[1] || s(:array)
1194
+ _, line, args, _ = val
1195
+ result = args || s(:array)
1072
1196
  result.sexp_type = :array # aref_args is :args
1197
+ result.line line
1073
1198
  }
1074
1199
  | tLBRACE
1075
1200
  {
@@ -1081,39 +1206,49 @@ rule
1081
1206
  }
1082
1207
  | k_return
1083
1208
  {
1084
- result = s(:return)
1209
+ (_, line), = val
1210
+ result = s(:return).line line
1085
1211
  }
1086
1212
  | kYIELD tLPAREN2 call_args rparen
1087
1213
  {
1088
- result = new_yield val[2]
1214
+ (_, line), _, args, _ = val
1215
+
1216
+ result = new_yield(args).line line
1089
1217
  }
1090
1218
  | kYIELD tLPAREN2 rparen
1091
1219
  {
1092
- result = new_yield
1220
+ (_, line), _, _ = val
1221
+
1222
+ result = new_yield.line line
1093
1223
  }
1094
1224
  | kYIELD
1095
1225
  {
1096
- result = new_yield
1226
+ (_, line), = val
1227
+
1228
+ result = new_yield.line line
1097
1229
  }
1098
1230
  | kDEFINED opt_nl tLPAREN2 expr rparen
1099
1231
  {
1100
- result = s(:defined, val[3])
1232
+ (_, line), _, _, arg, _ = val
1233
+
1234
+ result = s(:defined, arg).line line
1101
1235
  }
1102
1236
  | kNOT tLPAREN2 expr rparen
1103
1237
  {
1104
- result = s(:call, val[2], :"!")
1238
+ _, _, lhs, _ = val
1239
+ result = new_call lhs, :"!"
1105
1240
  }
1106
1241
  | kNOT tLPAREN2 rparen
1107
1242
  {
1108
- debug20 14, val, result
1243
+ debug 20
1109
1244
  }
1110
1245
  | fcall brace_block
1111
1246
  {
1112
- oper, iter = val[0], val[1]
1113
- call = oper # FIX
1247
+ call, iter = val
1248
+
1114
1249
  iter.insert 1, call
1115
1250
  result = iter
1116
- call.line = iter.line
1251
+ # FIX: probably not: call.line = iter.line
1117
1252
  }
1118
1253
  | method_call
1119
1254
  | method_call brace_block
@@ -1123,9 +1258,10 @@ rule
1123
1258
  iter.insert 1, call # FIX
1124
1259
  result = iter
1125
1260
  }
1126
- | tLAMBDA lambda
1261
+ | lambda
1127
1262
  {
1128
- result = val[1] # TODO: fix lineno
1263
+ expr, = val
1264
+ result = expr
1129
1265
  }
1130
1266
  | k_if expr_value then compstmt if_tail k_end
1131
1267
  {
@@ -1168,7 +1304,6 @@ rule
1168
1304
  }
1169
1305
  cpath superclass
1170
1306
  {
1171
- self.comments.push self.lexer.comments
1172
1307
  if (self.in_def || self.in_single > 0) then
1173
1308
  yyerror "class definition in method body"
1174
1309
  end
@@ -1178,7 +1313,7 @@ rule
1178
1313
  {
1179
1314
  result = new_class val
1180
1315
  self.env.unextend
1181
- self.lexer.comments # we don't care about comments in the body
1316
+ self.lexer.ignore_body_comments
1182
1317
  }
1183
1318
  | k_class tLSHFT
1184
1319
  {
@@ -1199,7 +1334,7 @@ rule
1199
1334
  {
1200
1335
  result = new_sclass val
1201
1336
  self.env.unextend
1202
- self.lexer.comments # we don't care about comments in the body
1337
+ self.lexer.ignore_body_comments
1203
1338
  }
1204
1339
  | k_module
1205
1340
  {
@@ -1207,7 +1342,6 @@ rule
1207
1342
  }
1208
1343
  cpath
1209
1344
  {
1210
- self.comments.push self.lexer.comments
1211
1345
  yyerror "module definition in method body" if
1212
1346
  self.in_def or self.in_single > 0
1213
1347
 
@@ -1217,70 +1351,87 @@ rule
1217
1351
  {
1218
1352
  result = new_module val
1219
1353
  self.env.unextend
1220
- self.lexer.comments # we don't care about comments in the body
1354
+ self.lexer.ignore_body_comments
1221
1355
  }
1222
1356
  | k_def fname
1223
1357
  {
1224
- result = [self.in_def, self.lexer.cmdarg.stack.dup]
1358
+ result = self.in_def
1225
1359
 
1226
- self.comments.push self.lexer.comments
1227
- self.in_def = true
1360
+ self.in_def = true # group = local_push
1228
1361
  self.env.extend
1229
- # TODO: local->cmdargs = cmdarg_stack;
1230
- # TODO: port local_push_gen and local_pop_gen
1231
- lexer.cmdarg.stack.replace [false]
1362
+ lexer.cmdarg.push false
1363
+ lexer.cond.push false
1232
1364
  }
1233
1365
  f_arglist bodystmt k_end
1234
1366
  {
1235
- in_def, cmdarg = val[2]
1367
+ result, in_def = new_defn val
1236
1368
 
1237
- result = new_defn val
1238
-
1239
- lexer.cmdarg.stack.replace cmdarg
1369
+ lexer.cond.pop # group = local_pop
1370
+ lexer.cmdarg.pop
1240
1371
  self.env.unextend
1241
1372
  self.in_def = in_def
1242
- self.lexer.comments # we don't care about comments in the body
1373
+
1374
+ self.lexer.ignore_body_comments
1243
1375
  }
1244
1376
  | k_def singleton dot_or_colon
1245
1377
  {
1246
- self.comments.push self.lexer.comments
1247
1378
  lexer.lex_state = EXPR_FNAME
1248
1379
  }
1249
1380
  fname
1250
1381
  {
1251
- self.in_single += 1
1382
+ result = self.in_def
1383
+
1384
+ self.in_single += 1 # TODO: remove?
1385
+
1386
+ self.in_def = true # local_push
1252
1387
  self.env.extend
1253
- lexer.lex_state = EXPR_ENDFN # force for args
1254
- result = [lexer.lineno, self.lexer.cmdarg.stack.dup]
1255
- lexer.cmdarg.stack.replace [false]
1388
+ lexer.cmdarg.push false
1389
+ lexer.cond.push false
1390
+
1391
+ lexer.lex_state = EXPR_ENDFN|EXPR_LABEL
1256
1392
  }
1257
1393
  f_arglist bodystmt k_end
1258
1394
  {
1259
- line, cmdarg = val[5]
1260
- result = new_defs val
1261
- result[3].line line
1262
1395
 
1263
- lexer.cmdarg.stack.replace cmdarg
1396
+ # [kdef, recv, _, _, (name, line), in_def, args, body, kend]
1397
+ # =>
1398
+ # [kdef, recv, (name, line), in_def, args, body, kend]
1399
+
1400
+ val.delete_at 3
1401
+ val.delete_at 2
1402
+
1403
+ result, in_def = new_defs val
1264
1404
 
1405
+ lexer.cond.pop # group = local_pop
1406
+ lexer.cmdarg.pop
1265
1407
  self.env.unextend
1408
+ self.in_def = in_def
1409
+
1266
1410
  self.in_single -= 1
1267
- self.lexer.comments # we don't care about comments in the body
1411
+
1412
+ # TODO: restore cur_arg ? what's cur_arg?
1413
+
1414
+ self.lexer.ignore_body_comments
1268
1415
  }
1269
1416
  | kBREAK
1270
1417
  {
1271
- result = s(:break)
1418
+ (_, line), = val
1419
+ result = s(:break).line line
1272
1420
  }
1273
1421
  | kNEXT
1274
1422
  {
1275
- result = s(:next)
1423
+ (_, line), = val
1424
+ result = s(:next).line line
1276
1425
  }
1277
1426
  | kREDO
1278
1427
  {
1279
- result = s(:redo)
1428
+ (_, line), = val
1429
+ result = s(:redo).line line
1280
1430
  }
1281
1431
  | kRETRY
1282
1432
  {
1283
- result = s(:retry)
1433
+ (_, line), = val
1434
+ result = s(:retry).line line
1284
1435
  }
1285
1436
 
1286
1437
  primary_value: primary
@@ -1297,8 +1448,17 @@ rule
1297
1448
  k_case: kCASE
1298
1449
  k_for: kFOR
1299
1450
  k_class: kCLASS
1451
+ {
1452
+ self.comments.push self.lexer.comments
1453
+ }
1300
1454
  k_module: kMODULE
1455
+ {
1456
+ self.comments.push self.lexer.comments
1457
+ }
1301
1458
  k_def: kDEF
1459
+ {
1460
+ self.comments.push self.lexer.comments
1461
+ }
1302
1462
  k_do: kDO
1303
1463
  k_do_block: kDO_BLOCK
1304
1464
  k_rescue: kRESCUE
@@ -1319,7 +1479,9 @@ rule
1319
1479
  if_tail: opt_else
1320
1480
  | k_elsif expr_value then compstmt if_tail
1321
1481
  {
1322
- result = s(:if, val[1], val[3], val[4])
1482
+ (_, line), c, _, t, rest = val
1483
+
1484
+ result = s(:if, c, t, rest).line line
1323
1485
  }
1324
1486
 
1325
1487
  opt_else: none
@@ -1342,7 +1504,9 @@ rule
1342
1504
 
1343
1505
  f_marg_list: f_marg
1344
1506
  {
1345
- result = s(:array, val[0])
1507
+ sym, = val
1508
+
1509
+ result = s(:array, sym).line lexer.lineno
1346
1510
  }
1347
1511
  | f_marg_list tCOMMA f_marg
1348
1512
  {
@@ -1355,51 +1519,42 @@ rule
1355
1519
 
1356
1520
  result = block_var args
1357
1521
  }
1358
- | f_marg_list tCOMMA tSTAR f_norm_arg
1522
+ | f_marg_list tCOMMA f_rest_marg
1359
1523
  {
1360
- args, _, _, splat = val
1524
+ args, _, rest = val
1361
1525
 
1362
- result = block_var args, "*#{splat}".to_sym
1526
+ result = block_var args, rest
1363
1527
  }
1364
- | f_marg_list tCOMMA tSTAR f_norm_arg tCOMMA f_marg_list
1528
+ | f_marg_list tCOMMA f_rest_marg tCOMMA f_marg_list
1365
1529
  {
1366
- args, _, _, splat, _, args2 = val
1530
+ lhs, _, splat, _, rhs = val
1367
1531
 
1368
- result = block_var args, "*#{splat}".to_sym, args2
1532
+ result = block_var lhs, splat, rhs
1369
1533
  }
1370
- | f_marg_list tCOMMA tSTAR
1534
+ | f_rest_marg
1371
1535
  {
1372
- args, _, _ = val
1536
+ rest, = val
1373
1537
 
1374
- result = block_var args, :*
1538
+ result = block_var rest
1375
1539
  }
1376
- | f_marg_list tCOMMA tSTAR tCOMMA f_marg_list
1540
+ | f_rest_marg tCOMMA f_marg_list
1377
1541
  {
1378
- args, _, _, _, args2 = val
1542
+ splat, _, rest = val
1379
1543
 
1380
- result = block_var args, :*, args2
1544
+ result = block_var splat, rest
1381
1545
  }
1382
- | tSTAR f_norm_arg
1383
- {
1384
- _, splat = val
1385
1546
 
1386
- result = block_var :"*#{splat}"
1387
- }
1388
- | tSTAR f_norm_arg tCOMMA f_marg_list
1547
+ f_rest_marg: tSTAR f_norm_arg
1389
1548
  {
1390
- _, splat, _, args = val
1549
+ _, (id, line) = val
1391
1550
 
1392
- result = block_var :"*#{splat}", args
1551
+ result = args ["*#{id}".to_sym]
1552
+ result.line line
1393
1553
  }
1394
1554
  | tSTAR
1395
1555
  {
1396
- result = block_var :*
1397
- }
1398
- | tSTAR tCOMMA f_marg_list
1399
- {
1400
- _, _, args = val
1401
-
1402
- result = block_var :*, args
1556
+ result = args [:*]
1557
+ result.line lexer.lineno # FIX: tSTAR -> line
1403
1558
  }
1404
1559
 
1405
1560
  block_args_tail: f_block_kwarg tCOMMA f_kwrest opt_f_block_arg
@@ -1416,7 +1571,9 @@ rule
1416
1571
  }
1417
1572
  | f_block_arg
1418
1573
  {
1419
- result = call_args val
1574
+ (id, line), = val
1575
+ result = call_args [id]
1576
+ result.line line
1420
1577
  }
1421
1578
 
1422
1579
  opt_block_args_tail: tCOMMA block_args_tail
@@ -1447,7 +1604,7 @@ opt_block_args_tail: tCOMMA block_args_tail
1447
1604
  }
1448
1605
  | f_arg tCOMMA
1449
1606
  {
1450
- result = args val
1607
+ result = args(val) << nil
1451
1608
  }
1452
1609
  | f_arg tCOMMA f_rest_arg tCOMMA f_arg opt_block_args_tail
1453
1610
  {
@@ -1499,7 +1656,7 @@ opt_block_args_tail: tCOMMA block_args_tail
1499
1656
  }
1500
1657
  | tOROP
1501
1658
  {
1502
- result = s(:args)
1659
+ result = s(:args).line lexer.lineno
1503
1660
  }
1504
1661
  | tPIPE block_param opt_bv_decl tPIPE
1505
1662
  {
@@ -1524,34 +1681,32 @@ opt_block_args_tail: tCOMMA block_args_tail
1524
1681
 
1525
1682
  bvar: tIDENTIFIER
1526
1683
  {
1527
- result = s(:shadow, val[0].to_sym)
1684
+ result = wrap :shadow, val[0]
1528
1685
  }
1529
1686
  | f_bad_arg
1530
1687
 
1531
- lambda: {
1688
+ lambda: tLAMBDA
1689
+ {
1532
1690
  self.env.extend :dynamic
1533
- result = self.lexer.lineno
1534
-
1535
- result = lexer.lpar_beg
1691
+ result = [lexer.lineno, lexer.lpar_beg]
1536
1692
  lexer.paren_nest += 1
1537
1693
  lexer.lpar_beg = lexer.paren_nest
1538
1694
  }
1539
1695
  f_larglist
1540
1696
  {
1541
- result = [lexer.cmdarg.store(false), self.lexer.lineno]
1697
+ lexer.cmdarg.push false
1542
1698
  }
1543
1699
  lambda_body
1544
1700
  {
1545
- lpar, args, (cmdarg, lineno), body = val
1701
+ _, (line, lpar), args, _cmdarg, body = val
1546
1702
  lexer.lpar_beg = lpar
1547
1703
 
1548
- lexer.cmdarg.restore cmdarg
1549
- lexer.cmdarg.lexpop
1704
+ lexer.cmdarg.pop
1550
1705
 
1551
- call = new_call nil, :lambda
1706
+ call = s(:lambda).line line
1552
1707
  result = new_iter call, args, body
1553
- result.line = lineno
1554
- self.env.unextend
1708
+ result.line line
1709
+ self.env.unextend # TODO: dynapush & dynapop
1555
1710
  }
1556
1711
 
1557
1712
  f_larglist: tLPAREN2 f_args opt_bv_decl rparen
@@ -1575,8 +1730,8 @@ opt_block_args_tail: tCOMMA block_args_tail
1575
1730
 
1576
1731
  do_block: k_do_block do_body kEND
1577
1732
  {
1578
- # TODO: maybe fix lineno to kDO's lineno?
1579
- result = val[1]
1733
+ (_, line), iter, _ = val
1734
+ result = iter.line line
1580
1735
  }
1581
1736
 
1582
1737
  block_call: command do_block
@@ -1585,21 +1740,28 @@ opt_block_args_tail: tCOMMA block_args_tail
1585
1740
  ## if (nd_type($1) == NODE_YIELD) {
1586
1741
  ## compile_error(PARSER_ARG "block given to yield");
1587
1742
 
1743
+ cmd, blk = val
1744
+
1588
1745
  syntax_error "Both block arg and actual block given." if
1589
- val[0].block_pass?
1746
+ cmd.block_pass?
1590
1747
 
1591
- val = invert_block_call val if inverted? val
1748
+ if inverted? val then
1749
+ val = invert_block_call val
1750
+ cmd, blk = val
1751
+ end
1592
1752
 
1593
- result = val[1]
1594
- result.insert 1, val[0]
1753
+ result = blk
1754
+ result.insert 1, cmd
1595
1755
  }
1596
1756
  | block_call call_op2 operation2 opt_paren_args
1597
1757
  {
1598
- result = new_call val[0], val[2].to_sym, val[3]
1758
+ lhs, _, (id, _line), args = val
1759
+
1760
+ result = new_call lhs, id.to_sym, args
1599
1761
  }
1600
1762
  | block_call call_op2 operation2 opt_paren_args brace_block
1601
1763
  {
1602
- iter1, _, name, args, iter2 = val
1764
+ iter1, _, (name, _line), args, iter2 = val
1603
1765
 
1604
1766
  call = new_call iter1, name.to_sym, args
1605
1767
  iter2.insert 1, call
@@ -1608,7 +1770,7 @@ opt_block_args_tail: tCOMMA block_args_tail
1608
1770
  }
1609
1771
  | block_call call_op2 operation2 command_args do_block
1610
1772
  {
1611
- iter1, _, name, args, iter2 = val
1773
+ iter1, _, (name, _line), args, iter2 = val
1612
1774
 
1613
1775
  call = new_call iter1, name.to_sym, args
1614
1776
  iter2.insert 1, call
@@ -1616,26 +1778,29 @@ opt_block_args_tail: tCOMMA block_args_tail
1616
1778
  result = iter2
1617
1779
  }
1618
1780
 
1619
- method_call: fcall
1781
+ method_call: fcall paren_args
1620
1782
  {
1621
- result = self.lexer.lineno
1622
- }
1623
- paren_args
1624
- {
1625
- args = self.call_args val[2..-1]
1626
- result = val[0].concat args.sexp_body
1783
+ call, args = val
1784
+
1785
+ result = call.concat args.sexp_body if args
1627
1786
  }
1628
1787
  | primary_value call_op operation2 opt_paren_args
1629
1788
  {
1630
- result = new_call val[0], val[2].to_sym, val[3], val[1]
1789
+ recv, call_op, (op, _line), args = val
1790
+
1791
+ result = new_call recv, op.to_sym, args, call_op
1631
1792
  }
1632
1793
  | primary_value tCOLON2 operation2 paren_args
1633
1794
  {
1634
- result = new_call val[0], val[2].to_sym, val[3]
1795
+ recv, _, (op, _line), args = val
1796
+
1797
+ result = new_call recv, op.to_sym, args
1635
1798
  }
1636
1799
  | primary_value tCOLON2 operation3
1637
1800
  {
1638
- result = new_call val[0], val[2].to_sym
1801
+ lhs, _, (id, _line) = val
1802
+
1803
+ result = new_call lhs, id.to_sym
1639
1804
  }
1640
1805
  | primary_value call_op paren_args
1641
1806
  {
@@ -1651,7 +1816,7 @@ opt_block_args_tail: tCOMMA block_args_tail
1651
1816
  }
1652
1817
  | kSUPER
1653
1818
  {
1654
- result = s(:zsuper)
1819
+ result = s(:zsuper).line lexer.lineno
1655
1820
  }
1656
1821
  | primary_value tLBRACK2 opt_call_args rbracket
1657
1822
  {
@@ -1668,7 +1833,7 @@ opt_block_args_tail: tCOMMA block_args_tail
1668
1833
  _, line, body, _ = val
1669
1834
 
1670
1835
  result = body
1671
- result.line = line
1836
+ result.line line
1672
1837
 
1673
1838
  self.env.unextend
1674
1839
  }
@@ -1682,7 +1847,7 @@ opt_block_args_tail: tCOMMA block_args_tail
1682
1847
  _, line, body, _ = val
1683
1848
 
1684
1849
  result = body
1685
- result.line = line
1850
+ result.line line
1686
1851
 
1687
1852
  self.env.unextend
1688
1853
  }
@@ -1700,25 +1865,50 @@ opt_block_args_tail: tCOMMA block_args_tail
1700
1865
  }
1701
1866
 
1702
1867
  do_body: { self.env.extend :dynamic; result = self.lexer.lineno }
1703
- { result = lexer.cmdarg.store(false) }
1868
+ { lexer.cmdarg.push false }
1704
1869
  opt_block_param
1705
1870
  bodystmt
1706
1871
  {
1707
- line, cmdarg, param, cmpstmt = val
1872
+ line, _cmdarg, param, cmpstmt = val
1708
1873
 
1709
1874
  result = new_do_body param, cmpstmt, line
1875
+ lexer.cmdarg.pop
1710
1876
  self.env.unextend
1711
- lexer.cmdarg.restore cmdarg
1877
+ }
1878
+
1879
+ case_args: arg_value
1880
+ {
1881
+ arg, = val
1882
+
1883
+ result = s(:array, arg).line arg.line
1884
+ }
1885
+ | tSTAR arg_value
1886
+ {
1887
+ _, arg = val
1888
+
1889
+ result = s(:array, s(:splat, arg).line(arg.line)).line arg.line
1890
+ }
1891
+ | case_args tCOMMA arg_value
1892
+ {
1893
+ args, _, id = val
1894
+
1895
+ result = self.list_append args, id
1896
+ }
1897
+ | case_args tCOMMA tSTAR arg_value
1898
+ {
1899
+ args, _, _, id = val
1900
+
1901
+ result = self.list_append args, s(:splat, id).line(id.line)
1712
1902
  }
1713
1903
 
1714
1904
  case_body: k_when
1715
1905
  {
1716
1906
  result = self.lexer.lineno
1717
1907
  }
1718
- args then compstmt cases
1908
+ case_args then compstmt cases
1719
1909
  {
1720
1910
  result = new_when(val[2], val[4])
1721
- result.line = val[1]
1911
+ result.line val[1]
1722
1912
  result << val[5] if val[5]
1723
1913
  }
1724
1914
 
@@ -1729,7 +1919,7 @@ opt_block_args_tail: tCOMMA block_args_tail
1729
1919
  (_, line), klasses, var, _, body, rest = val
1730
1920
 
1731
1921
  klasses ||= s(:array)
1732
- klasses << new_assign(var, s(:gvar, :"$!")) if var
1922
+ klasses << new_assign(var, s(:gvar, :"$!").line(var.line)) if var
1733
1923
  klasses.line line
1734
1924
 
1735
1925
  result = new_resbody(klasses, body)
@@ -1742,7 +1932,8 @@ opt_block_args_tail: tCOMMA block_args_tail
1742
1932
 
1743
1933
  exc_list: arg_value
1744
1934
  {
1745
- result = s(:array, val[0])
1935
+ arg, = val
1936
+ result = s(:array, arg).line arg.line
1746
1937
  }
1747
1938
  | mrhs
1748
1939
  | none
@@ -1755,31 +1946,29 @@ opt_block_args_tail: tCOMMA block_args_tail
1755
1946
 
1756
1947
  opt_ensure: k_ensure compstmt
1757
1948
  {
1758
- _, body = val
1949
+ (_, line), body = val
1759
1950
 
1760
- result = body || s(:nil)
1951
+ result = body || s(:nil).line(line)
1761
1952
  }
1762
1953
  | none
1763
1954
 
1764
1955
  literal: numeric
1765
1956
  {
1766
- result = s(:lit, val[0])
1957
+ (lit, line), = val
1958
+ result = s(:lit, lit).line line
1767
1959
  }
1768
1960
  | symbol
1769
- {
1770
- result = s(:lit, val[0])
1771
- }
1772
- | dsym
1773
1961
 
1774
1962
  strings: string
1775
1963
  {
1776
- val[0] = s(:dstr, val[0].value) if val[0].sexp_type == :evstr
1777
- result = val[0]
1964
+ str, = val
1965
+ str = s(:dstr, str.value) if str.sexp_type == :evstr
1966
+ result = str
1778
1967
  }
1779
1968
 
1780
1969
  string: tCHAR
1781
1970
  {
1782
- debug20 23, val, result
1971
+ debug 37
1783
1972
  }
1784
1973
  | string1
1785
1974
  | string string1
@@ -1789,7 +1978,11 @@ opt_block_args_tail: tCOMMA block_args_tail
1789
1978
 
1790
1979
  string1: tSTRING_BEG string_contents tSTRING_END
1791
1980
  {
1792
- result = val[1]
1981
+ (_, line), str, (_, func) = val
1982
+
1983
+ str = dedent str if func =~ RubyLexer::STR_FUNC_DEDENT
1984
+
1985
+ result = str.line line
1793
1986
  }
1794
1987
  | tSTRING
1795
1988
  {
@@ -1798,7 +1991,8 @@ opt_block_args_tail: tCOMMA block_args_tail
1798
1991
 
1799
1992
  xstring: tXSTRING_BEG xstring_contents tSTRING_END
1800
1993
  {
1801
- result = new_xstring val[1]
1994
+ result = new_xstring val
1995
+ # TODO: dedent?!?! SERIOUSLY?!?
1802
1996
  }
1803
1997
 
1804
1998
  regexp: tREGEXP_BEG regexp_contents tREGEXP_END
@@ -1808,11 +2002,15 @@ opt_block_args_tail: tCOMMA block_args_tail
1808
2002
 
1809
2003
  words: tWORDS_BEG tSPACE tSTRING_END
1810
2004
  {
1811
- result = s(:array)
2005
+ (_, line), _, _ = val
2006
+
2007
+ result = s(:array).line line
1812
2008
  }
1813
2009
  | tWORDS_BEG word_list tSTRING_END
1814
2010
  {
1815
- result = val[1]
2011
+ (_, line), list, _ = val
2012
+
2013
+ result = list.line line
1816
2014
  }
1817
2015
 
1818
2016
  word_list: none
@@ -1832,11 +2030,15 @@ opt_block_args_tail: tCOMMA block_args_tail
1832
2030
 
1833
2031
  symbols: tSYMBOLS_BEG tSPACE tSTRING_END
1834
2032
  {
1835
- result = s(:array)
2033
+ (_, line), _, _ = val
2034
+
2035
+ result = s(:array).line line
1836
2036
  }
1837
2037
  | tSYMBOLS_BEG symbol_list tSTRING_END
1838
2038
  {
1839
- result = val[1]
2039
+ (_, line), list, _, = val
2040
+ list.line line
2041
+ result = list
1840
2042
  }
1841
2043
 
1842
2044
  symbol_list: none
@@ -1845,25 +2047,34 @@ opt_block_args_tail: tCOMMA block_args_tail
1845
2047
  }
1846
2048
  | symbol_list word tSPACE
1847
2049
  {
1848
- result = val[0].dup << new_symbol_list_entry(val)
2050
+ list, * = val
2051
+ result = list.dup << new_symbol_list_entry(val)
1849
2052
  }
1850
2053
 
1851
2054
  qwords: tQWORDS_BEG tSPACE tSTRING_END
1852
2055
  {
1853
- result = s(:array)
2056
+ (_, line), _, _ = val
2057
+
2058
+ result = s(:array).line line
1854
2059
  }
1855
2060
  | tQWORDS_BEG qword_list tSTRING_END
1856
2061
  {
1857
- result = val[1]
2062
+ (_, line), list, _ = val
2063
+
2064
+ result = list.line line
1858
2065
  }
1859
2066
 
1860
2067
  qsymbols: tQSYMBOLS_BEG tSPACE tSTRING_END
1861
2068
  {
1862
- result = s(:array)
2069
+ (_, line), _, _ = val
2070
+
2071
+ result = s(:array).line line
1863
2072
  }
1864
2073
  | tQSYMBOLS_BEG qsym_list tSTRING_END
1865
2074
  {
1866
- result = val[1]
2075
+ (_, line), list, _ = val
2076
+
2077
+ result = list.line line
1867
2078
  }
1868
2079
 
1869
2080
  qword_list: none
@@ -1886,11 +2097,13 @@ opt_block_args_tail: tCOMMA block_args_tail
1886
2097
 
1887
2098
  string_contents: none
1888
2099
  {
1889
- result = s(:str, "")
2100
+ line = prev_value_to_lineno _values.last
2101
+ result = s(:str, +"").line line
1890
2102
  }
1891
2103
  | string_contents string_content
1892
2104
  {
1893
- result = literal_concat(val[0], val[1])
2105
+ v1, v2 = val
2106
+ result = literal_concat v1, v2
1894
2107
  }
1895
2108
 
1896
2109
  xstring_contents: none
@@ -1899,7 +2112,8 @@ xstring_contents: none
1899
2112
  }
1900
2113
  | xstring_contents string_content
1901
2114
  {
1902
- result = literal_concat(val[0], val[1])
2115
+ v1, v2 = val
2116
+ result = literal_concat v1, v2
1903
2117
  }
1904
2118
 
1905
2119
  regexp_contents: none
@@ -1908,7 +2122,8 @@ regexp_contents: none
1908
2122
  }
1909
2123
  | regexp_contents string_content
1910
2124
  {
1911
- result = literal_concat(val[0], val[1])
2125
+ v1, v2 = val
2126
+ result = literal_concat v1, v2
1912
2127
  }
1913
2128
 
1914
2129
  string_content: tSTRING_CONTENT
@@ -1924,19 +2139,22 @@ regexp_contents: none
1924
2139
  }
1925
2140
  string_dvar
1926
2141
  {
1927
- lexer.lex_strterm = val[1]
1928
- result = s(:evstr, val[2])
2142
+ _, strterm, str = val
2143
+ lexer.lex_strterm = strterm
2144
+ result = s(:evstr, str).line str.line
1929
2145
  }
1930
2146
  | tSTRING_DBEG
1931
2147
  {
1932
2148
  result = [lexer.lex_strterm,
1933
2149
  lexer.brace_nest,
1934
2150
  lexer.string_nest, # TODO: remove
1935
- lexer.cond.store,
1936
- lexer.cmdarg.store,
1937
2151
  lexer.lex_state,
2152
+ lexer.lineno,
1938
2153
  ]
1939
2154
 
2155
+ lexer.cmdarg.push false
2156
+ lexer.cond.push false
2157
+
1940
2158
  lexer.lex_strterm = nil
1941
2159
  lexer.brace_nest = 0
1942
2160
  lexer.string_nest = 0
@@ -1948,14 +2166,15 @@ regexp_contents: none
1948
2166
  {
1949
2167
  _, memo, stmt, _ = val
1950
2168
 
1951
- lex_strterm, brace_nest, string_nest, oldcond, oldcmdarg, oldlex_state = memo
2169
+ lex_strterm, brace_nest, string_nest, oldlex_state, line = memo
2170
+ # TODO: heredoc_indent
1952
2171
 
1953
2172
  lexer.lex_strterm = lex_strterm
1954
2173
  lexer.brace_nest = brace_nest
1955
2174
  lexer.string_nest = string_nest
1956
2175
 
1957
- lexer.cond.restore oldcond
1958
- lexer.cmdarg.restore oldcmdarg
2176
+ lexer.cond.pop
2177
+ lexer.cmdarg.pop
1959
2178
 
1960
2179
  lexer.lex_state = oldlex_state
1961
2180
 
@@ -1965,56 +2184,71 @@ regexp_contents: none
1965
2184
  when :str, :dstr, :evstr then
1966
2185
  result = stmt
1967
2186
  else
1968
- result = s(:evstr, stmt)
2187
+ result = s(:evstr, stmt).line line
1969
2188
  end
1970
2189
  when nil then
1971
- result = s(:evstr)
2190
+ result = s(:evstr).line line
1972
2191
  else
1973
- debug20 25
2192
+ debug 38
1974
2193
  raise "unknown string body: #{stmt.inspect}"
1975
2194
  end
1976
2195
  }
1977
2196
 
1978
- string_dvar: tGVAR { result = s(:gvar, val[0].to_sym) }
1979
- | tIVAR { result = s(:ivar, val[0].to_sym) }
1980
- | tCVAR { result = s(:cvar, val[0].to_sym) }
2197
+ string_dvar: tGVAR
2198
+ {
2199
+ result = wrap :gvar, val[0]
2200
+ }
2201
+ | tIVAR
2202
+ {
2203
+ result = wrap :ivar, val[0]
2204
+ }
2205
+ | tCVAR
2206
+ {
2207
+ result = wrap :cvar, val[0]
2208
+ }
1981
2209
  | backref
1982
2210
 
1983
- symbol: tSYMBEG sym
2211
+ symbol: ssym
2212
+ | dsym
2213
+
2214
+ ssym: tSYMBEG sym
1984
2215
  {
1985
2216
  lexer.lex_state = EXPR_END
1986
- result = val[1].to_sym
2217
+ result = wrap :lit, val[1]
1987
2218
  }
1988
2219
  | tSYMBOL
1989
2220
  {
1990
- result = val[0].to_sym
2221
+ lexer.lex_state = EXPR_END
2222
+ result = wrap :lit, val[0]
1991
2223
  }
1992
2224
 
1993
2225
  sym: fname | tIVAR | tGVAR | tCVAR
1994
2226
 
1995
- dsym: tSYMBEG xstring_contents tSTRING_END
2227
+ dsym: tSYMBEG string_contents tSTRING_END
1996
2228
  {
2229
+ _, result, _ = val
2230
+
1997
2231
  lexer.lex_state = EXPR_END
1998
- result = val[1]
1999
2232
 
2000
- result ||= s(:str, "")
2233
+ result ||= s(:str, "").line lexer.lineno
2001
2234
 
2002
2235
  case result.sexp_type
2003
2236
  when :dstr then
2004
2237
  result.sexp_type = :dsym
2005
2238
  when :str then
2006
- result = s(:lit, result.last.to_sym)
2239
+ result = s(:lit, result.last.to_sym).line result.line
2007
2240
  when :evstr then
2008
- result = s(:dsym, "", result)
2241
+ result = s(:dsym, "", result).line result.line
2009
2242
  else
2010
- debug20 26, val, result
2243
+ debug 39
2011
2244
  end
2012
2245
  }
2013
2246
 
2014
2247
  numeric: simple_numeric
2015
- | tUMINUS_NUM simple_numeric
2248
+ | tUMINUS_NUM simple_numeric =tLOWEST
2016
2249
  {
2017
- result = -val[1] # TODO: pt_testcase
2250
+ _, (num, line) = val
2251
+ result = [-num, line]
2018
2252
  }
2019
2253
 
2020
2254
  simple_numeric: tINTEGER
@@ -2028,26 +2262,29 @@ regexp_contents: none
2028
2262
  | tCONSTANT
2029
2263
  | tCVAR
2030
2264
 
2031
- keyword_variable: kNIL { result = s(:nil) }
2032
- | kSELF { result = s(:self) }
2033
- | kTRUE { result = s(:true) }
2034
- | kFALSE { result = s(:false) }
2035
- | k__FILE__ { result = s(:str, self.file) }
2036
- | k__LINE__ { result = s(:lit, lexer.lineno) }
2265
+ keyword_variable: kNIL { result = s(:nil).line lexer.lineno }
2266
+ | kSELF { result = s(:self).line lexer.lineno }
2267
+ | kTRUE { result = s(:true).line lexer.lineno }
2268
+ | kFALSE { result = s(:false).line lexer.lineno }
2269
+ | k__FILE__ { result = s(:str, self.file).line lexer.lineno }
2270
+ | k__LINE__ { result = s(:lit, lexer.lineno).line lexer.lineno }
2037
2271
  | k__ENCODING__
2038
2272
  {
2273
+ l = lexer.lineno
2039
2274
  result =
2040
2275
  if defined? Encoding then
2041
- s(:colon2, s(:const, :Encoding), :UTF_8)
2276
+ s(:colon2, s(:const, :Encoding).line(l), :UTF_8).line l
2042
2277
  else
2043
- s(:str, "Unsupported!")
2278
+ s(:str, "Unsupported!").line l
2044
2279
  end
2045
2280
  }
2046
2281
 
2047
2282
  var_ref: user_variable
2048
2283
  {
2049
- var = val[0]
2284
+ raise "NO: #{val.inspect}" if Sexp === val.first
2285
+ (var, line), = val
2050
2286
  result = Sexp === var ? var : self.gettable(var)
2287
+ result.line line
2051
2288
  }
2052
2289
  | keyword_variable
2053
2290
  {
@@ -2062,11 +2299,19 @@ keyword_variable: kNIL { result = s(:nil) }
2062
2299
  | keyword_variable
2063
2300
  {
2064
2301
  result = self.assignable val[0]
2065
- debug20 29, val, result
2302
+ debug 40
2066
2303
  }
2067
2304
 
2068
- backref: tNTH_REF { result = s(:nth_ref, val[0]) }
2069
- | tBACK_REF { result = s(:back_ref, val[0]) }
2305
+ backref: tNTH_REF
2306
+ {
2307
+ (ref, line), = val
2308
+ result = s(:nth_ref, ref).line line
2309
+ }
2310
+ | tBACK_REF
2311
+ {
2312
+ (ref, line), = val
2313
+ result = s(:back_ref, ref).line line
2314
+ }
2070
2315
 
2071
2316
  superclass: tLT
2072
2317
  {
@@ -2084,9 +2329,7 @@ keyword_variable: kNIL { result = s(:nil) }
2084
2329
 
2085
2330
  f_arglist: tLPAREN2 f_args rparen
2086
2331
  {
2087
- result = val[1]
2088
- self.lexer.lex_state = EXPR_BEG
2089
- self.lexer.command_start = true
2332
+ result = end_args val
2090
2333
  }
2091
2334
  | {
2092
2335
  result = self.in_kwarg
@@ -2095,12 +2338,7 @@ keyword_variable: kNIL { result = s(:nil) }
2095
2338
  }
2096
2339
  f_args term
2097
2340
  {
2098
- kwarg, args, _ = val
2099
-
2100
- self.in_kwarg = kwarg
2101
- result = args
2102
- lexer.lex_state = EXPR_BEG
2103
- lexer.command_start = true
2341
+ result = end_args val
2104
2342
  }
2105
2343
 
2106
2344
  args_tail: f_kwarg tCOMMA f_kwrest opt_f_block_arg
@@ -2185,8 +2423,10 @@ keyword_variable: kNIL { result = s(:nil) }
2185
2423
  |
2186
2424
  {
2187
2425
  result = args val
2426
+ # result.line lexer.lineno
2188
2427
  }
2189
2428
 
2429
+
2190
2430
  f_bad_arg: tCONSTANT
2191
2431
  {
2192
2432
  yyerror "formal argument cannot be a constant"
@@ -2207,10 +2447,11 @@ keyword_variable: kNIL { result = s(:nil) }
2207
2447
  f_norm_arg: f_bad_arg
2208
2448
  | tIDENTIFIER
2209
2449
  {
2210
- identifier = val[0].to_sym
2450
+ (id, line), = val
2451
+ identifier = id.to_sym
2211
2452
  self.env[identifier] = :lvar
2212
2453
 
2213
- result = identifier
2454
+ result = [identifier, line]
2214
2455
  }
2215
2456
 
2216
2457
  f_arg_asgn: f_norm_arg
@@ -2218,21 +2459,14 @@ keyword_variable: kNIL { result = s(:nil) }
2218
2459
  f_arg_item: f_arg_asgn
2219
2460
  | tLPAREN f_margs rparen
2220
2461
  {
2221
- result = val[1]
2462
+ _, margs, _ = val
2463
+
2464
+ result = margs
2222
2465
  }
2223
2466
 
2224
2467
  f_arg: f_arg_item
2225
2468
  {
2226
- case val[0]
2227
- when Symbol then
2228
- result = s(:args)
2229
- result << val[0]
2230
- when Sexp then
2231
- result = val[0]
2232
- else
2233
- debug20 32
2234
- raise "Unknown f_arg type: #{val.inspect}"
2235
- end
2469
+ result = new_arg val
2236
2470
  }
2237
2471
  | f_arg tCOMMA f_arg_item
2238
2472
  {
@@ -2241,48 +2475,52 @@ keyword_variable: kNIL { result = s(:nil) }
2241
2475
  if list.sexp_type == :args then
2242
2476
  result = list
2243
2477
  else
2244
- result = s(:args, list)
2478
+ result = s(:args, list).line list.line
2245
2479
  end
2246
2480
 
2247
- result << item
2481
+ result << (Sexp === item ? item : item.first)
2248
2482
  }
2249
2483
 
2250
2484
  f_label: tLABEL
2251
2485
 
2252
2486
  f_kw: f_label arg_value
2253
2487
  {
2254
- # TODO: call_args
2255
- label, _ = val[0] # TODO: fix lineno?
2488
+ # TODO: new_kw_arg
2489
+ (label, line), arg = val
2490
+
2256
2491
  identifier = label.to_sym
2257
2492
  self.env[identifier] = :lvar
2258
2493
 
2259
- result = s(:array, s(:kwarg, identifier, val[1]))
2494
+ kwarg = s(:kwarg, identifier, arg).line line
2495
+ result = s(:array, kwarg).line line
2260
2496
  }
2261
2497
  | f_label
2262
2498
  {
2263
- label, _ = val[0] # TODO: fix lineno?
2264
- identifier = label.to_sym
2265
- self.env[identifier] = :lvar
2499
+ (label, line), = val
2500
+
2501
+ id = label.to_sym
2502
+ self.env[id] = :lvar
2266
2503
 
2267
- result = s(:array, s(:kwarg, identifier))
2504
+ result = s(:array, s(:kwarg, id).line(line)).line line
2268
2505
  }
2269
2506
 
2270
2507
  f_block_kw: f_label primary_value
2271
2508
  {
2272
- # TODO: call_args
2273
- label, _ = val[0] # TODO: fix lineno?
2274
- identifier = label.to_sym
2275
- self.env[identifier] = :lvar
2509
+ # TODO: new_kw_arg
2510
+ (label, line), expr = val
2511
+ id = label.to_sym
2512
+ self.env[id] = :lvar
2276
2513
 
2277
- result = s(:array, s(:kwarg, identifier, val[1]))
2514
+ result = s(:array, s(:kwarg, id, expr).line(line)).line line
2278
2515
  }
2279
2516
  | f_label
2280
2517
  {
2281
- label, _ = val[0] # TODO: fix lineno?
2282
- identifier = label.to_sym
2283
- self.env[identifier] = :lvar
2518
+ # TODO: new_kw_arg
2519
+ (label, line), = val
2520
+ id = label.to_sym
2521
+ self.env[id] = :lvar
2284
2522
 
2285
- result = s(:array, s(:kwarg, identifier))
2523
+ result = s(:array, s(:kwarg, id).line(line)).line line
2286
2524
  }
2287
2525
 
2288
2526
  f_block_kwarg: f_block_kw
@@ -2301,41 +2539,51 @@ keyword_variable: kNIL { result = s(:nil) }
2301
2539
  kwrest_mark: tPOW
2302
2540
  | tDSTAR
2303
2541
 
2542
+
2304
2543
  f_kwrest: kwrest_mark tIDENTIFIER
2305
2544
  {
2306
- name = val[1].to_sym
2307
- self.assignable name
2308
- result = :"**#{name}"
2545
+ _, (id, line) = val
2546
+
2547
+ name = id.to_sym
2548
+ self.assignable [name, line]
2549
+ result = [:"**#{name}", line]
2309
2550
  }
2310
2551
  | kwrest_mark
2311
2552
  {
2312
- result = :"**"
2553
+ id = :"**"
2554
+ self.env[id] = :lvar # TODO: needed?!?
2555
+ result = [id, lexer.lineno] # TODO: tPOW/tDSTAR include lineno
2313
2556
  }
2314
2557
 
2315
2558
  f_opt: f_arg_asgn tEQL arg_value
2316
2559
  {
2317
- result = self.assignable val[0], val[2]
2560
+ lhs, _, rhs = val
2561
+ result = self.assignable lhs, rhs
2318
2562
  # TODO: detect duplicate names
2319
2563
  }
2320
2564
 
2321
2565
  f_block_opt: f_arg_asgn tEQL primary_value
2322
2566
  {
2323
- result = self.assignable val[0], val[2]
2567
+ lhs, _, rhs = val
2568
+ result = self.assignable lhs, rhs
2324
2569
  }
2325
2570
 
2326
2571
  f_block_optarg: f_block_opt
2327
2572
  {
2328
- result = s(:block, val[0])
2573
+ optblk, = val
2574
+ result = s(:block, optblk).line optblk.line
2329
2575
  }
2330
2576
  | f_block_optarg tCOMMA f_block_opt
2331
2577
  {
2332
- result = val[0]
2333
- result << val[2]
2578
+ optarg, _, optblk = val
2579
+ result = optarg
2580
+ result << optblk
2334
2581
  }
2335
2582
 
2336
2583
  f_optarg: f_opt
2337
2584
  {
2338
- result = s(:block, val[0])
2585
+ opt, = val
2586
+ result = s(:block, opt).line opt.line
2339
2587
  }
2340
2588
  | f_optarg tCOMMA f_opt
2341
2589
  {
@@ -2347,30 +2595,33 @@ keyword_variable: kNIL { result = s(:nil) }
2347
2595
  f_rest_arg: restarg_mark tIDENTIFIER
2348
2596
  {
2349
2597
  # TODO: differs from parse.y - needs tests
2350
- name = val[1].to_sym
2351
- self.assignable name
2352
- result = :"*#{name}"
2598
+ _, (id, line) = val
2599
+ name = id.to_sym
2600
+ self.assignable [name, line]
2601
+ result = [:"*#{name}", line]
2353
2602
  }
2354
2603
  | restarg_mark
2355
2604
  {
2356
2605
  name = :"*"
2357
2606
  self.env[name] = :lvar
2358
- result = name
2607
+ result = [name, lexer.lineno] # FIX: tSTAR to include lineno
2359
2608
  }
2360
2609
 
2361
2610
  blkarg_mark: tAMPER2 | tAMPER
2362
2611
 
2363
2612
  f_block_arg: blkarg_mark tIDENTIFIER
2364
2613
  {
2365
- identifier = val[1].to_sym
2614
+ _, (id, line) = val
2615
+ identifier = id.to_sym
2366
2616
 
2367
2617
  self.env[identifier] = :lvar
2368
- result = "&#{identifier}".to_sym
2618
+ result = ["&#{identifier}".to_sym, line]
2369
2619
  }
2370
2620
 
2371
2621
  opt_f_block_arg: tCOMMA f_block_arg
2372
2622
  {
2373
- result = val[1]
2623
+ _, arg = val
2624
+ result = arg
2374
2625
  }
2375
2626
  |
2376
2627
  {
@@ -2389,14 +2640,11 @@ keyword_variable: kNIL { result = s(:nil) }
2389
2640
  result.sexp_type == :lit
2390
2641
  }
2391
2642
 
2392
- assoc_list: none # [!nil]
2643
+ assoc_list: none
2393
2644
  {
2394
- result = s(:array)
2395
- }
2396
- | assocs trailer # [!nil]
2397
- {
2398
- result = val[0]
2645
+ result = s(:array).line lexer.lineno
2399
2646
  }
2647
+ | assocs trailer
2400
2648
 
2401
2649
  assocs: assoc
2402
2650
  | assocs tCOMMA assoc
@@ -2410,22 +2658,29 @@ keyword_variable: kNIL { result = s(:nil) }
2410
2658
 
2411
2659
  assoc: arg_value tASSOC arg_value
2412
2660
  {
2413
- result = s(:array, val[0], val[2])
2661
+ v1, _, v2 = val
2662
+ result = s(:array, v1, v2).line v1.line
2414
2663
  }
2415
2664
  | tLABEL arg_value
2416
2665
  {
2417
- (label, _), arg = val
2418
- result = s(:array, s(:lit, label.to_sym), arg)
2666
+ label, arg = val
2667
+
2668
+ lit = wrap :lit, label
2669
+ result = s(:array, lit, arg).line lit.line
2419
2670
  }
2420
2671
  | tSTRING_BEG string_contents tLABEL_END arg_value
2421
2672
  {
2422
- _, sym, _, value = val
2673
+ (_, line), sym, _, value = val
2674
+
2423
2675
  sym.sexp_type = :dsym
2424
- result = s(:array, sym, value)
2676
+
2677
+ result = s(:array, sym, value).line line
2425
2678
  }
2426
2679
  | tDSTAR arg_value
2427
2680
  {
2428
- result = s(:array, s(:kwsplat, val[1]))
2681
+ _, arg = val
2682
+ line = arg.line
2683
+ result = s(:array, s(:kwsplat, arg).line(line)).line line
2429
2684
  }
2430
2685
 
2431
2686
  operation: tIDENTIFIER | tCONSTANT | tFID