brakeman 4.5.1 → 5.4.0

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