brakeman 4.7.2 → 5.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (505) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +155 -1
  3. data/README.md +23 -6
  4. data/bundle/load.rb +15 -13
  5. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/erubis-2.7.0/CHANGES.txt +0 -0
  6. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/erubis-2.7.0/MIT-LICENSE +0 -0
  7. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/erubis-2.7.0/README.txt +0 -0
  8. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/erubis-2.7.0/contrib/erubis +0 -0
  9. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/erubis-2.7.0/contrib/erubis-run.rb +0 -0
  10. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/erubis-2.7.0/contrib/inline-require +0 -0
  11. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/context.rb +0 -0
  12. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/converter.rb +0 -0
  13. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/engine/ec.rb +0 -0
  14. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/engine/ecpp.rb +0 -0
  15. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/engine/ejava.rb +0 -0
  16. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/engine/ejavascript.rb +0 -0
  17. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/engine/enhanced.rb +0 -0
  18. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/engine/eperl.rb +0 -0
  19. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/engine/ephp.rb +0 -0
  20. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/engine/eruby.rb +0 -0
  21. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/engine/escheme.rb +0 -0
  22. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/engine/optimized.rb +0 -0
  23. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/engine.rb +0 -0
  24. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/enhancer.rb +0 -0
  25. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/error.rb +0 -0
  26. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/evaluator.rb +0 -0
  27. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/generator.rb +0 -0
  28. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/helper.rb +0 -0
  29. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/helpers/rails_form_helper.rb +0 -0
  30. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/helpers/rails_helper.rb +0 -0
  31. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/local-setting.rb +0 -0
  32. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/main.rb +0 -0
  33. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/preprocessing.rb +0 -0
  34. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/tiny.rb +0 -0
  35. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis/util.rb +0 -0
  36. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/erubis-2.7.0/lib/erubis.rb +0 -0
  37. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/erubis-2.7.0/setup.rb +0 -0
  38. data/bundle/ruby/{2.6.0/gems/haml-5.1.2 → 2.7.0/gems/haml-5.2.2}/CHANGELOG.md +24 -0
  39. data/bundle/ruby/{2.6.0/gems/haml-5.1.2 → 2.7.0/gems/haml-5.2.2}/FAQ.md +0 -0
  40. data/bundle/ruby/{2.6.0/gems/haml-5.1.2 → 2.7.0/gems/haml-5.2.2}/Gemfile +1 -4
  41. data/bundle/ruby/{2.6.0/gems/haml-5.1.2 → 2.7.0/gems/haml-5.2.2}/MIT-LICENSE +0 -0
  42. data/bundle/ruby/{2.6.0/gems/haml-5.1.2 → 2.7.0/gems/haml-5.2.2}/README.md +21 -16
  43. data/bundle/ruby/{2.6.0/gems/haml-5.1.2 → 2.7.0/gems/haml-5.2.2}/REFERENCE.md +39 -10
  44. data/bundle/ruby/{2.6.0/gems/haml-5.1.2 → 2.7.0/gems/haml-5.2.2}/TODO +0 -0
  45. data/bundle/ruby/{2.6.0/gems/haml-5.1.2 → 2.7.0/gems/haml-5.2.2}/haml.gemspec +2 -1
  46. data/bundle/ruby/{2.6.0/gems/haml-5.1.2 → 2.7.0/gems/haml-5.2.2}/lib/haml/attribute_builder.rb +58 -3
  47. data/bundle/ruby/{2.6.0/gems/haml-5.1.2 → 2.7.0/gems/haml-5.2.2}/lib/haml/attribute_compiler.rb +45 -32
  48. data/bundle/ruby/{2.6.0/gems/haml-5.1.2 → 2.7.0/gems/haml-5.2.2}/lib/haml/attribute_parser.rb +0 -0
  49. data/bundle/ruby/{2.6.0/gems/haml-5.1.2 → 2.7.0/gems/haml-5.2.2}/lib/haml/buffer.rb +0 -56
  50. data/bundle/ruby/{2.6.0/gems/haml-5.1.2 → 2.7.0/gems/haml-5.2.2}/lib/haml/compiler.rb +0 -0
  51. data/bundle/ruby/{2.6.0/gems/haml-5.1.2 → 2.7.0/gems/haml-5.2.2}/lib/haml/engine.rb +0 -0
  52. data/bundle/ruby/{2.6.0/gems/haml-5.1.2 → 2.7.0/gems/haml-5.2.2}/lib/haml/error.rb +0 -0
  53. data/bundle/ruby/2.7.0/gems/haml-5.2.2/lib/haml/escapable.rb +77 -0
  54. data/bundle/ruby/{2.6.0/gems/haml-5.1.2 → 2.7.0/gems/haml-5.2.2}/lib/haml/exec.rb +0 -0
  55. data/bundle/ruby/{2.6.0/gems/haml-5.1.2 → 2.7.0/gems/haml-5.2.2}/lib/haml/filters.rb +0 -0
  56. data/bundle/ruby/{2.6.0/gems/haml-5.1.2 → 2.7.0/gems/haml-5.2.2}/lib/haml/generator.rb +0 -0
  57. data/bundle/ruby/{2.6.0/gems/haml-5.1.2 → 2.7.0/gems/haml-5.2.2}/lib/haml/helpers/action_view_extensions.rb +0 -0
  58. data/bundle/ruby/{2.6.0/gems/haml-5.1.2 → 2.7.0/gems/haml-5.2.2}/lib/haml/helpers/action_view_mods.rb +0 -0
  59. data/bundle/ruby/{2.6.0/gems/haml-5.1.2 → 2.7.0/gems/haml-5.2.2}/lib/haml/helpers/action_view_xss_mods.rb +0 -0
  60. data/bundle/ruby/{2.6.0/gems/haml-5.1.2 → 2.7.0/gems/haml-5.2.2}/lib/haml/helpers/safe_erubi_template.rb +0 -0
  61. data/bundle/ruby/{2.6.0/gems/haml-5.1.2 → 2.7.0/gems/haml-5.2.2}/lib/haml/helpers/safe_erubis_template.rb +0 -0
  62. data/bundle/ruby/{2.6.0/gems/haml-5.1.2 → 2.7.0/gems/haml-5.2.2}/lib/haml/helpers/xss_mods.rb +6 -3
  63. data/bundle/ruby/{2.6.0/gems/haml-5.1.2 → 2.7.0/gems/haml-5.2.2}/lib/haml/helpers.rb +7 -1
  64. data/bundle/ruby/{2.6.0/gems/haml-5.1.2 → 2.7.0/gems/haml-5.2.2}/lib/haml/options.rb +0 -0
  65. data/bundle/ruby/{2.6.0/gems/haml-5.1.2 → 2.7.0/gems/haml-5.2.2}/lib/haml/parser.rb +32 -4
  66. data/bundle/ruby/{2.6.0/gems/haml-5.1.2 → 2.7.0/gems/haml-5.2.2}/lib/haml/plugin.rb +18 -1
  67. data/bundle/ruby/{2.6.0/gems/haml-5.1.2 → 2.7.0/gems/haml-5.2.2}/lib/haml/railtie.rb +5 -0
  68. data/bundle/ruby/{2.6.0/gems/haml-5.1.2 → 2.7.0/gems/haml-5.2.2}/lib/haml/sass_rails_filter.rb +0 -0
  69. data/bundle/ruby/{2.6.0/gems/haml-5.1.2 → 2.7.0/gems/haml-5.2.2}/lib/haml/template/options.rb +0 -0
  70. data/bundle/ruby/{2.6.0/gems/haml-5.1.2 → 2.7.0/gems/haml-5.2.2}/lib/haml/template.rb +0 -0
  71. data/bundle/ruby/{2.6.0/gems/haml-5.1.2 → 2.7.0/gems/haml-5.2.2}/lib/haml/temple_engine.rb +2 -1
  72. data/bundle/ruby/{2.6.0/gems/haml-5.1.2 → 2.7.0/gems/haml-5.2.2}/lib/haml/temple_line_counter.rb +0 -0
  73. data/bundle/ruby/{2.6.0/gems/haml-5.1.2 → 2.7.0/gems/haml-5.2.2}/lib/haml/util.rb +1 -1
  74. data/bundle/ruby/{2.6.0/gems/haml-5.1.2 → 2.7.0/gems/haml-5.2.2}/lib/haml/version.rb +1 -1
  75. data/bundle/ruby/{2.6.0/gems/haml-5.1.2 → 2.7.0/gems/haml-5.2.2}/lib/haml.rb +0 -0
  76. data/bundle/ruby/{2.6.0/gems/haml-5.1.2 → 2.7.0/gems/haml-5.2.2}/yard/default/fulldoc/html/css/common.sass +0 -0
  77. data/bundle/ruby/{2.6.0/gems/haml-5.1.2 → 2.7.0/gems/haml-5.2.2}/yard/default/layout/html/footer.erb +0 -0
  78. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/highline-2.0.3/AUTHORS +0 -0
  79. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/highline-2.0.3/COPYING +0 -0
  80. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/highline-2.0.3/Changelog.md +0 -0
  81. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/highline-2.0.3/Gemfile +0 -0
  82. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/highline-2.0.3/LICENSE +0 -0
  83. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/highline-2.0.3/README.md +0 -0
  84. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/highline-2.0.3/TODO +0 -0
  85. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/highline-2.0.3/appveyor.yml +0 -0
  86. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/highline-2.0.3/highline.gemspec +0 -0
  87. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/highline-2.0.3/lib/highline/builtin_styles.rb +0 -0
  88. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/highline-2.0.3/lib/highline/color_scheme.rb +0 -0
  89. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/highline-2.0.3/lib/highline/compatibility.rb +0 -0
  90. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/highline-2.0.3/lib/highline/custom_errors.rb +0 -0
  91. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/highline-2.0.3/lib/highline/import.rb +0 -0
  92. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/highline-2.0.3/lib/highline/io_console_compatible.rb +0 -0
  93. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/highline-2.0.3/lib/highline/list.rb +0 -0
  94. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/highline-2.0.3/lib/highline/list_renderer.rb +0 -0
  95. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/highline-2.0.3/lib/highline/menu/item.rb +0 -0
  96. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/highline-2.0.3/lib/highline/menu.rb +0 -0
  97. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/highline-2.0.3/lib/highline/paginator.rb +0 -0
  98. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/highline-2.0.3/lib/highline/question/answer_converter.rb +0 -0
  99. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/highline-2.0.3/lib/highline/question.rb +0 -0
  100. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/highline-2.0.3/lib/highline/question_asker.rb +0 -0
  101. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/highline-2.0.3/lib/highline/simulate.rb +0 -0
  102. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/highline-2.0.3/lib/highline/statement.rb +0 -0
  103. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/highline-2.0.3/lib/highline/string.rb +0 -0
  104. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/highline-2.0.3/lib/highline/string_extensions.rb +0 -0
  105. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/highline-2.0.3/lib/highline/style.rb +0 -0
  106. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/highline-2.0.3/lib/highline/template_renderer.rb +0 -0
  107. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/highline-2.0.3/lib/highline/terminal/io_console.rb +0 -0
  108. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/highline-2.0.3/lib/highline/terminal/ncurses.rb +0 -0
  109. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/highline-2.0.3/lib/highline/terminal/unix_stty.rb +0 -0
  110. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/highline-2.0.3/lib/highline/terminal.rb +0 -0
  111. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/highline-2.0.3/lib/highline/version.rb +0 -0
  112. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/highline-2.0.3/lib/highline/wrapper.rb +0 -0
  113. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/highline-2.0.3/lib/highline.rb +0 -0
  114. data/bundle/ruby/2.7.0/gems/parallel-1.21.0/MIT-LICENSE.txt +20 -0
  115. data/bundle/ruby/2.7.0/gems/parallel-1.21.0/lib/parallel/processor_count.rb +45 -0
  116. data/bundle/ruby/2.7.0/gems/parallel-1.21.0/lib/parallel/version.rb +4 -0
  117. data/bundle/ruby/2.7.0/gems/parallel-1.21.0/lib/parallel.rb +532 -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.6.0 → 2.7.0}/gems/ruby2ruby-2.4.4/History.rdoc +0 -0
  172. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/ruby2ruby-2.4.4/Manifest.txt +0 -0
  173. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/ruby2ruby-2.4.4/README.rdoc +0 -0
  174. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/ruby2ruby-2.4.4/lib/ruby2ruby.rb +0 -0
  175. data/bundle/ruby/{2.6.0/gems/ruby_parser-3.14.1 → 2.7.0/gems/ruby_parser-3.18.1}/History.rdoc +154 -0
  176. data/bundle/ruby/{2.6.0/gems/ruby_parser-3.14.1 → 2.7.0/gems/ruby_parser-3.18.1}/Manifest.txt +7 -0
  177. data/bundle/ruby/{2.6.0/gems/ruby_parser-3.14.1 → 2.7.0/gems/ruby_parser-3.18.1}/README.rdoc +1 -0
  178. data/bundle/ruby/{2.6.0/gems/ruby_parser-3.14.1 → 2.7.0/gems/ruby_parser-3.18.1}/compare/normalize.rb +51 -6
  179. data/bundle/ruby/2.7.0/gems/ruby_parser-3.18.1/debugging.md +190 -0
  180. data/bundle/ruby/2.7.0/gems/ruby_parser-3.18.1/gauntlet.md +106 -0
  181. data/bundle/ruby/{2.6.0/gems/ruby_parser-3.14.1 → 2.7.0/gems/ruby_parser-3.18.1}/lib/rp_extensions.rb +15 -36
  182. data/bundle/ruby/2.7.0/gems/ruby_parser-3.18.1/lib/rp_stringscanner.rb +33 -0
  183. data/bundle/ruby/2.7.0/gems/ruby_parser-3.18.1/lib/ruby20_parser.rb +7128 -0
  184. data/bundle/ruby/{2.6.0/gems/ruby_parser-3.14.1 → 2.7.0/gems/ruby_parser-3.18.1}/lib/ruby20_parser.y +422 -301
  185. data/bundle/ruby/2.7.0/gems/ruby_parser-3.18.1/lib/ruby21_parser.rb +7182 -0
  186. data/bundle/ruby/{2.6.0/gems/ruby_parser-3.14.1 → 2.7.0/gems/ruby_parser-3.18.1}/lib/ruby21_parser.y +417 -298
  187. data/bundle/ruby/2.7.0/gems/ruby_parser-3.18.1/lib/ruby22_parser.rb +7228 -0
  188. data/bundle/ruby/{2.6.0/gems/ruby_parser-3.14.1 → 2.7.0/gems/ruby_parser-3.18.1}/lib/ruby22_parser.y +421 -300
  189. data/bundle/ruby/2.7.0/gems/ruby_parser-3.18.1/lib/ruby23_parser.rb +7237 -0
  190. data/bundle/ruby/{2.6.0/gems/ruby_parser-3.14.1 → 2.7.0/gems/ruby_parser-3.18.1}/lib/ruby23_parser.y +421 -300
  191. data/bundle/ruby/2.7.0/gems/ruby_parser-3.18.1/lib/ruby24_parser.rb +7268 -0
  192. data/bundle/ruby/{2.6.0/gems/ruby_parser-3.14.1 → 2.7.0/gems/ruby_parser-3.18.1}/lib/ruby24_parser.y +421 -300
  193. data/bundle/ruby/2.7.0/gems/ruby_parser-3.18.1/lib/ruby25_parser.rb +7268 -0
  194. data/bundle/ruby/{2.6.0/gems/ruby_parser-3.14.1/lib/ruby26_parser.y → 2.7.0/gems/ruby_parser-3.18.1/lib/ruby25_parser.y} +420 -313
  195. data/bundle/ruby/2.7.0/gems/ruby_parser-3.18.1/lib/ruby26_parser.rb +7287 -0
  196. data/bundle/ruby/{2.6.0/gems/ruby_parser-3.14.1/lib/ruby_parser.yy → 2.7.0/gems/ruby_parser-3.18.1/lib/ruby26_parser.y} +421 -404
  197. data/bundle/ruby/2.7.0/gems/ruby_parser-3.18.1/lib/ruby27_parser.rb +8517 -0
  198. data/bundle/ruby/{2.6.0/gems/ruby_parser-3.14.1/lib/ruby25_parser.y → 2.7.0/gems/ruby_parser-3.18.1/lib/ruby27_parser.y} +1032 -299
  199. data/bundle/ruby/2.7.0/gems/ruby_parser-3.18.1/lib/ruby30_parser.rb +8751 -0
  200. data/bundle/ruby/2.7.0/gems/ruby_parser-3.18.1/lib/ruby30_parser.y +3472 -0
  201. data/bundle/ruby/2.7.0/gems/ruby_parser-3.18.1/lib/ruby3_parser.yy +3476 -0
  202. data/bundle/ruby/{2.6.0/gems/ruby_parser-3.14.1 → 2.7.0/gems/ruby_parser-3.18.1}/lib/ruby_lexer.rb +308 -605
  203. data/bundle/ruby/{2.6.0/gems/ruby_parser-3.14.1 → 2.7.0/gems/ruby_parser-3.18.1}/lib/ruby_lexer.rex +33 -27
  204. data/bundle/ruby/{2.6.0/gems/ruby_parser-3.14.1 → 2.7.0/gems/ruby_parser-3.18.1}/lib/ruby_lexer.rex.rb +65 -31
  205. data/bundle/ruby/2.7.0/gems/ruby_parser-3.18.1/lib/ruby_lexer_strings.rb +638 -0
  206. data/bundle/ruby/{2.6.0/gems/ruby_parser-3.14.1 → 2.7.0/gems/ruby_parser-3.18.1}/lib/ruby_parser.rb +4 -0
  207. data/bundle/ruby/2.7.0/gems/ruby_parser-3.18.1/lib/ruby_parser.yy +3487 -0
  208. data/bundle/ruby/{2.6.0/gems/ruby_parser-3.14.1 → 2.7.0/gems/ruby_parser-3.18.1}/lib/ruby_parser_extras.rb +341 -133
  209. data/bundle/ruby/{2.6.0/gems/ruby_parser-3.14.1 → 2.7.0/gems/ruby_parser-3.18.1}/tools/munge.rb +43 -10
  210. data/bundle/ruby/{2.6.0/gems/ruby_parser-3.14.1 → 2.7.0/gems/ruby_parser-3.18.1}/tools/ripper.rb +15 -10
  211. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/ruby_parser-legacy-1.0.0/History.rdoc +0 -0
  212. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/ruby_parser-legacy-1.0.0/Manifest.txt +0 -0
  213. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/ruby_parser-legacy-1.0.0/README.rdoc +0 -0
  214. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy/ruby18_parser.rb +0 -0
  215. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy/ruby18_parser.y +0 -0
  216. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy/ruby19_parser.rb +0 -0
  217. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy/ruby19_parser.y +0 -0
  218. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy/ruby_lexer.rb +0 -0
  219. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy/ruby_lexer.rex +0 -0
  220. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy/ruby_lexer.rex.rb +0 -0
  221. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy/ruby_parser.rb +0 -0
  222. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy/ruby_parser_extras.rb +0 -0
  223. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy.rb +0 -0
  224. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/safe_yaml-1.0.5/CHANGES.md +0 -0
  225. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/safe_yaml-1.0.5/Gemfile +0 -0
  226. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/safe_yaml-1.0.5/LICENSE.txt +0 -0
  227. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/safe_yaml-1.0.5/README.md +0 -0
  228. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/safe_yaml-1.0.5/bundle_install_all_ruby_versions.sh +0 -0
  229. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/deep.rb +0 -0
  230. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/libyaml_checker.rb +0 -0
  231. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/load.rb +0 -0
  232. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/parse/date.rb +0 -0
  233. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/parse/hexadecimal.rb +0 -0
  234. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/parse/sexagesimal.rb +0 -0
  235. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/psych_handler.rb +0 -0
  236. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/psych_resolver.rb +0 -0
  237. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/resolver.rb +0 -0
  238. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/safe_to_ruby_visitor.rb +0 -0
  239. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/store.rb +0 -0
  240. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/syck_hack.rb +0 -0
  241. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/syck_node_monkeypatch.rb +0 -0
  242. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/syck_resolver.rb +0 -0
  243. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/transform/to_boolean.rb +0 -0
  244. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/transform/to_date.rb +0 -0
  245. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/transform/to_float.rb +0 -0
  246. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/transform/to_integer.rb +0 -0
  247. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/transform/to_nil.rb +0 -0
  248. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/transform/to_symbol.rb +0 -0
  249. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/transform/transformation_map.rb +0 -0
  250. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/transform.rb +0 -0
  251. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/version.rb +0 -0
  252. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/safe_yaml-1.0.5/lib/safe_yaml.rb +0 -0
  253. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/safe_yaml-1.0.5/run_specs_all_ruby_versions.sh +0 -0
  254. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/safe_yaml-1.0.5/safe_yaml.gemspec +0 -0
  255. data/bundle/ruby/{2.6.0/gems/sexp_processor-4.13.0 → 2.7.0/gems/sexp_processor-4.16.0}/History.rdoc +55 -0
  256. data/bundle/ruby/{2.6.0/gems/sexp_processor-4.13.0 → 2.7.0/gems/sexp_processor-4.16.0}/Manifest.txt +0 -0
  257. data/bundle/ruby/{2.6.0/gems/sexp_processor-4.13.0 → 2.7.0/gems/sexp_processor-4.16.0}/README.rdoc +0 -0
  258. data/bundle/ruby/{2.6.0/gems/sexp_processor-4.13.0 → 2.7.0/gems/sexp_processor-4.16.0}/lib/composite_sexp_processor.rb +0 -0
  259. data/bundle/ruby/{2.6.0/gems/sexp_processor-4.13.0 → 2.7.0/gems/sexp_processor-4.16.0}/lib/pt_testcase.rb +9 -4
  260. data/bundle/ruby/{2.6.0/gems/sexp_processor-4.13.0 → 2.7.0/gems/sexp_processor-4.16.0}/lib/sexp.rb +19 -9
  261. data/bundle/ruby/{2.6.0/gems/sexp_processor-4.13.0 → 2.7.0/gems/sexp_processor-4.16.0}/lib/sexp_matcher.rb +44 -7
  262. data/bundle/ruby/{2.6.0/gems/sexp_processor-4.13.0 → 2.7.0/gems/sexp_processor-4.16.0}/lib/sexp_processor.rb +1 -1
  263. data/bundle/ruby/{2.6.0/gems/sexp_processor-4.13.0 → 2.7.0/gems/sexp_processor-4.16.0}/lib/strict_sexp.rb +25 -3
  264. data/bundle/ruby/{2.6.0/gems/sexp_processor-4.13.0 → 2.7.0/gems/sexp_processor-4.16.0}/lib/unique.rb +0 -0
  265. data/bundle/ruby/{2.6.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/CHANGES +4 -0
  266. data/bundle/ruby/{2.6.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/Gemfile +12 -13
  267. data/bundle/ruby/{2.6.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/LICENSE +0 -0
  268. data/bundle/ruby/{2.6.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/README.jp.md +0 -0
  269. data/bundle/ruby/{2.6.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/README.md +0 -0
  270. data/bundle/ruby/{2.6.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/code_attributes.rb +0 -0
  271. data/bundle/ruby/{2.6.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/command.rb +13 -13
  272. data/bundle/ruby/{2.6.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/controls.rb +0 -0
  273. data/bundle/ruby/{2.6.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/do_inserter.rb +0 -0
  274. data/bundle/ruby/{2.6.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/embedded.rb +0 -0
  275. data/bundle/ruby/{2.6.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/end_inserter.rb +0 -0
  276. data/bundle/ruby/{2.6.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/engine.rb +0 -0
  277. data/bundle/ruby/{2.6.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/erb_converter.rb +0 -0
  278. data/bundle/ruby/{2.6.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/filter.rb +0 -0
  279. data/bundle/ruby/{2.6.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/grammar.rb +0 -0
  280. data/bundle/ruby/{2.6.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/include.rb +0 -0
  281. data/bundle/ruby/{2.6.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/interpolation.rb +0 -0
  282. data/bundle/ruby/{2.6.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/logic_less/context.rb +0 -0
  283. data/bundle/ruby/{2.6.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/logic_less/filter.rb +0 -0
  284. data/bundle/ruby/{2.6.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/logic_less.rb +0 -0
  285. data/bundle/ruby/{2.6.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/parser.rb +1 -1
  286. data/bundle/ruby/{2.6.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/smart/escaper.rb +0 -0
  287. data/bundle/ruby/{2.6.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/smart/filter.rb +0 -0
  288. data/bundle/ruby/{2.6.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/smart/parser.rb +0 -0
  289. data/bundle/ruby/{2.6.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/smart.rb +0 -0
  290. data/bundle/ruby/{2.6.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/splat/builder.rb +0 -0
  291. data/bundle/ruby/{2.6.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/splat/filter.rb +0 -0
  292. data/bundle/ruby/{2.6.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/template.rb +0 -0
  293. data/bundle/ruby/{2.6.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/translator.rb +0 -0
  294. data/bundle/ruby/{2.6.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim/version.rb +1 -1
  295. data/bundle/ruby/{2.6.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/lib/slim.rb +0 -0
  296. data/bundle/ruby/{2.6.0/gems/slim-4.0.1 → 2.7.0/gems/slim-4.1.0}/slim.gemspec +0 -0
  297. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/CHANGES +0 -0
  298. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/EXPRESSIONS.md +0 -0
  299. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/Gemfile +0 -0
  300. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/LICENSE +0 -0
  301. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/README.md +0 -0
  302. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/engine.rb +0 -0
  303. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/erb/engine.rb +0 -0
  304. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/erb/parser.rb +0 -0
  305. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/erb/template.rb +0 -0
  306. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/erb/trimming.rb +0 -0
  307. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/exceptions.rb +0 -0
  308. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/filter.rb +0 -0
  309. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/filters/code_merger.rb +0 -0
  310. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/filters/control_flow.rb +0 -0
  311. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/filters/dynamic_inliner.rb +0 -0
  312. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/filters/encoding.rb +0 -0
  313. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/filters/eraser.rb +0 -0
  314. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/filters/escapable.rb +0 -0
  315. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/filters/multi_flattener.rb +0 -0
  316. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/filters/remove_bom.rb +0 -0
  317. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/filters/static_analyzer.rb +0 -0
  318. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/filters/static_merger.rb +0 -0
  319. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/filters/string_splitter.rb +0 -0
  320. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/filters/validator.rb +0 -0
  321. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/generator.rb +0 -0
  322. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/generators/array.rb +0 -0
  323. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/generators/array_buffer.rb +0 -0
  324. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/generators/erb.rb +0 -0
  325. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/generators/rails_output_buffer.rb +0 -0
  326. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/generators/string_buffer.rb +0 -0
  327. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/grammar.rb +0 -0
  328. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/html/attribute_merger.rb +0 -0
  329. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/html/attribute_remover.rb +0 -0
  330. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/html/attribute_sorter.rb +0 -0
  331. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/html/dispatcher.rb +0 -0
  332. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/html/fast.rb +0 -0
  333. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/html/filter.rb +0 -0
  334. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/html/pretty.rb +0 -0
  335. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/html/safe.rb +0 -0
  336. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/map.rb +0 -0
  337. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/mixins/dispatcher.rb +0 -0
  338. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/mixins/engine_dsl.rb +0 -0
  339. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/mixins/grammar_dsl.rb +0 -0
  340. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/mixins/options.rb +0 -0
  341. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/mixins/template.rb +0 -0
  342. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/parser.rb +0 -0
  343. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/static_analyzer.rb +0 -0
  344. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/templates/rails.rb +0 -0
  345. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/templates/tilt.rb +0 -0
  346. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/templates.rb +0 -0
  347. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/utils.rb +0 -0
  348. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple/version.rb +0 -0
  349. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/lib/temple.rb +0 -0
  350. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/temple-0.8.2/temple.gemspec +0 -0
  351. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/terminal-table-1.8.0/Gemfile +0 -0
  352. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/terminal-table-1.8.0/History.rdoc +0 -0
  353. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/terminal-table-1.8.0/LICENSE.txt +0 -0
  354. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/terminal-table-1.8.0/Manifest +0 -0
  355. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/terminal-table-1.8.0/README.rdoc +0 -0
  356. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/terminal-table-1.8.0/Todo.rdoc +0 -0
  357. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/terminal-table-1.8.0/lib/terminal-table/cell.rb +0 -0
  358. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/terminal-table-1.8.0/lib/terminal-table/import.rb +0 -0
  359. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/terminal-table-1.8.0/lib/terminal-table/row.rb +0 -0
  360. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/terminal-table-1.8.0/lib/terminal-table/separator.rb +0 -0
  361. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/terminal-table-1.8.0/lib/terminal-table/style.rb +0 -0
  362. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/terminal-table-1.8.0/lib/terminal-table/table.rb +0 -0
  363. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/terminal-table-1.8.0/lib/terminal-table/table_helper.rb +0 -0
  364. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/terminal-table-1.8.0/lib/terminal-table/version.rb +0 -0
  365. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/terminal-table-1.8.0/lib/terminal-table.rb +0 -0
  366. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/terminal-table-1.8.0/terminal-table.gemspec +0 -0
  367. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/tilt-2.0.10/COPYING +0 -0
  368. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/tilt-2.0.10/lib/tilt/asciidoc.rb +0 -0
  369. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/tilt-2.0.10/lib/tilt/babel.rb +0 -0
  370. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/tilt-2.0.10/lib/tilt/bluecloth.rb +0 -0
  371. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/tilt-2.0.10/lib/tilt/builder.rb +0 -0
  372. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/tilt-2.0.10/lib/tilt/coffee.rb +0 -0
  373. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/tilt-2.0.10/lib/tilt/commonmarker.rb +0 -0
  374. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/tilt-2.0.10/lib/tilt/creole.rb +0 -0
  375. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/tilt-2.0.10/lib/tilt/csv.rb +0 -0
  376. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/tilt-2.0.10/lib/tilt/dummy.rb +0 -0
  377. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/tilt-2.0.10/lib/tilt/erb.rb +0 -0
  378. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/tilt-2.0.10/lib/tilt/erubi.rb +0 -0
  379. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/tilt-2.0.10/lib/tilt/erubis.rb +0 -0
  380. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/tilt-2.0.10/lib/tilt/etanni.rb +0 -0
  381. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/tilt-2.0.10/lib/tilt/haml.rb +0 -0
  382. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/tilt-2.0.10/lib/tilt/kramdown.rb +0 -0
  383. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/tilt-2.0.10/lib/tilt/less.rb +0 -0
  384. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/tilt-2.0.10/lib/tilt/liquid.rb +0 -0
  385. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/tilt-2.0.10/lib/tilt/livescript.rb +0 -0
  386. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/tilt-2.0.10/lib/tilt/mapping.rb +0 -0
  387. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/tilt-2.0.10/lib/tilt/markaby.rb +0 -0
  388. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/tilt-2.0.10/lib/tilt/maruku.rb +0 -0
  389. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/tilt-2.0.10/lib/tilt/nokogiri.rb +0 -0
  390. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/tilt-2.0.10/lib/tilt/pandoc.rb +0 -0
  391. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/tilt-2.0.10/lib/tilt/plain.rb +0 -0
  392. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/tilt-2.0.10/lib/tilt/prawn.rb +0 -0
  393. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/tilt-2.0.10/lib/tilt/radius.rb +0 -0
  394. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/tilt-2.0.10/lib/tilt/rdiscount.rb +0 -0
  395. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/tilt-2.0.10/lib/tilt/rdoc.rb +0 -0
  396. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/tilt-2.0.10/lib/tilt/redcarpet.rb +0 -0
  397. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/tilt-2.0.10/lib/tilt/redcloth.rb +0 -0
  398. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/tilt-2.0.10/lib/tilt/rst-pandoc.rb +0 -0
  399. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/tilt-2.0.10/lib/tilt/sass.rb +0 -0
  400. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/tilt-2.0.10/lib/tilt/sigil.rb +0 -0
  401. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/tilt-2.0.10/lib/tilt/string.rb +0 -0
  402. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/tilt-2.0.10/lib/tilt/template.rb +0 -0
  403. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/tilt-2.0.10/lib/tilt/typescript.rb +0 -0
  404. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/tilt-2.0.10/lib/tilt/wikicloth.rb +0 -0
  405. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/tilt-2.0.10/lib/tilt/yajl.rb +0 -0
  406. data/bundle/ruby/{2.6.0 → 2.7.0}/gems/tilt-2.0.10/lib/tilt.rb +0 -0
  407. data/bundle/ruby/{2.6.0/gems/unicode-display_width-1.6.0 → 2.7.0/gems/unicode-display_width-1.8.0}/CHANGELOG.md +12 -0
  408. data/bundle/ruby/{2.6.0/gems/unicode-display_width-1.6.0 → 2.7.0/gems/unicode-display_width-1.8.0}/MIT-LICENSE.txt +1 -1
  409. data/bundle/ruby/{2.6.0/gems/unicode-display_width-1.6.0 → 2.7.0/gems/unicode-display_width-1.8.0}/README.md +3 -3
  410. data/bundle/ruby/2.7.0/gems/unicode-display_width-1.8.0/data/display_width.marshal.gz +0 -0
  411. data/bundle/ruby/{2.6.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
  412. data/bundle/ruby/{2.6.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
  413. data/bundle/ruby/{2.6.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
  414. data/bundle/ruby/{2.6.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
  415. data/bundle/ruby/{2.6.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
  416. data/lib/brakeman/app_tree.rb +37 -4
  417. data/lib/brakeman/checks/base_check.rb +30 -11
  418. data/lib/brakeman/checks/check_basic_auth.rb +2 -0
  419. data/lib/brakeman/checks/check_content_tag.rb +1 -2
  420. data/lib/brakeman/checks/check_csrf_token_forgery_cve.rb +28 -0
  421. data/lib/brakeman/checks/check_deserialize.rb +21 -1
  422. data/lib/brakeman/checks/check_detailed_exceptions.rb +1 -1
  423. data/lib/brakeman/checks/check_eol_rails.rb +23 -0
  424. data/lib/brakeman/checks/check_eol_ruby.rb +26 -0
  425. data/lib/brakeman/checks/check_evaluation.rb +1 -1
  426. data/lib/brakeman/checks/check_execute.rb +52 -6
  427. data/lib/brakeman/checks/check_json_entity_escape.rb +38 -0
  428. data/lib/brakeman/checks/check_json_parsing.rb +1 -1
  429. data/lib/brakeman/checks/check_link_to.rb +1 -1
  430. data/lib/brakeman/checks/check_link_to_href.rb +1 -3
  431. data/lib/brakeman/checks/check_mass_assignment.rb +37 -9
  432. data/lib/brakeman/checks/check_model_attr_accessible.rb +1 -1
  433. data/lib/brakeman/checks/check_model_attributes.rb +1 -1
  434. data/lib/brakeman/checks/check_page_caching_cve.rb +37 -0
  435. data/lib/brakeman/checks/check_permit_attributes.rb +1 -1
  436. data/lib/brakeman/checks/check_regex_dos.rb +1 -1
  437. data/lib/brakeman/checks/check_render.rb +15 -1
  438. data/lib/brakeman/checks/check_sanitize_methods.rb +2 -1
  439. data/lib/brakeman/checks/check_skip_before_filter.rb +4 -4
  440. data/lib/brakeman/checks/check_sql.rb +60 -20
  441. data/lib/brakeman/checks/check_symbol_dos.rb +1 -1
  442. data/lib/brakeman/checks/check_template_injection.rb +32 -0
  443. data/lib/brakeman/checks/check_unsafe_reflection_methods.rb +68 -0
  444. data/lib/brakeman/checks/check_verb_confusion.rb +75 -0
  445. data/lib/brakeman/checks/eol_check.rb +47 -0
  446. data/lib/brakeman/commandline.rb +25 -1
  447. data/lib/brakeman/differ.rb +0 -5
  448. data/lib/brakeman/file_parser.rb +58 -22
  449. data/lib/brakeman/options.rb +39 -2
  450. data/lib/brakeman/parsers/template_parser.rb +26 -3
  451. data/lib/brakeman/processors/alias_processor.rb +132 -24
  452. data/lib/brakeman/processors/base_processor.rb +4 -4
  453. data/lib/brakeman/processors/controller_alias_processor.rb +6 -43
  454. data/lib/brakeman/processors/controller_processor.rb +1 -1
  455. data/lib/brakeman/processors/gem_processor.rb +3 -0
  456. data/lib/brakeman/processors/haml_template_processor.rb +17 -1
  457. data/lib/brakeman/processors/lib/call_conversion_helper.rb +13 -7
  458. data/lib/brakeman/processors/lib/file_type_detector.rb +64 -0
  459. data/lib/brakeman/processors/lib/find_all_calls.rb +30 -14
  460. data/lib/brakeman/processors/lib/rails3_config_processor.rb +16 -16
  461. data/lib/brakeman/processors/lib/rails3_route_processor.rb +2 -0
  462. data/lib/brakeman/processors/lib/rails4_config_processor.rb +2 -1
  463. data/lib/brakeman/processors/lib/render_helper.rb +3 -1
  464. data/lib/brakeman/processors/library_processor.rb +9 -0
  465. data/lib/brakeman/processors/model_processor.rb +32 -0
  466. data/lib/brakeman/processors/output_processor.rb +1 -1
  467. data/lib/brakeman/processors/template_alias_processor.rb +5 -0
  468. data/lib/brakeman/report/ignore/config.rb +10 -2
  469. data/lib/brakeman/report/ignore/interactive.rb +1 -1
  470. data/lib/brakeman/report/report_base.rb +0 -2
  471. data/lib/brakeman/report/report_csv.rb +37 -60
  472. data/lib/brakeman/report/report_github.rb +31 -0
  473. data/lib/brakeman/report/report_junit.rb +104 -0
  474. data/lib/brakeman/report/report_markdown.rb +0 -1
  475. data/lib/brakeman/report/report_sarif.rb +133 -0
  476. data/lib/brakeman/report/report_sonar.rb +38 -0
  477. data/lib/brakeman/report/report_tabs.rb +1 -1
  478. data/lib/brakeman/report/report_text.rb +38 -17
  479. data/lib/brakeman/report.rb +22 -1
  480. data/lib/brakeman/rescanner.rb +7 -5
  481. data/lib/brakeman/scanner.rb +65 -31
  482. data/lib/brakeman/tracker/collection.rb +57 -7
  483. data/lib/brakeman/tracker/config.rb +88 -5
  484. data/lib/brakeman/tracker/constants.rb +8 -7
  485. data/lib/brakeman/tracker/controller.rb +1 -1
  486. data/lib/brakeman/tracker/method_info.rb +70 -0
  487. data/lib/brakeman/tracker.rb +42 -5
  488. data/lib/brakeman/util.rb +58 -21
  489. data/lib/brakeman/version.rb +1 -1
  490. data/lib/brakeman/warning.rb +10 -2
  491. data/lib/brakeman/warning_codes.rb +13 -0
  492. data/lib/brakeman.rb +49 -6
  493. data/lib/ruby_parser/bm_sexp.rb +33 -9
  494. metadata +430 -351
  495. data/bundle/ruby/2.6.0/gems/haml-5.1.2/lib/haml/escapable.rb +0 -50
  496. data/bundle/ruby/2.6.0/gems/ruby_parser-3.14.1/debugging.md +0 -18
  497. data/bundle/ruby/2.6.0/gems/ruby_parser-3.14.1/lib/rp_stringscanner.rb +0 -64
  498. data/bundle/ruby/2.6.0/gems/ruby_parser-3.14.1/lib/ruby20_parser.rb +0 -7045
  499. data/bundle/ruby/2.6.0/gems/ruby_parser-3.14.1/lib/ruby21_parser.rb +0 -7116
  500. data/bundle/ruby/2.6.0/gems/ruby_parser-3.14.1/lib/ruby22_parser.rb +0 -7149
  501. data/bundle/ruby/2.6.0/gems/ruby_parser-3.14.1/lib/ruby23_parser.rb +0 -7166
  502. data/bundle/ruby/2.6.0/gems/ruby_parser-3.14.1/lib/ruby24_parser.rb +0 -7178
  503. data/bundle/ruby/2.6.0/gems/ruby_parser-3.14.1/lib/ruby25_parser.rb +0 -7178
  504. data/bundle/ruby/2.6.0/gems/ruby_parser-3.14.1/lib/ruby26_parser.rb +0 -7198
  505. data/bundle/ruby/2.6.0/gems/unicode-display_width-1.6.0/data/display_width.marshal.gz +0 -0
@@ -18,7 +18,7 @@ token kCLASS kMODULE kDEF kUNDEF kBEGIN kRESCUE kENSURE kEND kIF kUNLESS
18
18
  tBACK_REF2 tSYMBEG tSTRING_BEG tXSTRING_BEG tREGEXP_BEG
19
19
  tWORDS_BEG tQWORDS_BEG tSTRING_DBEG tSTRING_DVAR tSTRING_END
20
20
  tSTRING tSYMBOL tNL tEH tCOLON tCOMMA tSPACE tSEMI tLAMBDA
21
- tLAMBEG tDSTAR tCHAR tSYMBOLS_BEG tQSYMBOLS_BEG tSTRING_DEND tUBANG
21
+ tLAMBEG tDSTAR tCHAR tSYMBOLS_BEG tQSYMBOLS_BEG tSTRING_DEND
22
22
  tRATIONAL tIMAGINARY
23
23
  tLABEL_END
24
24
 
@@ -32,7 +32,7 @@ preclow
32
32
  right tEQL tOP_ASGN
33
33
  left kRESCUE_MOD
34
34
  right tEH tCOLON
35
- nonassoc tDOT2 tDOT3
35
+ nonassoc tDOT2 tDOT3 tBDOT2 tBDOT3
36
36
  left tOROP
37
37
  left tANDOP
38
38
  nonassoc tCMP tEQ tEQQ tNEQ tMATCH tNMATCH
@@ -55,6 +55,9 @@ rule
55
55
  top_compstmt
56
56
  {
57
57
  result = new_compstmt val
58
+
59
+ lexer.cond.pop # local_pop
60
+ lexer.cmdarg.pop
58
61
  }
59
62
 
60
63
  top_compstmt: top_stmts opt_terms
@@ -75,7 +78,7 @@ rule
75
78
  | klBEGIN
76
79
  {
77
80
  if (self.in_def || self.in_single > 0) then
78
- debug20 1
81
+ debug 11
79
82
  yyerror "BEGIN in method"
80
83
  end
81
84
  self.env.extend
@@ -100,7 +103,9 @@ rule
100
103
  bodystmt: compstmt opt_rescue k_else
101
104
  {
102
105
  res = _values[-2]
103
- yyerror "else without rescue is useless" unless res
106
+ # TODO: move down to main match so I can just use val
107
+
108
+ warn "else without rescue is useless" unless res
104
109
  }
105
110
  compstmt
106
111
  opt_ensure
@@ -130,7 +135,7 @@ rule
130
135
  | error stmt
131
136
  {
132
137
  result = val[1]
133
- debug20 2, val, result
138
+ debug 12
134
139
  }
135
140
 
136
141
  stmt_or_begin: stmt
@@ -138,6 +143,10 @@ rule
138
143
  {
139
144
  yyerror "BEGIN is permitted only at toplevel"
140
145
  }
146
+ begin_block
147
+ {
148
+ result = val[2] # wtf?
149
+ }
141
150
 
142
151
  stmt: kALIAS fitem
143
152
  {
@@ -150,12 +159,12 @@ rule
150
159
  }
151
160
  | kALIAS tGVAR tGVAR
152
161
  {
153
- (_, line), lhs, rhs = val
162
+ (_, line), (lhs, _), (rhs, _) = val
154
163
  result = s(:valias, lhs.to_sym, rhs.to_sym).line line
155
164
  }
156
165
  | kALIAS tGVAR tBACK_REF
157
166
  {
158
- (_, line), lhs, rhs = val
167
+ (_, line), (lhs, _), (rhs, _) = val
159
168
  result = s(:valias, lhs.to_sym, :"$#{rhs}").line line
160
169
  }
161
170
  | kALIAS tGVAR tNTH_REF
@@ -198,7 +207,7 @@ rule
198
207
  (_, line), _, stmt, _ = val
199
208
 
200
209
  if (self.in_def || self.in_single > 0) then
201
- debug20 3
210
+ debug 13
202
211
  yyerror "END in method; use at_exit"
203
212
  end
204
213
 
@@ -238,30 +247,31 @@ rule
238
247
  }
239
248
  | primary_value call_op tIDENTIFIER tOP_ASGN command_rhs
240
249
  {
241
- prim, _, id, opasgn, rhs = val
242
- result = s(:op_asgn, prim, rhs, id.to_sym, opasgn.to_sym)
243
- if val[1] == '&.'
244
- result.sexp_type = :safe_op_asgn
245
- end
246
- result.line = val[0].line
250
+ prim, (call_op, _), (id, _), (op_asgn, _), rhs = val
251
+
252
+ result = s(:op_asgn, prim, rhs, id.to_sym, op_asgn.to_sym)
253
+ result.sexp_type = :safe_op_asgn if call_op == '&.'
254
+ result.line prim.line
247
255
  }
248
256
  | primary_value call_op tCONSTANT tOP_ASGN command_rhs
249
257
  {
250
- result = s(:op_asgn, val[0], val[4], val[2].to_sym, val[3].to_sym)
251
- if val[1] == '&.'
252
- result.sexp_type = :safe_op_asgn
253
- end
254
- result.line = val[0].line
258
+ prim, (call_op, _), (id, _), (op_asgn, _), rhs = val
259
+
260
+ result = s(:op_asgn, prim, rhs, id.to_sym, op_asgn.to_sym)
261
+ result.sexp_type = :safe_op_asgn if call_op == '&.'
262
+ result.line prim.line
255
263
  }
256
264
  | primary_value tCOLON2 tCONSTANT tOP_ASGN command_rhs
257
265
  {
258
- result = s(:op_asgn, val[0], val[4], val[2], val[3])
259
- debug20 4, val, result
266
+ lhs1, _, (lhs2, line), (id, _), rhs = val
267
+
268
+ result = s(:op_asgn, lhs1, rhs, lhs2.to_sym, id.to_sym).line line
260
269
  }
261
270
  | primary_value tCOLON2 tIDENTIFIER tOP_ASGN command_rhs
262
271
  {
263
- result = s(:op_asgn, val[0], val[4], val[2], val[3])
264
- debug20 5, val, result
272
+ lhs1, _, (lhs2, line), (id, _), rhs = val
273
+
274
+ result = s(:op_asgn, lhs1, rhs, lhs2.to_sym, id.to_sym).line line
265
275
  }
266
276
  | backref tOP_ASGN command_rhs
267
277
  {
@@ -299,7 +309,7 @@ rule
299
309
  # TODO: fix line number to tBANG... but causes BAD shift/reduce conflict
300
310
  # REFACTOR: call_uni_op -- see parse26.y
301
311
  }
302
- | arg
312
+ | arg =tLBRACE_ARG
303
313
 
304
314
  expr_value: expr
305
315
  {
@@ -324,7 +334,7 @@ rule
324
334
  block_command: block_call
325
335
  | block_call call_op2 operation2 command_args
326
336
  {
327
- blk, _, msg, args = val
337
+ blk, _, (msg, _line), args = val
328
338
  result = new_call(blk, msg.to_sym, args).line blk.line
329
339
  }
330
340
 
@@ -338,15 +348,15 @@ rule
338
348
  _, line, body, _ = val
339
349
 
340
350
  result = body
341
- result.line = line
351
+ result.line line
342
352
 
343
353
  # self.env.unextend
344
354
  }
345
355
 
346
356
  fcall: operation
347
357
  {
348
- msg, = val
349
- result = new_call(nil, msg.to_sym).line lexer.lineno
358
+ (msg, line), = val
359
+ result = new_call(nil, msg.to_sym).line line
350
360
  }
351
361
 
352
362
  command: fcall command_args =tLOWEST
@@ -369,12 +379,14 @@ rule
369
379
  }
370
380
  | primary_value call_op operation2 command_args =tLOWEST
371
381
  {
372
- lhs, callop, op, args = val
382
+ lhs, callop, (op, _), args = val
383
+
373
384
  result = new_call lhs, op.to_sym, args, callop
385
+ result.line lhs.line
374
386
  }
375
387
  | primary_value call_op operation2 command_args cmd_brace_block
376
388
  {
377
- recv, _, msg, args, block = val
389
+ recv, _, (msg, _line), args, block = val
378
390
  call = new_call recv, msg.to_sym, args, val[1]
379
391
 
380
392
  block_dup_check call, block
@@ -384,11 +396,14 @@ rule
384
396
  }
385
397
  | primary_value tCOLON2 operation2 command_args =tLOWEST
386
398
  {
387
- result = new_call val[0], val[2].to_sym, val[3]
399
+ lhs, _, (id, line), args = val
400
+
401
+ result = new_call lhs, id.to_sym, args
402
+ result.line line
388
403
  }
389
404
  | primary_value tCOLON2 operation2 command_args cmd_brace_block
390
405
  {
391
- recv, _, msg, args, block = val
406
+ recv, _, (msg, _line), args, block = val
392
407
  call = new_call recv, msg.to_sym, args
393
408
 
394
409
  block_dup_check call, block
@@ -546,25 +561,29 @@ rule
546
561
  }
547
562
  | primary_value call_op tIDENTIFIER
548
563
  {
549
- result = new_attrasgn val[0], val[2], val[1]
564
+ lhs, call_op, (id, _line) = val
565
+
566
+ result = new_attrasgn lhs, id, call_op
550
567
  }
551
568
  | primary_value tCOLON2 tIDENTIFIER
552
569
  {
553
- recv, _, id = val
570
+ recv, _, (id, _line) = val
554
571
  result = new_attrasgn recv, id
555
572
  }
556
573
  | primary_value call_op tCONSTANT
557
574
  {
558
- result = new_attrasgn val[0], val[2], val[1]
575
+ lhs, call_op, (id, _line) = val
576
+
577
+ result = new_attrasgn lhs, id, call_op
559
578
  }
560
579
  | primary_value tCOLON2 tCONSTANT
561
580
  {
562
581
  if (self.in_def || self.in_single > 0) then
563
- debug20 7
582
+ debug 14
564
583
  yyerror "dynamic constant assignment"
565
584
  end
566
585
 
567
- expr, _, id = val
586
+ expr, _, (id, _line) = val
568
587
  l = expr.line
569
588
 
570
589
  result = s(:const, s(:colon2, expr, id.to_sym).line(l), nil).line l
@@ -572,58 +591,65 @@ rule
572
591
  | tCOLON3 tCONSTANT
573
592
  {
574
593
  if (self.in_def || self.in_single > 0) then
575
- debug20 8
594
+ debug 15
576
595
  yyerror "dynamic constant assignment"
577
596
  end
578
597
 
579
- _, id = val
580
- l = lexer.lineno
598
+ _, (id, l) = val
581
599
 
582
600
  result = s(:const, nil, s(:colon3, id.to_sym).line(l)).line l
583
601
  }
584
602
  | backref
585
603
  {
586
- self.backref_assign_error val[0]
604
+ ref, = val
605
+
606
+ self.backref_assign_error ref
587
607
  }
588
608
 
589
609
  lhs: user_variable
590
610
  {
591
- line = lexer.lineno
592
- result = self.assignable val[0]
593
- result.line = line
611
+ var, = val
612
+
613
+ result = self.assignable var
594
614
  }
595
615
  | keyword_variable
596
616
  {
597
- line = lexer.lineno
598
- result = self.assignable val[0]
599
- result.line = line
600
- debug20 9, val, result
617
+ var, = val
618
+
619
+ result = self.assignable var
620
+
621
+ debug 16
601
622
  }
602
623
  | primary_value tLBRACK2 opt_call_args rbracket
603
624
  {
604
625
  lhs, _, args, _ = val
626
+
605
627
  result = self.aryset lhs, args
606
628
  }
607
629
  | primary_value call_op tIDENTIFIER # REFACTOR
608
630
  {
609
- lhs, op, id = val
631
+ lhs, op, (id, _line) = val
632
+
610
633
  result = new_attrasgn lhs, id, op
611
634
  }
612
635
  | primary_value tCOLON2 tIDENTIFIER
613
636
  {
614
- lhs, _, id = val
637
+ lhs, _, (id, _line) = val
638
+
615
639
  result = new_attrasgn lhs, id
616
640
  }
617
641
  | primary_value call_op tCONSTANT # REFACTOR?
618
642
  {
619
- result = new_attrasgn val[0], val[2], val[1]
643
+ lhs, call_op, (id, _line) = val
644
+
645
+ result = new_attrasgn lhs, id, call_op
620
646
  }
621
647
  | primary_value tCOLON2 tCONSTANT
622
648
  {
623
- expr, _, id = val
649
+ expr, _, (id, _line) = val
624
650
 
625
651
  if (self.in_def || self.in_single > 0) then
626
- debug20 10
652
+ debug 17
627
653
  yyerror "dynamic constant assignment"
628
654
  end
629
655
 
@@ -632,14 +658,13 @@ rule
632
658
  }
633
659
  | tCOLON3 tCONSTANT
634
660
  {
635
- _, id = val
661
+ _, (id, l) = val
636
662
 
637
663
  if (self.in_def || self.in_single > 0) then
638
- debug20 11
664
+ debug 18
639
665
  yyerror "dynamic constant assignment"
640
666
  end
641
667
 
642
- l = lexer.lineno
643
668
  result = s(:const, s(:colon3, id.to_sym).line(l)).line l
644
669
  }
645
670
  | backref
@@ -655,16 +680,17 @@ rule
655
680
 
656
681
  cpath: tCOLON3 cname
657
682
  {
658
- _, name = val
659
- result = s(:colon3, name.to_sym).line lexer.lineno
683
+ _, (name, line) = val
684
+ result = s(:colon3, name.to_sym).line line
660
685
  }
661
686
  | cname
662
687
  {
663
- result = val[0].to_sym
688
+ (id, line), = val
689
+ result = [id.to_sym, line] # TODO: sexp?
664
690
  }
665
691
  | primary_value tCOLON2 cname
666
692
  {
667
- pval, _, name = val
693
+ pval, _, (name, _line) = val
668
694
 
669
695
  result = s(:colon2, pval, name.to_sym)
670
696
  result.line pval.line
@@ -674,24 +700,17 @@ rule
674
700
  | op
675
701
  {
676
702
  lexer.lex_state = EXPR_END
677
- result = val[0]
678
703
  }
679
704
 
680
705
  | reswords
681
- {
682
- (sym, _line), = val
683
- lexer.lex_state = EXPR_END
684
- result = sym
685
- }
686
-
687
- fsym: fname | symbol
688
706
 
689
- fitem: fsym
707
+ fitem: fname
690
708
  {
691
- id, = val
692
- result = s(:lit, id.to_sym).line lexer.lineno
709
+ (id, line), = val
710
+
711
+ result = s(:lit, id.to_sym).line line
693
712
  }
694
- | dsym
713
+ | symbol
695
714
 
696
715
  undef_list: fitem
697
716
  {
@@ -712,8 +731,6 @@ rule
712
731
  | tNEQ | tLSHFT | tRSHFT | tPLUS | tMINUS | tSTAR2
713
732
  | tSTAR | tDIVIDE | tPERCENT | tPOW | tDSTAR | tBANG | tTILDE
714
733
  | tUPLUS | tUMINUS | tAREF | tASET | tBACK_REF2
715
- # TODO: tUBANG dead?
716
- | tUBANG
717
734
 
718
735
  reswords: k__LINE__ | k__FILE__ | k__ENCODING__ | klBEGIN | klEND
719
736
  | kALIAS | kAND | kBEGIN | kBREAK | kCASE
@@ -747,24 +764,20 @@ rule
747
764
  }
748
765
  | primary_value tCOLON2 tIDENTIFIER tOP_ASGN arg_rhs
749
766
  {
750
- lhs, _, id, op, rhs = val
767
+ lhs, _, (id, _line), (op, _), rhs = val
751
768
 
752
769
  result = s(:op_asgn, lhs, rhs, id.to_sym, op.to_sym).line lhs.line
753
770
  }
754
771
  | primary_value tCOLON2 tCONSTANT tOP_ASGN arg_rhs
755
772
  {
756
- lhs1, _, lhs2, op, rhs = val
773
+ lhs1, _, (lhs2, _line), op, rhs = val
757
774
 
758
775
  lhs = s(:colon2, lhs1, lhs2.to_sym).line lhs1.line
759
776
  result = new_const_op_asgn [lhs, op, rhs]
760
777
  }
761
- | tCOLON3 tCONSTANT
762
- {
763
- result = self.lexer.lineno
764
- }
765
- tOP_ASGN arg_rhs
778
+ | tCOLON3 tCONSTANT tOP_ASGN arg_rhs
766
779
  {
767
- _, lhs, line, op, rhs = val
780
+ _, (lhs, line), op, rhs = val
768
781
 
769
782
  lhs = s(:colon3, lhs.to_sym).line line
770
783
  result = new_const_op_asgn [lhs, op, rhs]
@@ -778,7 +791,7 @@ rule
778
791
  | arg tDOT2 arg
779
792
  {
780
793
  v1, v2 = val[0], val[2]
781
- if v1.node_type == :lit and v2.node_type == :lit and Integer === v1.last and Integer === v2.last then
794
+ if v1.sexp_type == :lit and v2.sexp_type == :lit and Integer === v1.last and Integer === v2.last then
782
795
  result = s(:lit, (v1.last)..(v2.last)).line v1.line
783
796
  else
784
797
  result = s(:dot2, v1, v2).line v1.line
@@ -787,12 +800,14 @@ rule
787
800
  | arg tDOT3 arg
788
801
  {
789
802
  v1, v2 = val[0], val[2]
790
- if v1.node_type == :lit and v2.node_type == :lit and Integer === v1.last and Integer === v2.last then
803
+ if v1.sexp_type == :lit and v2.sexp_type == :lit and Integer === v1.last and Integer === v2.last then
791
804
  result = s(:lit, (v1.last)...(v2.last)).line v1.line
792
805
  else
793
806
  result = s(:dot3, v1, v2).line v1.line
794
807
  end
795
808
  }
809
+
810
+
796
811
  | arg tPLUS arg
797
812
  {
798
813
  result = new_call val[0], :+, argl(val[2])
@@ -819,8 +834,9 @@ rule
819
834
  }
820
835
  | tUMINUS_NUM simple_numeric tPOW arg
821
836
  {
822
- lit = s(:lit, val[1]).line lexer.lineno
823
- result = new_call(new_call(lit, :"**", argl(val[3])), :"-@")
837
+ _, (num, line), _, arg = val
838
+ lit = s(:lit, num).line line
839
+ result = new_call(new_call(lit, :"**", argl(arg)), :"-@")
824
840
 
825
841
  }
826
842
  | tUPLUS arg
@@ -919,12 +935,12 @@ rule
919
935
 
920
936
  rel_expr: arg relop arg =tGT
921
937
  {
922
- lhs, op, rhs = val
938
+ lhs, (op, _), rhs = val
923
939
  result = new_call lhs, op.to_sym, argl(rhs)
924
940
  }
925
941
  | rel_expr relop arg =tGT
926
942
  {
927
- lhs, op, rhs = val
943
+ lhs, (op, _), rhs = val
928
944
  warn "comparison '%s' after comparison", op
929
945
  result = new_call lhs, op.to_sym, argl(rhs)
930
946
  }
@@ -991,17 +1007,14 @@ rule
991
1007
  | args opt_block_arg
992
1008
  {
993
1009
  result = call_args val
994
- result = self.arg_blk_pass val[0], val[1]
995
1010
  }
996
1011
  | assocs opt_block_arg
997
1012
  {
998
- result = call_args [array_to_hash(val[0])]
999
- result = self.arg_blk_pass result, val[1]
1013
+ result = call_args [array_to_hash(val[0]), val[1]]
1000
1014
  }
1001
1015
  | args tCOMMA assocs opt_block_arg
1002
1016
  {
1003
- result = call_args [val[0], array_to_hash(val[2])]
1004
- result = self.arg_blk_pass result, val[3]
1017
+ result = call_args [val[0], array_to_hash(val[2]), val[3]]
1005
1018
  }
1006
1019
  | block_arg
1007
1020
  {
@@ -1009,12 +1022,39 @@ rule
1009
1022
  }
1010
1023
 
1011
1024
  command_args: {
1012
- result = lexer.cmdarg.store true
1025
+ # parse26.y line 2200
1026
+
1027
+ # If call_args starts with a open paren '(' or
1028
+ # '[', look-ahead reading of the letters calls
1029
+ # CMDARG_PUSH(0), but the push must be done
1030
+ # after CMDARG_PUSH(1). So this code makes them
1031
+ # consistent by first cancelling the premature
1032
+ # CMDARG_PUSH(0), doing CMDARG_PUSH(1), and
1033
+ # finally redoing CMDARG_PUSH(0).
1034
+
1035
+ result = yychar = self.last_token_type.first
1036
+ lookahead = [:tLPAREN, :tLPAREN_ARG, :tLPAREN2, :tLBRACK, :tLBRACK2].include?(yychar)
1037
+ lexer.cmdarg.pop if lookahead
1038
+ lexer.cmdarg.push true
1039
+ lexer.cmdarg.push false if lookahead
1013
1040
  }
1014
1041
  call_args
1015
1042
  {
1016
- lexer.cmdarg.restore val[0]
1017
- result = val[1]
1043
+ yychar, args = val
1044
+
1045
+ # call_args can be followed by tLBRACE_ARG (that
1046
+ # does CMDARG_PUSH(0) in the lexer) but the push
1047
+ # must be done after CMDARG_POP() in the parser.
1048
+ # So this code does CMDARG_POP() to pop 0 pushed
1049
+ # by tLBRACE_ARG, CMDARG_POP() to pop 1 pushed
1050
+ # by command_args, and CMDARG_PUSH(0) to restore
1051
+ # back the flag set by tLBRACE_ARG.
1052
+
1053
+ lookahead = [:tLBRACE_ARG].include?(yychar)
1054
+ lexer.cmdarg.pop if lookahead
1055
+ lexer.cmdarg.pop
1056
+ lexer.cmdarg.push false if lookahead
1057
+ result = args
1018
1058
  }
1019
1059
 
1020
1060
  block_arg: tAMPER arg_value
@@ -1032,8 +1072,9 @@ rule
1032
1072
  args: arg_value
1033
1073
  {
1034
1074
  arg, = val
1075
+ lineno = arg.line || lexer.lineno # HACK
1035
1076
 
1036
- result = s(:array, arg).line arg.line
1077
+ result = s(:array, arg).line lineno
1037
1078
  }
1038
1079
  | tSTAR arg_value
1039
1080
  {
@@ -1045,9 +1086,11 @@ rule
1045
1086
  args, _, id = val
1046
1087
  result = self.list_append args, id
1047
1088
  }
1048
- | args tCOMMA tSTAR { result = lexer.lineno } arg_value
1089
+ | args tCOMMA tSTAR arg_value
1049
1090
  {
1050
- args, _, _, line, id = val
1091
+ # TODO: the line number from tSTAR has been dropped
1092
+ args, _, _, id = val
1093
+ line = lexer.lineno
1051
1094
  result = self.list_append args, s(:splat, id).line(line)
1052
1095
  }
1053
1096
 
@@ -1066,7 +1109,6 @@ rule
1066
1109
  }
1067
1110
  | args tCOMMA tSTAR arg_value
1068
1111
  {
1069
- # FIX: bad shift/reduce conflict with rhs' comma star prod
1070
1112
  # TODO: make all tXXXX terminals include lexer.lineno
1071
1113
  arg, _, _, splat = val
1072
1114
  result = self.arg_concat arg, splat
@@ -1089,26 +1131,19 @@ rule
1089
1131
  | backref
1090
1132
  | tFID
1091
1133
  {
1092
- msg, = val
1134
+ (msg, line), = val
1093
1135
  result = new_call nil, msg.to_sym
1136
+ result.line line
1094
1137
  }
1095
1138
  | k_begin
1096
1139
  {
1140
+ lexer.cmdarg.push false
1097
1141
  result = self.lexer.lineno
1098
- # TODO:
1099
- # $<val>1 = cmdarg_stack;
1100
- # CMDARG_SET(0);
1101
1142
  }
1102
1143
  bodystmt k_end
1103
1144
  {
1104
- # TODO: CMDARG_SET($<val>1);
1105
- unless val[2] then
1106
- result = s(:nil)
1107
- else
1108
- result = s(:begin, val[2])
1109
- end
1110
-
1111
- result.line = val[1]
1145
+ lexer.cmdarg.pop
1146
+ result = new_begin val
1112
1147
  }
1113
1148
  | tLPAREN_ARG
1114
1149
  {
@@ -1121,18 +1156,14 @@ rule
1121
1156
  result = s(:begin).line line
1122
1157
  }
1123
1158
  | tLPAREN_ARG
1124
- {
1125
- result = lexer.cmdarg.store false
1126
- }
1127
1159
  stmt
1128
1160
  {
1129
1161
  lexer.lex_state = EXPR_ENDARG
1130
1162
  }
1131
1163
  rparen
1132
1164
  {
1133
- _, cmdarg, stmt, _, _, = val
1134
- warning "(...) interpreted as grouped expression"
1135
- lexer.cmdarg.restore cmdarg
1165
+ _, stmt, _, _, = val
1166
+ # warning "(...) interpreted as grouped expression"
1136
1167
  result = stmt
1137
1168
  }
1138
1169
  | tLPAREN compstmt tRPAREN
@@ -1144,15 +1175,15 @@ rule
1144
1175
  }
1145
1176
  | primary_value tCOLON2 tCONSTANT
1146
1177
  {
1147
- expr, _, id = val
1178
+ expr, _, (id, _line) = val
1148
1179
 
1149
1180
  result = s(:colon2, expr, id.to_sym).line expr.line
1150
1181
  }
1151
1182
  | tCOLON3 tCONSTANT
1152
1183
  {
1153
- _, id = val
1184
+ _, (id, line) = val
1154
1185
 
1155
- result = s(:colon3, id.to_sym).line lexer.lineno
1186
+ result = s(:colon3, id.to_sym).line line
1156
1187
  }
1157
1188
  | tLBRACK { result = lexer.lineno } aref_args tRBRACK
1158
1189
  {
@@ -1176,15 +1207,21 @@ rule
1176
1207
  }
1177
1208
  | kYIELD tLPAREN2 call_args rparen
1178
1209
  {
1179
- result = new_yield val[2]
1210
+ (_, line), _, args, _ = val
1211
+
1212
+ result = new_yield(args).line line
1180
1213
  }
1181
1214
  | kYIELD tLPAREN2 rparen
1182
1215
  {
1183
- result = new_yield
1216
+ (_, line), _, _ = val
1217
+
1218
+ result = new_yield.line line
1184
1219
  }
1185
1220
  | kYIELD
1186
1221
  {
1187
- result = new_yield
1222
+ (_, line), = val
1223
+
1224
+ result = new_yield.line line
1188
1225
  }
1189
1226
  | kDEFINED opt_nl tLPAREN2 expr rparen
1190
1227
  {
@@ -1199,7 +1236,7 @@ rule
1199
1236
  }
1200
1237
  | kNOT tLPAREN2 rparen
1201
1238
  {
1202
- debug20 14, val, result
1239
+ debug 20
1203
1240
  }
1204
1241
  | fcall brace_block
1205
1242
  {
@@ -1217,9 +1254,10 @@ rule
1217
1254
  iter.insert 1, call # FIX
1218
1255
  result = iter
1219
1256
  }
1220
- | tLAMBDA lambda
1257
+ | lambda
1221
1258
  {
1222
- result = val[1] # TODO: fix lineno
1259
+ expr, = val
1260
+ result = expr
1223
1261
  }
1224
1262
  | k_if expr_value then compstmt if_tail k_end
1225
1263
  {
@@ -1262,7 +1300,6 @@ rule
1262
1300
  }
1263
1301
  cpath superclass
1264
1302
  {
1265
- self.comments.push self.lexer.comments
1266
1303
  if (self.in_def || self.in_single > 0) then
1267
1304
  yyerror "class definition in method body"
1268
1305
  end
@@ -1272,7 +1309,7 @@ rule
1272
1309
  {
1273
1310
  result = new_class val
1274
1311
  self.env.unextend
1275
- self.lexer.comments # we don't care about comments in the body
1312
+ self.lexer.ignore_body_comments
1276
1313
  }
1277
1314
  | k_class tLSHFT
1278
1315
  {
@@ -1293,7 +1330,7 @@ rule
1293
1330
  {
1294
1331
  result = new_sclass val
1295
1332
  self.env.unextend
1296
- self.lexer.comments # we don't care about comments in the body
1333
+ self.lexer.ignore_body_comments
1297
1334
  }
1298
1335
  | k_module
1299
1336
  {
@@ -1301,7 +1338,6 @@ rule
1301
1338
  }
1302
1339
  cpath
1303
1340
  {
1304
- self.comments.push self.lexer.comments
1305
1341
  yyerror "module definition in method body" if
1306
1342
  self.in_def or self.in_single > 0
1307
1343
 
@@ -1311,53 +1347,67 @@ rule
1311
1347
  {
1312
1348
  result = new_module val
1313
1349
  self.env.unextend
1314
- self.lexer.comments # we don't care about comments in the body
1350
+ self.lexer.ignore_body_comments
1315
1351
  }
1316
1352
  | k_def fname
1317
1353
  {
1318
- result = [self.in_def, self.lexer.cmdarg.stack.dup]
1354
+ result = self.in_def
1319
1355
 
1320
- self.comments.push self.lexer.comments
1321
- self.in_def = true
1356
+ self.in_def = true # group = local_push
1322
1357
  self.env.extend
1323
- # TODO: local->cmdargs = cmdarg_stack;
1324
- # TODO: port local_push_gen and local_pop_gen
1325
- lexer.cmdarg.stack.replace [false]
1358
+ lexer.cmdarg.push false
1359
+ lexer.cond.push false
1326
1360
  }
1327
- f_arglist bodystmt { result = lexer.lineno } k_end
1361
+ f_arglist bodystmt k_end
1328
1362
  {
1329
- in_def, cmdarg = val[2]
1330
-
1331
- result = new_defn val
1363
+ result, in_def = new_defn val
1332
1364
 
1333
- lexer.cmdarg.stack.replace cmdarg
1365
+ lexer.cond.pop # group = local_pop
1366
+ lexer.cmdarg.pop
1334
1367
  self.env.unextend
1335
1368
  self.in_def = in_def
1336
- self.lexer.comments # we don't care about comments in the body
1369
+
1370
+ self.lexer.ignore_body_comments
1337
1371
  }
1338
1372
  | k_def singleton dot_or_colon
1339
1373
  {
1340
- self.comments.push self.lexer.comments
1341
1374
  lexer.lex_state = EXPR_FNAME
1342
1375
  }
1343
1376
  fname
1344
1377
  {
1345
- self.in_single += 1
1378
+ result = self.in_def
1379
+
1380
+ self.in_single += 1 # TODO: remove?
1381
+
1382
+ self.in_def = true # local_push
1346
1383
  self.env.extend
1347
- lexer.lex_state = EXPR_ENDFN # force for args
1348
- result = [lexer.lineno, self.lexer.cmdarg.stack.dup]
1349
- lexer.cmdarg.stack.replace [false]
1384
+ lexer.cmdarg.push false
1385
+ lexer.cond.push false
1386
+
1387
+ lexer.lex_state = EXPR_ENDFN|EXPR_LABEL
1350
1388
  }
1351
1389
  f_arglist bodystmt k_end
1352
1390
  {
1353
- _, cmdarg = val[5]
1354
- result = new_defs val
1355
1391
 
1356
- lexer.cmdarg.stack.replace cmdarg
1392
+ # [kdef, recv, _, _, (name, line), in_def, args, body, kend]
1393
+ # =>
1394
+ # [kdef, recv, (name, line), in_def, args, body, kend]
1357
1395
 
1396
+ val.delete_at 3
1397
+ val.delete_at 2
1398
+
1399
+ result, in_def = new_defs val
1400
+
1401
+ lexer.cond.pop # group = local_pop
1402
+ lexer.cmdarg.pop
1358
1403
  self.env.unextend
1404
+ self.in_def = in_def
1405
+
1359
1406
  self.in_single -= 1
1360
- self.lexer.comments # we don't care about comments in the body
1407
+
1408
+ # TODO: restore cur_arg ? what's cur_arg?
1409
+
1410
+ self.lexer.ignore_body_comments
1361
1411
  }
1362
1412
  | kBREAK
1363
1413
  {
@@ -1394,8 +1444,17 @@ rule
1394
1444
  k_case: kCASE
1395
1445
  k_for: kFOR
1396
1446
  k_class: kCLASS
1447
+ {
1448
+ self.comments.push self.lexer.comments
1449
+ }
1397
1450
  k_module: kMODULE
1451
+ {
1452
+ self.comments.push self.lexer.comments
1453
+ }
1398
1454
  k_def: kDEF
1455
+ {
1456
+ self.comments.push self.lexer.comments
1457
+ }
1399
1458
  k_do: kDO
1400
1459
  k_do_block: kDO_BLOCK
1401
1460
  k_rescue: kRESCUE
@@ -1456,51 +1515,42 @@ rule
1456
1515
 
1457
1516
  result = block_var args
1458
1517
  }
1459
- | f_marg_list tCOMMA tSTAR f_norm_arg
1518
+ | f_marg_list tCOMMA f_rest_marg
1460
1519
  {
1461
- args, _, _, splat = val
1520
+ args, _, rest = val
1462
1521
 
1463
- result = block_var args, "*#{splat}".to_sym
1522
+ result = block_var args, rest
1464
1523
  }
1465
- | f_marg_list tCOMMA tSTAR f_norm_arg tCOMMA f_marg_list
1524
+ | f_marg_list tCOMMA f_rest_marg tCOMMA f_marg_list
1466
1525
  {
1467
- args, _, _, splat, _, args2 = val
1526
+ lhs, _, splat, _, rhs = val
1468
1527
 
1469
- result = block_var args, "*#{splat}".to_sym, args2
1528
+ result = block_var lhs, splat, rhs
1470
1529
  }
1471
- | f_marg_list tCOMMA tSTAR
1530
+ | f_rest_marg
1472
1531
  {
1473
- args, _, _ = val
1532
+ rest, = val
1474
1533
 
1475
- result = block_var args, :*
1534
+ result = block_var rest
1476
1535
  }
1477
- | f_marg_list tCOMMA tSTAR tCOMMA f_marg_list
1536
+ | f_rest_marg tCOMMA f_marg_list
1478
1537
  {
1479
- args, _, _, _, args2 = val
1538
+ splat, _, rest = val
1480
1539
 
1481
- result = block_var args, :*, args2
1540
+ result = block_var splat, rest
1482
1541
  }
1483
- | tSTAR f_norm_arg
1484
- {
1485
- _, splat = val
1486
1542
 
1487
- result = block_var :"*#{splat}"
1488
- }
1489
- | tSTAR f_norm_arg tCOMMA f_marg_list
1543
+ f_rest_marg: tSTAR f_norm_arg
1490
1544
  {
1491
- _, splat, _, args = val
1545
+ _, (id, line) = val
1492
1546
 
1493
- result = block_var :"*#{splat}", args
1547
+ result = args ["*#{id}".to_sym]
1548
+ result.line line
1494
1549
  }
1495
1550
  | tSTAR
1496
1551
  {
1497
- result = block_var :*
1498
- }
1499
- | tSTAR tCOMMA f_marg_list
1500
- {
1501
- _, _, args = val
1502
-
1503
- result = block_var :*, args
1552
+ result = args [:*]
1553
+ result.line lexer.lineno # FIX: tSTAR -> line
1504
1554
  }
1505
1555
 
1506
1556
  block_args_tail: f_block_kwarg tCOMMA f_kwrest opt_f_block_arg
@@ -1517,8 +1567,8 @@ rule
1517
1567
  }
1518
1568
  | f_block_arg
1519
1569
  {
1520
- line = lexer.lineno
1521
- result = call_args val # TODO: push line down
1570
+ (id, line), = val
1571
+ result = call_args [id]
1522
1572
  result.line line
1523
1573
  }
1524
1574
 
@@ -1627,13 +1677,13 @@ opt_block_args_tail: tCOMMA block_args_tail
1627
1677
 
1628
1678
  bvar: tIDENTIFIER
1629
1679
  {
1630
- id, = val
1631
- line = lexer.lineno
1680
+ (id, line), = val
1632
1681
  result = s(:shadow, id.to_sym).line line
1633
1682
  }
1634
1683
  | f_bad_arg
1635
1684
 
1636
- lambda: {
1685
+ lambda: tLAMBDA
1686
+ {
1637
1687
  self.env.extend :dynamic
1638
1688
  result = [lexer.lineno, lexer.lpar_beg]
1639
1689
  lexer.paren_nest += 1
@@ -1641,20 +1691,19 @@ opt_block_args_tail: tCOMMA block_args_tail
1641
1691
  }
1642
1692
  f_larglist
1643
1693
  {
1644
- result = lexer.cmdarg.store(false)
1694
+ lexer.cmdarg.push false
1645
1695
  }
1646
1696
  lambda_body
1647
1697
  {
1648
- (line, lpar), args, cmdarg, body = val
1698
+ _, (line, lpar), args, _cmdarg, body = val
1649
1699
  lexer.lpar_beg = lpar
1650
1700
 
1651
- lexer.cmdarg.restore cmdarg
1652
- lexer.cmdarg.lexpop
1701
+ lexer.cmdarg.pop
1653
1702
 
1654
1703
  call = s(:lambda).line line
1655
1704
  result = new_iter call, args, body
1656
- result.line = line
1657
- self.env.unextend
1705
+ result.line line
1706
+ self.env.unextend # TODO: dynapush & dynapop
1658
1707
  }
1659
1708
 
1660
1709
  f_larglist: tLPAREN2 f_args opt_bv_decl rparen
@@ -1688,23 +1737,28 @@ opt_block_args_tail: tCOMMA block_args_tail
1688
1737
  ## if (nd_type($1) == NODE_YIELD) {
1689
1738
  ## compile_error(PARSER_ARG "block given to yield");
1690
1739
 
1691
- syntax_error "Both block arg and actual block given." if
1692
- val[0].block_pass?
1740
+ cmd, blk = val
1693
1741
 
1694
- val = invert_block_call val if inverted? val
1742
+ syntax_error "Both block arg and actual block given." if
1743
+ cmd.block_pass?
1695
1744
 
1696
- cmd, blk = val
1745
+ if inverted? val then
1746
+ val = invert_block_call val
1747
+ cmd, blk = val
1748
+ end
1697
1749
 
1698
1750
  result = blk
1699
1751
  result.insert 1, cmd
1700
1752
  }
1701
1753
  | block_call call_op2 operation2 opt_paren_args
1702
1754
  {
1703
- result = new_call val[0], val[2].to_sym, val[3]
1755
+ lhs, _, (id, _line), args = val
1756
+
1757
+ result = new_call lhs, id.to_sym, args
1704
1758
  }
1705
1759
  | block_call call_op2 operation2 opt_paren_args brace_block
1706
1760
  {
1707
- iter1, _, name, args, iter2 = val
1761
+ iter1, _, (name, _line), args, iter2 = val
1708
1762
 
1709
1763
  call = new_call iter1, name.to_sym, args
1710
1764
  iter2.insert 1, call
@@ -1713,7 +1767,7 @@ opt_block_args_tail: tCOMMA block_args_tail
1713
1767
  }
1714
1768
  | block_call call_op2 operation2 command_args do_block
1715
1769
  {
1716
- iter1, _, name, args, iter2 = val
1770
+ iter1, _, (name, _line), args, iter2 = val
1717
1771
 
1718
1772
  call = new_call iter1, name.to_sym, args
1719
1773
  iter2.insert 1, call
@@ -1721,28 +1775,29 @@ opt_block_args_tail: tCOMMA block_args_tail
1721
1775
  result = iter2
1722
1776
  }
1723
1777
 
1724
- method_call: fcall
1725
- {
1726
- result = self.lexer.lineno
1727
- }
1728
- paren_args
1778
+ method_call: fcall paren_args
1729
1779
  {
1730
- call, lineno, args = val
1780
+ call, args = val
1731
1781
 
1732
1782
  result = call.concat args.sexp_body if args
1733
- result.line lineno
1734
1783
  }
1735
1784
  | primary_value call_op operation2 opt_paren_args
1736
1785
  {
1737
- result = new_call val[0], val[2].to_sym, val[3], val[1]
1786
+ recv, call_op, (op, _line), args = val
1787
+
1788
+ result = new_call recv, op.to_sym, args, call_op
1738
1789
  }
1739
1790
  | primary_value tCOLON2 operation2 paren_args
1740
1791
  {
1741
- result = new_call val[0], val[2].to_sym, val[3]
1792
+ recv, _, (op, _line), args = val
1793
+
1794
+ result = new_call recv, op.to_sym, args
1742
1795
  }
1743
1796
  | primary_value tCOLON2 operation3
1744
1797
  {
1745
- result = new_call val[0], val[2].to_sym
1798
+ lhs, _, (id, _line) = val
1799
+
1800
+ result = new_call lhs, id.to_sym
1746
1801
  }
1747
1802
  | primary_value call_op paren_args
1748
1803
  {
@@ -1775,7 +1830,7 @@ opt_block_args_tail: tCOMMA block_args_tail
1775
1830
  _, line, body, _ = val
1776
1831
 
1777
1832
  result = body
1778
- result.line = line
1833
+ result.line line
1779
1834
 
1780
1835
  self.env.unextend
1781
1836
  }
@@ -1789,7 +1844,7 @@ opt_block_args_tail: tCOMMA block_args_tail
1789
1844
  _, line, body, _ = val
1790
1845
 
1791
1846
  result = body
1792
- result.line = line
1847
+ result.line line
1793
1848
 
1794
1849
  self.env.unextend
1795
1850
  }
@@ -1807,25 +1862,50 @@ opt_block_args_tail: tCOMMA block_args_tail
1807
1862
  }
1808
1863
 
1809
1864
  do_body: { self.env.extend :dynamic; result = self.lexer.lineno }
1810
- { result = lexer.cmdarg.store(false) }
1865
+ { lexer.cmdarg.push false }
1811
1866
  opt_block_param
1812
1867
  compstmt
1813
1868
  {
1814
- line, cmdarg, param, cmpstmt = val
1869
+ line, _cmdarg, param, cmpstmt = val
1815
1870
 
1816
1871
  result = new_do_body param, cmpstmt, line
1872
+ lexer.cmdarg.pop
1817
1873
  self.env.unextend
1818
- lexer.cmdarg.restore cmdarg
1874
+ }
1875
+
1876
+ case_args: arg_value
1877
+ {
1878
+ arg, = val
1879
+
1880
+ result = s(:array, arg).line arg.line
1881
+ }
1882
+ | tSTAR arg_value
1883
+ {
1884
+ _, arg = val
1885
+
1886
+ result = s(:array, s(:splat, arg).line(arg.line)).line arg.line
1887
+ }
1888
+ | case_args tCOMMA arg_value
1889
+ {
1890
+ args, _, id = val
1891
+
1892
+ result = self.list_append args, id
1893
+ }
1894
+ | case_args tCOMMA tSTAR arg_value
1895
+ {
1896
+ args, _, _, id = val
1897
+
1898
+ result = self.list_append args, s(:splat, id).line(id.line)
1819
1899
  }
1820
1900
 
1821
1901
  case_body: k_when
1822
1902
  {
1823
1903
  result = self.lexer.lineno
1824
1904
  }
1825
- args then compstmt cases
1905
+ case_args then compstmt cases
1826
1906
  {
1827
1907
  result = new_when(val[2], val[4])
1828
- result.line = val[1]
1908
+ result.line val[1]
1829
1909
  result << val[5] if val[5]
1830
1910
  }
1831
1911
 
@@ -1871,17 +1951,10 @@ opt_block_args_tail: tCOMMA block_args_tail
1871
1951
 
1872
1952
  literal: numeric
1873
1953
  {
1874
- line = lexer.lineno
1875
- result = s(:lit, val[0])
1876
- result.line = line
1954
+ (lit, line), = val
1955
+ result = s(:lit, lit).line line
1877
1956
  }
1878
1957
  | symbol
1879
- {
1880
- line = lexer.lineno
1881
- result = s(:lit, val[0])
1882
- result.line = line
1883
- }
1884
- | dsym
1885
1958
 
1886
1959
  strings: string
1887
1960
  {
@@ -1892,7 +1965,7 @@ opt_block_args_tail: tCOMMA block_args_tail
1892
1965
 
1893
1966
  string: tCHAR
1894
1967
  {
1895
- debug20 23, val, result
1968
+ debug 37
1896
1969
  }
1897
1970
  | string1
1898
1971
  | string string1
@@ -1902,11 +1975,11 @@ opt_block_args_tail: tCOMMA block_args_tail
1902
1975
 
1903
1976
  string1: tSTRING_BEG string_contents tSTRING_END
1904
1977
  {
1905
- _, str, (_, func) = val
1978
+ (_, line), str, (_, func) = val
1906
1979
 
1907
- str = dedent str if func =~ RubyLexer::STR_FUNC_ICNTNT
1980
+ str = dedent str if func =~ RubyLexer::STR_FUNC_DEDENT
1908
1981
 
1909
- result = str
1982
+ result = str.line line
1910
1983
  }
1911
1984
  | tSTRING
1912
1985
  {
@@ -1915,7 +1988,7 @@ opt_block_args_tail: tCOMMA block_args_tail
1915
1988
 
1916
1989
  xstring: tXSTRING_BEG xstring_contents tSTRING_END
1917
1990
  {
1918
- result = new_xstring val[1]
1991
+ result = new_xstring val
1919
1992
  # TODO: dedent?!?! SERIOUSLY?!?
1920
1993
  }
1921
1994
 
@@ -1926,11 +1999,15 @@ opt_block_args_tail: tCOMMA block_args_tail
1926
1999
 
1927
2000
  words: tWORDS_BEG tSPACE tSTRING_END
1928
2001
  {
1929
- result = s(:array).line lexer.lineno
2002
+ (_, line), _, _ = val
2003
+
2004
+ result = s(:array).line line
1930
2005
  }
1931
2006
  | tWORDS_BEG word_list tSTRING_END
1932
2007
  {
1933
- result = val[1]
2008
+ (_, line), list, _ = val
2009
+
2010
+ result = list.line line
1934
2011
  }
1935
2012
 
1936
2013
  word_list: none
@@ -1950,18 +2027,20 @@ opt_block_args_tail: tCOMMA block_args_tail
1950
2027
 
1951
2028
  symbols: tSYMBOLS_BEG tSPACE tSTRING_END
1952
2029
  {
1953
- result = s(:array).line lexer.lineno
2030
+ (_, line), _, _ = val
2031
+
2032
+ result = s(:array).line line
1954
2033
  }
1955
- | tSYMBOLS_BEG { result = lexer.lineno } symbol_list tSTRING_END
2034
+ | tSYMBOLS_BEG symbol_list tSTRING_END
1956
2035
  {
1957
- _, line, list, _, = val
1958
- list.line = line
2036
+ (_, line), list, _, = val
2037
+ list.line line
1959
2038
  result = list
1960
2039
  }
1961
2040
 
1962
2041
  symbol_list: none
1963
2042
  {
1964
- result = new_symbol_list.line lexer.lineno
2043
+ result = new_symbol_list
1965
2044
  }
1966
2045
  | symbol_list word tSPACE
1967
2046
  {
@@ -1971,20 +2050,28 @@ opt_block_args_tail: tCOMMA block_args_tail
1971
2050
 
1972
2051
  qwords: tQWORDS_BEG tSPACE tSTRING_END
1973
2052
  {
1974
- result = s(:array).line lexer.lineno
2053
+ (_, line), _, _ = val
2054
+
2055
+ result = s(:array).line line
1975
2056
  }
1976
2057
  | tQWORDS_BEG qword_list tSTRING_END
1977
2058
  {
1978
- result = val[1]
2059
+ (_, line), list, _ = val
2060
+
2061
+ result = list.line line
1979
2062
  }
1980
2063
 
1981
2064
  qsymbols: tQSYMBOLS_BEG tSPACE tSTRING_END
1982
2065
  {
1983
- result = s(:array).line lexer.lineno # FIX
2066
+ (_, line), _, _ = val
2067
+
2068
+ result = s(:array).line line
1984
2069
  }
1985
2070
  | tQSYMBOLS_BEG qsym_list tSTRING_END
1986
2071
  {
1987
- result = val[1]
2072
+ (_, line), list, _ = val
2073
+
2074
+ result = list.line line
1988
2075
  }
1989
2076
 
1990
2077
  qword_list: none
@@ -2007,7 +2094,8 @@ opt_block_args_tail: tCOMMA block_args_tail
2007
2094
 
2008
2095
  string_contents: none
2009
2096
  {
2010
- result = s(:str, "").line lexer.lineno
2097
+ line = prev_value_to_lineno _values.last
2098
+ result = s(:str, +"").line line
2011
2099
  }
2012
2100
  | string_contents string_content
2013
2101
  {
@@ -2057,12 +2145,13 @@ regexp_contents: none
2057
2145
  result = [lexer.lex_strterm,
2058
2146
  lexer.brace_nest,
2059
2147
  lexer.string_nest, # TODO: remove
2060
- lexer.cond.store,
2061
- lexer.cmdarg.store,
2062
2148
  lexer.lex_state,
2063
2149
  lexer.lineno,
2064
2150
  ]
2065
2151
 
2152
+ lexer.cmdarg.push false
2153
+ lexer.cond.push false
2154
+
2066
2155
  lexer.lex_strterm = nil
2067
2156
  lexer.brace_nest = 0
2068
2157
  lexer.string_nest = 0
@@ -2074,14 +2163,15 @@ regexp_contents: none
2074
2163
  {
2075
2164
  _, memo, stmt, _ = val
2076
2165
 
2077
- lex_strterm, brace_nest, string_nest, oldcond, oldcmdarg, oldlex_state, line = memo
2166
+ lex_strterm, brace_nest, string_nest, oldlex_state, line = memo
2167
+ # TODO: heredoc_indent
2078
2168
 
2079
2169
  lexer.lex_strterm = lex_strterm
2080
2170
  lexer.brace_nest = brace_nest
2081
2171
  lexer.string_nest = string_nest
2082
2172
 
2083
- lexer.cond.restore oldcond
2084
- lexer.cmdarg.restore oldcmdarg
2173
+ lexer.cond.pop
2174
+ lexer.cmdarg.pop
2085
2175
 
2086
2176
  lexer.lex_state = oldlex_state
2087
2177
 
@@ -2096,29 +2186,49 @@ regexp_contents: none
2096
2186
  when nil then
2097
2187
  result = s(:evstr).line line
2098
2188
  else
2099
- debug20 25
2189
+ debug 38
2100
2190
  raise "unknown string body: #{stmt.inspect}"
2101
2191
  end
2102
2192
  }
2103
2193
 
2104
- string_dvar: tGVAR { result = s(:gvar, val[0].to_sym).line lexer.lineno }
2105
- | tIVAR { result = s(:ivar, val[0].to_sym).line lexer.lineno }
2106
- | tCVAR { result = s(:cvar, val[0].to_sym).line lexer.lineno }
2194
+ string_dvar: tGVAR
2195
+ {
2196
+ (id, line), = val
2197
+ result = s(:gvar, id.to_sym).line line
2198
+ }
2199
+ | tIVAR
2200
+ {
2201
+ (id, line), = val
2202
+ result = s(:ivar, id.to_sym).line line
2203
+ }
2204
+ | tCVAR
2205
+ {
2206
+ (id, line), = val
2207
+ result = s(:cvar, id.to_sym).line line
2208
+ }
2107
2209
  | backref
2108
2210
 
2109
- symbol: tSYMBEG sym
2211
+ symbol: ssym
2212
+ | dsym
2213
+
2214
+ ssym: tSYMBEG sym
2110
2215
  {
2216
+ _, (id, line) = val
2217
+
2111
2218
  lexer.lex_state = EXPR_END
2112
- result = val[1].to_sym
2219
+ result = s(:lit, id.to_sym).line line
2113
2220
  }
2114
2221
  | tSYMBOL
2115
2222
  {
2116
- result = val[0].to_sym
2223
+ (id, line), = val
2224
+
2225
+ lexer.lex_state = EXPR_END
2226
+ result = s(:lit, id.to_sym).line line
2117
2227
  }
2118
2228
 
2119
2229
  sym: fname | tIVAR | tGVAR | tCVAR
2120
2230
 
2121
- dsym: tSYMBEG xstring_contents tSTRING_END
2231
+ dsym: tSYMBEG string_contents tSTRING_END
2122
2232
  {
2123
2233
  _, result, _ = val
2124
2234
 
@@ -2134,14 +2244,15 @@ regexp_contents: none
2134
2244
  when :evstr then
2135
2245
  result = s(:dsym, "", result).line result.line
2136
2246
  else
2137
- debug20 26, val, result
2247
+ debug 39
2138
2248
  end
2139
2249
  }
2140
2250
 
2141
2251
  numeric: simple_numeric
2142
- | tUMINUS_NUM simple_numeric
2252
+ | tUMINUS_NUM simple_numeric =tLOWEST
2143
2253
  {
2144
- result = -val[1] # TODO: pt_testcase
2254
+ _, (num, line) = val
2255
+ result = [-num, line]
2145
2256
  }
2146
2257
 
2147
2258
  simple_numeric: tINTEGER
@@ -2174,8 +2285,10 @@ keyword_variable: kNIL { result = s(:nil).line lexer.lineno }
2174
2285
 
2175
2286
  var_ref: user_variable
2176
2287
  {
2177
- var = val[0]
2288
+ raise "NO: #{val.inspect}" if Sexp === val.first
2289
+ (var, line), = val
2178
2290
  result = Sexp === var ? var : self.gettable(var)
2291
+ result.line line
2179
2292
  }
2180
2293
  | keyword_variable
2181
2294
  {
@@ -2190,11 +2303,19 @@ keyword_variable: kNIL { result = s(:nil).line lexer.lineno }
2190
2303
  | keyword_variable
2191
2304
  {
2192
2305
  result = self.assignable val[0]
2193
- debug20 29, val, result
2306
+ debug 40
2194
2307
  }
2195
2308
 
2196
- backref: tNTH_REF { result = s(:nth_ref, val[0]).line lexer.lineno }
2197
- | tBACK_REF { result = s(:back_ref, val[0]).line lexer.lineno }
2309
+ backref: tNTH_REF
2310
+ {
2311
+ (ref, line), = val
2312
+ result = s(:nth_ref, ref).line line
2313
+ }
2314
+ | tBACK_REF
2315
+ {
2316
+ (ref, line), = val
2317
+ result = s(:back_ref, ref).line line
2318
+ }
2198
2319
 
2199
2320
  superclass: tLT
2200
2321
  {
@@ -2212,9 +2333,7 @@ keyword_variable: kNIL { result = s(:nil).line lexer.lineno }
2212
2333
 
2213
2334
  f_arglist: tLPAREN2 f_args rparen
2214
2335
  {
2215
- result = val[1]
2216
- self.lexer.lex_state = EXPR_BEG
2217
- self.lexer.command_start = true
2336
+ result = end_args val
2218
2337
  }
2219
2338
  | {
2220
2339
  result = self.in_kwarg
@@ -2223,12 +2342,7 @@ keyword_variable: kNIL { result = s(:nil).line lexer.lineno }
2223
2342
  }
2224
2343
  f_args term
2225
2344
  {
2226
- kwarg, args, _ = val
2227
-
2228
- self.in_kwarg = kwarg
2229
- result = args
2230
- lexer.lex_state = EXPR_BEG
2231
- lexer.command_start = true
2345
+ result = end_args val
2232
2346
  }
2233
2347
 
2234
2348
  args_tail: f_kwarg tCOMMA f_kwrest opt_f_block_arg
@@ -2313,8 +2427,10 @@ keyword_variable: kNIL { result = s(:nil).line lexer.lineno }
2313
2427
  |
2314
2428
  {
2315
2429
  result = args val
2430
+ # result.line lexer.lineno
2316
2431
  }
2317
2432
 
2433
+
2318
2434
  f_bad_arg: tCONSTANT
2319
2435
  {
2320
2436
  yyerror "formal argument cannot be a constant"
@@ -2335,10 +2451,11 @@ keyword_variable: kNIL { result = s(:nil).line lexer.lineno }
2335
2451
  f_norm_arg: f_bad_arg
2336
2452
  | tIDENTIFIER
2337
2453
  {
2338
- identifier = val[0].to_sym
2454
+ (id, line), = val
2455
+ identifier = id.to_sym
2339
2456
  self.env[identifier] = :lvar
2340
2457
 
2341
- result = identifier
2458
+ result = [identifier, line]
2342
2459
  }
2343
2460
 
2344
2461
  f_arg_asgn: f_norm_arg
@@ -2346,22 +2463,14 @@ keyword_variable: kNIL { result = s(:nil).line lexer.lineno }
2346
2463
  f_arg_item: f_arg_asgn
2347
2464
  | tLPAREN f_margs rparen
2348
2465
  {
2349
- result = val[1]
2466
+ _, margs, _ = val
2467
+
2468
+ result = margs
2350
2469
  }
2351
2470
 
2352
2471
  f_arg: f_arg_item
2353
2472
  {
2354
- arg, = val
2355
-
2356
- case arg
2357
- when Symbol then
2358
- result = s(:args, arg).line lexer.lineno
2359
- when Sexp then
2360
- result = arg
2361
- else
2362
- debug20 32
2363
- raise "Unknown f_arg type: #{val.inspect}"
2364
- end
2473
+ result = new_arg val
2365
2474
  }
2366
2475
  | f_arg tCOMMA f_arg_item
2367
2476
  {
@@ -2373,7 +2482,7 @@ keyword_variable: kNIL { result = s(:nil).line lexer.lineno }
2373
2482
  result = s(:args, list).line list.line
2374
2483
  end
2375
2484
 
2376
- result << item
2485
+ result << (Sexp === item ? item : item.first)
2377
2486
  }
2378
2487
 
2379
2488
  f_label: tLABEL
@@ -2434,26 +2543,33 @@ keyword_variable: kNIL { result = s(:nil).line lexer.lineno }
2434
2543
  kwrest_mark: tPOW
2435
2544
  | tDSTAR
2436
2545
 
2546
+
2437
2547
  f_kwrest: kwrest_mark tIDENTIFIER
2438
2548
  {
2439
- name = val[1].to_sym
2440
- self.assignable name
2441
- result = :"**#{name}"
2549
+ _, (id, line) = val
2550
+
2551
+ name = id.to_sym
2552
+ self.assignable [name, line]
2553
+ result = [:"**#{name}", line]
2442
2554
  }
2443
2555
  | kwrest_mark
2444
2556
  {
2445
- result = :"**"
2557
+ id = :"**"
2558
+ self.env[id] = :lvar # TODO: needed?!?
2559
+ result = [id, lexer.lineno] # TODO: tPOW/tDSTAR include lineno
2446
2560
  }
2447
2561
 
2448
2562
  f_opt: f_arg_asgn tEQL arg_value
2449
2563
  {
2450
- result = self.assignable val[0], val[2]
2564
+ lhs, _, rhs = val
2565
+ result = self.assignable lhs, rhs
2451
2566
  # TODO: detect duplicate names
2452
2567
  }
2453
2568
 
2454
2569
  f_block_opt: f_arg_asgn tEQL primary_value
2455
2570
  {
2456
- result = self.assignable val[0], val[2]
2571
+ lhs, _, rhs = val
2572
+ result = self.assignable lhs, rhs
2457
2573
  }
2458
2574
 
2459
2575
  f_block_optarg: f_block_opt
@@ -2483,30 +2599,33 @@ keyword_variable: kNIL { result = s(:nil).line lexer.lineno }
2483
2599
  f_rest_arg: restarg_mark tIDENTIFIER
2484
2600
  {
2485
2601
  # TODO: differs from parse.y - needs tests
2486
- name = val[1].to_sym
2487
- self.assignable name
2488
- result = :"*#{name}"
2602
+ _, (id, line) = val
2603
+ name = id.to_sym
2604
+ self.assignable [name, line]
2605
+ result = [:"*#{name}", line]
2489
2606
  }
2490
2607
  | restarg_mark
2491
2608
  {
2492
2609
  name = :"*"
2493
2610
  self.env[name] = :lvar
2494
- result = name
2611
+ result = [name, lexer.lineno] # FIX: tSTAR to include lineno
2495
2612
  }
2496
2613
 
2497
2614
  blkarg_mark: tAMPER2 | tAMPER
2498
2615
 
2499
2616
  f_block_arg: blkarg_mark tIDENTIFIER
2500
2617
  {
2501
- identifier = val[1].to_sym
2618
+ _, (id, line) = val
2619
+ identifier = id.to_sym
2502
2620
 
2503
2621
  self.env[identifier] = :lvar
2504
- result = "&#{identifier}".to_sym
2622
+ result = ["&#{identifier}".to_sym, line]
2505
2623
  }
2506
2624
 
2507
2625
  opt_f_block_arg: tCOMMA f_block_arg
2508
2626
  {
2509
- result = val[1]
2627
+ _, arg = val
2628
+ result = arg
2510
2629
  }
2511
2630
  |
2512
2631
  {
@@ -2555,9 +2674,11 @@ keyword_variable: kNIL { result = s(:nil).line lexer.lineno }
2555
2674
  }
2556
2675
  | tSTRING_BEG string_contents tLABEL_END arg_value
2557
2676
  {
2558
- _, sym, _, value = val
2677
+ (_, line), sym, _, value = val
2678
+
2559
2679
  sym.sexp_type = :dsym
2560
- result = s(:array, sym, value).line sym.line
2680
+
2681
+ result = s(:array, sym, value).line line
2561
2682
  }
2562
2683
  | tDSTAR arg_value
2563
2684
  {