brakeman 4.7.1 → 5.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (506) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +163 -1
  3. data/README.md +24 -7
  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.0 → 2.7.0/gems/ruby_parser-3.18.1}/History.rdoc +166 -0
  176. data/bundle/ruby/{2.6.0/gems/ruby_parser-3.14.0 → 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.0 → 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.0 → 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.0 → 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.0 → 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.0 → 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.0 → 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.0 → 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.0 → 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.0/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.0/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.0/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.0 → 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.0 → 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.0 → 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.0 → 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.0 → 2.7.0/gems/ruby_parser-3.18.1}/lib/ruby_parser_extras.rb +343 -133
  209. data/bundle/ruby/{2.6.0/gems/ruby_parser-3.14.0 → 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.0 → 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 +38 -10
  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 +83 -41
  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/processor.rb +1 -1
  452. data/lib/brakeman/processors/alias_processor.rb +132 -24
  453. data/lib/brakeman/processors/base_processor.rb +4 -4
  454. data/lib/brakeman/processors/controller_alias_processor.rb +6 -43
  455. data/lib/brakeman/processors/controller_processor.rb +1 -1
  456. data/lib/brakeman/processors/gem_processor.rb +3 -0
  457. data/lib/brakeman/processors/haml_template_processor.rb +17 -1
  458. data/lib/brakeman/processors/lib/call_conversion_helper.rb +13 -7
  459. data/lib/brakeman/processors/lib/file_type_detector.rb +64 -0
  460. data/lib/brakeman/processors/lib/find_all_calls.rb +30 -14
  461. data/lib/brakeman/processors/lib/rails3_config_processor.rb +16 -16
  462. data/lib/brakeman/processors/lib/rails3_route_processor.rb +2 -0
  463. data/lib/brakeman/processors/lib/rails4_config_processor.rb +2 -1
  464. data/lib/brakeman/processors/lib/render_helper.rb +3 -1
  465. data/lib/brakeman/processors/library_processor.rb +9 -0
  466. data/lib/brakeman/processors/model_processor.rb +32 -0
  467. data/lib/brakeman/processors/output_processor.rb +1 -1
  468. data/lib/brakeman/processors/template_alias_processor.rb +5 -0
  469. data/lib/brakeman/report/ignore/config.rb +10 -2
  470. data/lib/brakeman/report/ignore/interactive.rb +1 -1
  471. data/lib/brakeman/report/report_base.rb +0 -2
  472. data/lib/brakeman/report/report_csv.rb +37 -60
  473. data/lib/brakeman/report/report_github.rb +31 -0
  474. data/lib/brakeman/report/report_junit.rb +104 -0
  475. data/lib/brakeman/report/report_markdown.rb +0 -1
  476. data/lib/brakeman/report/report_sarif.rb +133 -0
  477. data/lib/brakeman/report/report_sonar.rb +38 -0
  478. data/lib/brakeman/report/report_tabs.rb +1 -1
  479. data/lib/brakeman/report/report_text.rb +38 -17
  480. data/lib/brakeman/report.rb +22 -1
  481. data/lib/brakeman/rescanner.rb +7 -5
  482. data/lib/brakeman/scanner.rb +65 -31
  483. data/lib/brakeman/tracker/collection.rb +57 -7
  484. data/lib/brakeman/tracker/config.rb +88 -5
  485. data/lib/brakeman/tracker/constants.rb +8 -7
  486. data/lib/brakeman/tracker/controller.rb +1 -1
  487. data/lib/brakeman/tracker/method_info.rb +70 -0
  488. data/lib/brakeman/tracker.rb +42 -5
  489. data/lib/brakeman/util.rb +63 -24
  490. data/lib/brakeman/version.rb +1 -1
  491. data/lib/brakeman/warning.rb +10 -2
  492. data/lib/brakeman/warning_codes.rb +13 -0
  493. data/lib/brakeman.rb +49 -6
  494. data/lib/ruby_parser/bm_sexp.rb +33 -9
  495. metadata +438 -352
  496. data/bundle/ruby/2.6.0/gems/haml-5.1.2/lib/haml/escapable.rb +0 -50
  497. data/bundle/ruby/2.6.0/gems/ruby_parser-3.14.0/debugging.md +0 -18
  498. data/bundle/ruby/2.6.0/gems/ruby_parser-3.14.0/lib/rp_stringscanner.rb +0 -64
  499. data/bundle/ruby/2.6.0/gems/ruby_parser-3.14.0/lib/ruby20_parser.rb +0 -7045
  500. data/bundle/ruby/2.6.0/gems/ruby_parser-3.14.0/lib/ruby21_parser.rb +0 -7116
  501. data/bundle/ruby/2.6.0/gems/ruby_parser-3.14.0/lib/ruby22_parser.rb +0 -7149
  502. data/bundle/ruby/2.6.0/gems/ruby_parser-3.14.0/lib/ruby23_parser.rb +0 -7166
  503. data/bundle/ruby/2.6.0/gems/ruby_parser-3.14.0/lib/ruby24_parser.rb +0 -7178
  504. data/bundle/ruby/2.6.0/gems/ruby_parser-3.14.0/lib/ruby25_parser.rb +0 -7178
  505. data/bundle/ruby/2.6.0/gems/ruby_parser-3.14.0/lib/ruby26_parser.rb +0 -7198
  506. data/bundle/ruby/2.6.0/gems/unicode-display_width-1.6.0/data/display_width.marshal.gz +0 -0
@@ -1,6 +1,6 @@
1
1
  # -*- racc -*-
2
2
 
3
- class Ruby25Parser
3
+ class Ruby27Parser
4
4
 
5
5
  token kCLASS kMODULE kDEF kUNDEF kBEGIN kRESCUE kENSURE kEND kIF kUNLESS
6
6
  kTHEN kELSIF kELSE kCASE kWHEN kWHILE kUNTIL kFOR kBREAK kNEXT
@@ -18,10 +18,11 @@ token kCLASS kMODULE kDEF kUNDEF kBEGIN kRESCUE kENSURE kEND kIF kUNLESS
18
18
  tBACK_REF2 tSYMBEG tSTRING_BEG tXSTRING_BEG tREGEXP_BEG
19
19
  tWORDS_BEG tQWORDS_BEG tSTRING_DBEG tSTRING_DVAR tSTRING_END
20
20
  tSTRING tSYMBOL tNL tEH tCOLON tCOMMA tSPACE tSEMI tLAMBDA
21
- tLAMBEG tDSTAR tCHAR tSYMBOLS_BEG tQSYMBOLS_BEG tSTRING_DEND tUBANG
21
+ tLAMBEG tDSTAR tCHAR tSYMBOLS_BEG tQSYMBOLS_BEG tSTRING_DEND
22
22
  tRATIONAL tIMAGINARY
23
23
  tLABEL_END
24
24
  tLONELY
25
+ tBDOT2 tBDOT3
25
26
 
26
27
  preclow
27
28
  nonassoc tLOWEST
@@ -33,7 +34,7 @@ preclow
33
34
  right tEQL tOP_ASGN
34
35
  left kRESCUE_MOD
35
36
  right tEH tCOLON
36
- nonassoc tDOT2 tDOT3
37
+ nonassoc tDOT2 tDOT3 tBDOT2 tBDOT3
37
38
  left tOROP
38
39
  left tANDOP
39
40
  nonassoc tCMP tEQ tEQQ tNEQ tMATCH tNMATCH
@@ -56,6 +57,9 @@ rule
56
57
  top_compstmt
57
58
  {
58
59
  result = new_compstmt val
60
+
61
+ lexer.cond.pop # local_pop
62
+ lexer.cmdarg.pop
59
63
  }
60
64
 
61
65
  top_compstmt: top_stmts opt_terms
@@ -76,7 +80,7 @@ rule
76
80
  | klBEGIN
77
81
  {
78
82
  if (self.in_def || self.in_single > 0) then
79
- debug20 1
83
+ debug 11
80
84
  yyerror "BEGIN in method"
81
85
  end
82
86
  self.env.extend
@@ -101,6 +105,8 @@ rule
101
105
  bodystmt: compstmt opt_rescue k_else
102
106
  {
103
107
  res = _values[-2]
108
+ # TODO: move down to main match so I can just use val
109
+
104
110
  yyerror "else without rescue is useless" unless res
105
111
  }
106
112
  compstmt
@@ -131,7 +137,7 @@ rule
131
137
  | error stmt
132
138
  {
133
139
  result = val[1]
134
- debug20 2, val, result
140
+ debug 12
135
141
  }
136
142
 
137
143
  stmt_or_begin: stmt
@@ -139,6 +145,10 @@ rule
139
145
  {
140
146
  yyerror "BEGIN is permitted only at toplevel"
141
147
  }
148
+ begin_block
149
+ {
150
+ result = val[2] # wtf?
151
+ }
142
152
 
143
153
  stmt: kALIAS fitem
144
154
  {
@@ -151,12 +161,12 @@ rule
151
161
  }
152
162
  | kALIAS tGVAR tGVAR
153
163
  {
154
- (_, line), lhs, rhs = val
164
+ (_, line), (lhs, _), (rhs, _) = val
155
165
  result = s(:valias, lhs.to_sym, rhs.to_sym).line line
156
166
  }
157
167
  | kALIAS tGVAR tBACK_REF
158
168
  {
159
- (_, line), lhs, rhs = val
169
+ (_, line), (lhs, _), (rhs, _) = val
160
170
  result = s(:valias, lhs.to_sym, :"$#{rhs}").line line
161
171
  }
162
172
  | kALIAS tGVAR tNTH_REF
@@ -199,7 +209,7 @@ rule
199
209
  (_, line), _, stmt, _ = val
200
210
 
201
211
  if (self.in_def || self.in_single > 0) then
202
- debug20 3
212
+ debug 13
203
213
  yyerror "END in method; use at_exit"
204
214
  end
205
215
 
@@ -215,6 +225,15 @@ rule
215
225
  lhs, _, rhs = val
216
226
  result = new_assign lhs, s(:svalue, rhs).line(rhs.line)
217
227
  }
228
+ | mlhs tEQL mrhs_arg kRESCUE_MOD stmt
229
+ {
230
+ # unwraps s(:to_ary, rhs)
231
+ lhs, _, (_, rhs), _, resbody = val
232
+
233
+ resbody = new_resbody s(:array).line(resbody.line), resbody
234
+
235
+ result = new_masgn lhs, new_rescue(rhs, resbody), :wrap
236
+ }
218
237
  | mlhs tEQL mrhs_arg
219
238
  {
220
239
  result = new_masgn val[0], val[2]
@@ -239,30 +258,31 @@ rule
239
258
  }
240
259
  | primary_value call_op tIDENTIFIER tOP_ASGN command_rhs
241
260
  {
242
- prim, _, id, opasgn, rhs = val
243
- result = s(:op_asgn, prim, rhs, id.to_sym, opasgn.to_sym)
244
- if val[1] == '&.'
245
- result.sexp_type = :safe_op_asgn
246
- end
247
- result.line = val[0].line
261
+ prim, (call_op, _), (id, _), (op_asgn, _), rhs = val
262
+
263
+ result = s(:op_asgn, prim, rhs, id.to_sym, op_asgn.to_sym)
264
+ result.sexp_type = :safe_op_asgn if call_op == '&.'
265
+ result.line prim.line
248
266
  }
249
267
  | primary_value call_op tCONSTANT tOP_ASGN command_rhs
250
268
  {
251
- result = s(:op_asgn, val[0], val[4], val[2].to_sym, val[3].to_sym)
252
- if val[1] == '&.'
253
- result.sexp_type = :safe_op_asgn
254
- end
255
- result.line = val[0].line
269
+ prim, (call_op, _), (id, _), (op_asgn, _), rhs = val
270
+
271
+ result = s(:op_asgn, prim, rhs, id.to_sym, op_asgn.to_sym)
272
+ result.sexp_type = :safe_op_asgn if call_op == '&.'
273
+ result.line prim.line
256
274
  }
257
275
  | primary_value tCOLON2 tCONSTANT tOP_ASGN command_rhs
258
276
  {
259
- result = s(:op_asgn, val[0], val[4], val[2], val[3])
260
- debug20 4, val, result
277
+ lhs1, _, (lhs2, line), (id, _), rhs = val
278
+
279
+ result = s(:op_asgn, lhs1, rhs, lhs2.to_sym, id.to_sym).line line
261
280
  }
262
281
  | primary_value tCOLON2 tIDENTIFIER tOP_ASGN command_rhs
263
282
  {
264
- result = s(:op_asgn, val[0], val[4], val[2], val[3])
265
- debug20 5, val, result
283
+ lhs1, _, (lhs2, line), (id, _), rhs = val
284
+
285
+ result = s(:op_asgn, lhs1, rhs, lhs2.to_sym, id.to_sym).line line
266
286
  }
267
287
  | backref tOP_ASGN command_rhs
268
288
  {
@@ -309,6 +329,28 @@ rule
309
329
  # REFACTOR: call_uni_op -- see parse26.y
310
330
  }
311
331
  | arg
332
+ kIN
333
+ {
334
+ # TODO? value_expr($1);
335
+ self.lexer.lex_state = EXPR_BEG|EXPR_LABEL
336
+ self.lexer.command_start = false
337
+ result = self.in_kwarg
338
+ self.in_kwarg = true
339
+ self.env.extend
340
+ }
341
+ p_expr
342
+ {
343
+ self.env.unextend
344
+
345
+ expr, _, old_kwarg, pat = val
346
+
347
+ expr = value_expr expr
348
+
349
+ self.in_kwarg = old_kwarg
350
+ pat_in = new_in pat, nil, nil, expr.line
351
+ result = new_case expr, pat_in, expr.line
352
+ }
353
+ | arg =tLBRACE_ARG
312
354
 
313
355
  expr_value: expr
314
356
  {
@@ -333,7 +375,7 @@ rule
333
375
  block_command: block_call
334
376
  | block_call call_op2 operation2 command_args
335
377
  {
336
- blk, _, msg, args = val
378
+ blk, _, (msg, _line), args = val
337
379
  result = new_call(blk, msg.to_sym, args).line blk.line
338
380
  }
339
381
 
@@ -347,15 +389,15 @@ rule
347
389
  _, line, body, _ = val
348
390
 
349
391
  result = body
350
- result.line = line
392
+ result.line line
351
393
 
352
394
  # self.env.unextend
353
395
  }
354
396
 
355
397
  fcall: operation
356
398
  {
357
- msg, = val
358
- result = new_call(nil, msg.to_sym).line lexer.lineno
399
+ (msg, line), = val
400
+ result = new_call(nil, msg.to_sym).line line
359
401
  }
360
402
 
361
403
  command: fcall command_args =tLOWEST
@@ -378,12 +420,14 @@ rule
378
420
  }
379
421
  | primary_value call_op operation2 command_args =tLOWEST
380
422
  {
381
- lhs, callop, op, args = val
423
+ lhs, callop, (op, _), args = val
424
+
382
425
  result = new_call lhs, op.to_sym, args, callop
426
+ result.line lhs.line
383
427
  }
384
428
  | primary_value call_op operation2 command_args cmd_brace_block
385
429
  {
386
- recv, _, msg, args, block = val
430
+ recv, _, (msg, _line), args, block = val
387
431
  call = new_call recv, msg.to_sym, args, val[1]
388
432
 
389
433
  block_dup_check call, block
@@ -393,11 +437,14 @@ rule
393
437
  }
394
438
  | primary_value tCOLON2 operation2 command_args =tLOWEST
395
439
  {
396
- result = new_call val[0], val[2].to_sym, val[3]
440
+ lhs, _, (id, line), args = val
441
+
442
+ result = new_call lhs, id.to_sym, args
443
+ result.line line
397
444
  }
398
445
  | primary_value tCOLON2 operation2 command_args cmd_brace_block
399
446
  {
400
- recv, _, msg, args, block = val
447
+ recv, _, (msg, _line), args, block = val
401
448
  call = new_call recv, msg.to_sym, args
402
449
 
403
450
  block_dup_check call, block
@@ -555,25 +602,29 @@ rule
555
602
  }
556
603
  | primary_value call_op tIDENTIFIER
557
604
  {
558
- result = new_attrasgn val[0], val[2], val[1]
605
+ lhs, call_op, (id, _line) = val
606
+
607
+ result = new_attrasgn lhs, id, call_op
559
608
  }
560
609
  | primary_value tCOLON2 tIDENTIFIER
561
610
  {
562
- recv, _, id = val
611
+ recv, _, (id, _line) = val
563
612
  result = new_attrasgn recv, id
564
613
  }
565
614
  | primary_value call_op tCONSTANT
566
615
  {
567
- result = new_attrasgn val[0], val[2], val[1]
616
+ lhs, call_op, (id, _line) = val
617
+
618
+ result = new_attrasgn lhs, id, call_op
568
619
  }
569
620
  | primary_value tCOLON2 tCONSTANT
570
621
  {
571
622
  if (self.in_def || self.in_single > 0) then
572
- debug20 7
623
+ debug 14
573
624
  yyerror "dynamic constant assignment"
574
625
  end
575
626
 
576
- expr, _, id = val
627
+ expr, _, (id, _line) = val
577
628
  l = expr.line
578
629
 
579
630
  result = s(:const, s(:colon2, expr, id.to_sym).line(l), nil).line l
@@ -581,58 +632,65 @@ rule
581
632
  | tCOLON3 tCONSTANT
582
633
  {
583
634
  if (self.in_def || self.in_single > 0) then
584
- debug20 8
635
+ debug 15
585
636
  yyerror "dynamic constant assignment"
586
637
  end
587
638
 
588
- _, id = val
589
- l = lexer.lineno
639
+ _, (id, l) = val
590
640
 
591
641
  result = s(:const, nil, s(:colon3, id.to_sym).line(l)).line l
592
642
  }
593
643
  | backref
594
644
  {
595
- self.backref_assign_error val[0]
645
+ ref, = val
646
+
647
+ self.backref_assign_error ref
596
648
  }
597
649
 
598
650
  lhs: user_variable
599
651
  {
600
- line = lexer.lineno
601
- result = self.assignable val[0]
602
- result.line = line
652
+ var, = val
653
+
654
+ result = self.assignable var
603
655
  }
604
656
  | keyword_variable
605
657
  {
606
- line = lexer.lineno
607
- result = self.assignable val[0]
608
- result.line = line
609
- debug20 9, val, result
658
+ var, = val
659
+
660
+ result = self.assignable var
661
+
662
+ debug 16
610
663
  }
611
664
  | primary_value tLBRACK2 opt_call_args rbracket
612
665
  {
613
666
  lhs, _, args, _ = val
667
+
614
668
  result = self.aryset lhs, args
615
669
  }
616
670
  | primary_value call_op tIDENTIFIER # REFACTOR
617
671
  {
618
- lhs, op, id = val
672
+ lhs, op, (id, _line) = val
673
+
619
674
  result = new_attrasgn lhs, id, op
620
675
  }
621
676
  | primary_value tCOLON2 tIDENTIFIER
622
677
  {
623
- lhs, _, id = val
678
+ lhs, _, (id, _line) = val
679
+
624
680
  result = new_attrasgn lhs, id
625
681
  }
626
682
  | primary_value call_op tCONSTANT # REFACTOR?
627
683
  {
628
- result = new_attrasgn val[0], val[2], val[1]
684
+ lhs, call_op, (id, _line) = val
685
+
686
+ result = new_attrasgn lhs, id, call_op
629
687
  }
630
688
  | primary_value tCOLON2 tCONSTANT
631
689
  {
632
- expr, _, id = val
690
+ expr, _, (id, _line) = val
633
691
 
634
692
  if (self.in_def || self.in_single > 0) then
635
- debug20 10
693
+ debug 17
636
694
  yyerror "dynamic constant assignment"
637
695
  end
638
696
 
@@ -641,14 +699,13 @@ rule
641
699
  }
642
700
  | tCOLON3 tCONSTANT
643
701
  {
644
- _, id = val
702
+ _, (id, l) = val
645
703
 
646
704
  if (self.in_def || self.in_single > 0) then
647
- debug20 11
705
+ debug 18
648
706
  yyerror "dynamic constant assignment"
649
707
  end
650
708
 
651
- l = lexer.lineno
652
709
  result = s(:const, s(:colon3, id.to_sym).line(l)).line l
653
710
  }
654
711
  | backref
@@ -664,16 +721,17 @@ rule
664
721
 
665
722
  cpath: tCOLON3 cname
666
723
  {
667
- _, name = val
668
- result = s(:colon3, name.to_sym).line lexer.lineno
724
+ _, (name, line) = val
725
+ result = s(:colon3, name.to_sym).line line
669
726
  }
670
727
  | cname
671
728
  {
672
- result = val[0].to_sym
729
+ (id, line), = val
730
+ result = [id.to_sym, line] # TODO: sexp?
673
731
  }
674
732
  | primary_value tCOLON2 cname
675
733
  {
676
- pval, _, name = val
734
+ pval, _, (name, _line) = val
677
735
 
678
736
  result = s(:colon2, pval, name.to_sym)
679
737
  result.line pval.line
@@ -683,24 +741,17 @@ rule
683
741
  | op
684
742
  {
685
743
  lexer.lex_state = EXPR_END
686
- result = val[0]
687
744
  }
688
745
 
689
746
  | reswords
690
- {
691
- (sym, _line), = val
692
- lexer.lex_state = EXPR_END
693
- result = sym
694
- }
695
747
 
696
- fsym: fname | symbol
697
-
698
- fitem: fsym
748
+ fitem: fname
699
749
  {
700
- id, = val
701
- result = s(:lit, id.to_sym).line lexer.lineno
750
+ (id, line), = val
751
+
752
+ result = s(:lit, id.to_sym).line line
702
753
  }
703
- | dsym
754
+ | symbol
704
755
 
705
756
  undef_list: fitem
706
757
  {
@@ -721,8 +772,6 @@ rule
721
772
  | tNEQ | tLSHFT | tRSHFT | tPLUS | tMINUS | tSTAR2
722
773
  | tSTAR | tDIVIDE | tPERCENT | tPOW | tDSTAR | tBANG | tTILDE
723
774
  | tUPLUS | tUMINUS | tAREF | tASET | tBACK_REF2
724
- # TODO: tUBANG dead?
725
- | tUBANG
726
775
 
727
776
  reswords: k__LINE__ | k__FILE__ | k__ENCODING__ | klBEGIN | klEND
728
777
  | kALIAS | kAND | kBEGIN | kBREAK | kCASE
@@ -756,24 +805,20 @@ rule
756
805
  }
757
806
  | primary_value tCOLON2 tIDENTIFIER tOP_ASGN arg_rhs
758
807
  {
759
- lhs, _, id, op, rhs = val
808
+ lhs, _, (id, _line), (op, _), rhs = val
760
809
 
761
810
  result = s(:op_asgn, lhs, rhs, id.to_sym, op.to_sym).line lhs.line
762
811
  }
763
812
  | primary_value tCOLON2 tCONSTANT tOP_ASGN arg_rhs
764
813
  {
765
- lhs1, _, lhs2, op, rhs = val
814
+ lhs1, _, (lhs2, _line), op, rhs = val
766
815
 
767
816
  lhs = s(:colon2, lhs1, lhs2.to_sym).line lhs1.line
768
817
  result = new_const_op_asgn [lhs, op, rhs]
769
818
  }
770
- | tCOLON3 tCONSTANT
771
- {
772
- result = self.lexer.lineno
773
- }
774
- tOP_ASGN arg_rhs
819
+ | tCOLON3 tCONSTANT tOP_ASGN arg_rhs
775
820
  {
776
- _, lhs, line, op, rhs = val
821
+ _, (lhs, line), op, rhs = val
777
822
 
778
823
  lhs = s(:colon3, lhs.to_sym).line line
779
824
  result = new_const_op_asgn [lhs, op, rhs]
@@ -787,7 +832,7 @@ rule
787
832
  | arg tDOT2 arg
788
833
  {
789
834
  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
835
+ if v1.sexp_type == :lit and v2.sexp_type == :lit and Integer === v1.last and Integer === v2.last then
791
836
  result = s(:lit, (v1.last)..(v2.last)).line v1.line
792
837
  else
793
838
  result = s(:dot2, v1, v2).line v1.line
@@ -796,12 +841,42 @@ rule
796
841
  | arg tDOT3 arg
797
842
  {
798
843
  v1, v2 = val[0], val[2]
799
- if v1.node_type == :lit and v2.node_type == :lit and Integer === v1.last and Integer === v2.last then
844
+ if v1.sexp_type == :lit and v2.sexp_type == :lit and Integer === v1.last and Integer === v2.last then
800
845
  result = s(:lit, (v1.last)...(v2.last)).line v1.line
801
846
  else
802
847
  result = s(:dot3, v1, v2).line v1.line
803
848
  end
804
849
  }
850
+ | arg tDOT2
851
+ {
852
+ v1, _ = val
853
+ v2 = nil
854
+
855
+ result = s(:dot2, v1, v2).line v1.line
856
+ }
857
+ | arg tDOT3
858
+ {
859
+ v1, _ = val
860
+ v2 = nil
861
+
862
+ result = s(:dot3, v1, v2).line v1.line
863
+ }
864
+
865
+ | tBDOT2 arg
866
+ {
867
+ _, v2, = val
868
+ v1 = nil
869
+
870
+ result = s(:dot2, v1, v2).line v2.line
871
+ }
872
+ | tBDOT3 arg
873
+ {
874
+ _, v2 = val
875
+ v1 = nil
876
+
877
+ result = s(:dot3, v1, v2).line v2.line
878
+ }
879
+
805
880
  | arg tPLUS arg
806
881
  {
807
882
  result = new_call val[0], :+, argl(val[2])
@@ -828,8 +903,9 @@ rule
828
903
  }
829
904
  | tUMINUS_NUM simple_numeric tPOW arg
830
905
  {
831
- lit = s(:lit, val[1]).line lexer.lineno
832
- result = new_call(new_call(lit, :"**", argl(val[3])), :"-@")
906
+ _, (num, line), _, arg = val
907
+ lit = s(:lit, num).line line
908
+ result = new_call(new_call(lit, :"**", argl(arg)), :"-@")
833
909
 
834
910
  }
835
911
  | tUPLUS arg
@@ -928,12 +1004,12 @@ rule
928
1004
 
929
1005
  rel_expr: arg relop arg =tGT
930
1006
  {
931
- lhs, op, rhs = val
1007
+ lhs, (op, _), rhs = val
932
1008
  result = new_call lhs, op.to_sym, argl(rhs)
933
1009
  }
934
1010
  | rel_expr relop arg =tGT
935
1011
  {
936
- lhs, op, rhs = val
1012
+ lhs, (op, _), rhs = val
937
1013
  warn "comparison '%s' after comparison", op
938
1014
  result = new_call lhs, op.to_sym, argl(rhs)
939
1015
  }
@@ -973,6 +1049,24 @@ rule
973
1049
  _, args, _ = val
974
1050
  result = args
975
1051
  }
1052
+ | tLPAREN2 args tCOMMA args_forward rparen
1053
+ {
1054
+ yyerror "Unexpected ..." unless
1055
+ self.lexer.is_local_id(:"*") &&
1056
+ self.lexer.is_local_id(:"**") &&
1057
+ self.lexer.is_local_id(:"&")
1058
+
1059
+ result = call_args val
1060
+ }
1061
+ | tLPAREN2 args_forward rparen
1062
+ {
1063
+ yyerror "Unexpected ..." unless
1064
+ self.lexer.is_local_id(:"*") &&
1065
+ self.lexer.is_local_id(:"**") &&
1066
+ self.lexer.is_local_id(:"&")
1067
+
1068
+ result = call_args val
1069
+ }
976
1070
 
977
1071
  opt_paren_args: none
978
1072
  | paren_args
@@ -1000,17 +1094,14 @@ rule
1000
1094
  | args opt_block_arg
1001
1095
  {
1002
1096
  result = call_args val
1003
- result = self.arg_blk_pass val[0], val[1]
1004
1097
  }
1005
1098
  | assocs opt_block_arg
1006
1099
  {
1007
- result = call_args [array_to_hash(val[0])]
1008
- result = self.arg_blk_pass result, val[1]
1100
+ result = call_args [array_to_hash(val[0]), val[1]]
1009
1101
  }
1010
1102
  | args tCOMMA assocs opt_block_arg
1011
1103
  {
1012
- result = call_args [val[0], array_to_hash(val[2])]
1013
- result = self.arg_blk_pass result, val[3]
1104
+ result = call_args [val[0], array_to_hash(val[2]), val[3]]
1014
1105
  }
1015
1106
  | block_arg
1016
1107
  {
@@ -1018,12 +1109,39 @@ rule
1018
1109
  }
1019
1110
 
1020
1111
  command_args: {
1021
- result = lexer.cmdarg.store true
1112
+ # parse26.y line 2200
1113
+
1114
+ # If call_args starts with a open paren '(' or
1115
+ # '[', look-ahead reading of the letters calls
1116
+ # CMDARG_PUSH(0), but the push must be done
1117
+ # after CMDARG_PUSH(1). So this code makes them
1118
+ # consistent by first cancelling the premature
1119
+ # CMDARG_PUSH(0), doing CMDARG_PUSH(1), and
1120
+ # finally redoing CMDARG_PUSH(0).
1121
+
1122
+ result = yychar = self.last_token_type.first
1123
+ lookahead = [:tLPAREN, :tLPAREN_ARG, :tLPAREN2, :tLBRACK, :tLBRACK2].include?(yychar)
1124
+ lexer.cmdarg.pop if lookahead
1125
+ lexer.cmdarg.push true
1126
+ lexer.cmdarg.push false if lookahead
1022
1127
  }
1023
1128
  call_args
1024
1129
  {
1025
- lexer.cmdarg.restore val[0]
1026
- result = val[1]
1130
+ yychar, args = val
1131
+
1132
+ # call_args can be followed by tLBRACE_ARG (that
1133
+ # does CMDARG_PUSH(0) in the lexer) but the push
1134
+ # must be done after CMDARG_POP() in the parser.
1135
+ # So this code does CMDARG_POP() to pop 0 pushed
1136
+ # by tLBRACE_ARG, CMDARG_POP() to pop 1 pushed
1137
+ # by command_args, and CMDARG_PUSH(0) to restore
1138
+ # back the flag set by tLBRACE_ARG.
1139
+
1140
+ lookahead = [:tLBRACE_ARG].include?(yychar)
1141
+ lexer.cmdarg.pop if lookahead
1142
+ lexer.cmdarg.pop
1143
+ lexer.cmdarg.push false if lookahead
1144
+ result = args
1027
1145
  }
1028
1146
 
1029
1147
  block_arg: tAMPER arg_value
@@ -1041,8 +1159,9 @@ rule
1041
1159
  args: arg_value
1042
1160
  {
1043
1161
  arg, = val
1162
+ lineno = arg.line || lexer.lineno # HACK
1044
1163
 
1045
- result = s(:array, arg).line arg.line
1164
+ result = s(:array, arg).line lineno
1046
1165
  }
1047
1166
  | tSTAR arg_value
1048
1167
  {
@@ -1054,9 +1173,11 @@ rule
1054
1173
  args, _, id = val
1055
1174
  result = self.list_append args, id
1056
1175
  }
1057
- | args tCOMMA tSTAR { result = lexer.lineno } arg_value
1176
+ | args tCOMMA tSTAR arg_value
1058
1177
  {
1059
- args, _, _, line, id = val
1178
+ # TODO: the line number from tSTAR has been dropped
1179
+ args, _, _, id = val
1180
+ line = lexer.lineno
1060
1181
  result = self.list_append args, s(:splat, id).line(line)
1061
1182
  }
1062
1183
 
@@ -1075,7 +1196,6 @@ rule
1075
1196
  }
1076
1197
  | args tCOMMA tSTAR arg_value
1077
1198
  {
1078
- # FIX: bad shift/reduce conflict with rhs' comma star prod
1079
1199
  # TODO: make all tXXXX terminals include lexer.lineno
1080
1200
  arg, _, _, splat = val
1081
1201
  result = self.arg_concat arg, splat
@@ -1098,26 +1218,19 @@ rule
1098
1218
  | backref
1099
1219
  | tFID
1100
1220
  {
1101
- msg, = val
1221
+ (msg, line), = val
1102
1222
  result = new_call nil, msg.to_sym
1223
+ result.line line
1103
1224
  }
1104
1225
  | k_begin
1105
1226
  {
1227
+ lexer.cmdarg.push false
1106
1228
  result = self.lexer.lineno
1107
- # TODO:
1108
- # $<val>1 = cmdarg_stack;
1109
- # CMDARG_SET(0);
1110
1229
  }
1111
1230
  bodystmt k_end
1112
1231
  {
1113
- # TODO: CMDARG_SET($<val>1);
1114
- unless val[2] then
1115
- result = s(:nil)
1116
- else
1117
- result = s(:begin, val[2])
1118
- end
1119
-
1120
- result.line = val[1]
1232
+ lexer.cmdarg.pop
1233
+ result = new_begin val
1121
1234
  }
1122
1235
  | tLPAREN_ARG
1123
1236
  {
@@ -1130,18 +1243,14 @@ rule
1130
1243
  result = s(:begin).line line
1131
1244
  }
1132
1245
  | tLPAREN_ARG
1133
- {
1134
- result = lexer.cmdarg.store false
1135
- }
1136
1246
  stmt
1137
1247
  {
1138
1248
  lexer.lex_state = EXPR_ENDARG
1139
1249
  }
1140
1250
  rparen
1141
1251
  {
1142
- _, cmdarg, stmt, _, _, = val
1143
- warning "(...) interpreted as grouped expression"
1144
- lexer.cmdarg.restore cmdarg
1252
+ _, stmt, _, _, = val
1253
+ # warning "(...) interpreted as grouped expression"
1145
1254
  result = stmt
1146
1255
  }
1147
1256
  | tLPAREN compstmt tRPAREN
@@ -1153,15 +1262,15 @@ rule
1153
1262
  }
1154
1263
  | primary_value tCOLON2 tCONSTANT
1155
1264
  {
1156
- expr, _, id = val
1265
+ expr, _, (id, _line) = val
1157
1266
 
1158
1267
  result = s(:colon2, expr, id.to_sym).line expr.line
1159
1268
  }
1160
1269
  | tCOLON3 tCONSTANT
1161
1270
  {
1162
- _, id = val
1271
+ _, (id, line) = val
1163
1272
 
1164
- result = s(:colon3, id.to_sym).line lexer.lineno
1273
+ result = s(:colon3, id.to_sym).line line
1165
1274
  }
1166
1275
  | tLBRACK { result = lexer.lineno } aref_args tRBRACK
1167
1276
  {
@@ -1185,15 +1294,21 @@ rule
1185
1294
  }
1186
1295
  | kYIELD tLPAREN2 call_args rparen
1187
1296
  {
1188
- result = new_yield val[2]
1297
+ (_, line), _, args, _ = val
1298
+
1299
+ result = new_yield(args).line line
1189
1300
  }
1190
1301
  | kYIELD tLPAREN2 rparen
1191
1302
  {
1192
- result = new_yield
1303
+ (_, line), _, _ = val
1304
+
1305
+ result = new_yield.line line
1193
1306
  }
1194
1307
  | kYIELD
1195
1308
  {
1196
- result = new_yield
1309
+ (_, line), = val
1310
+
1311
+ result = new_yield.line line
1197
1312
  }
1198
1313
  | kDEFINED opt_nl tLPAREN2 expr rparen
1199
1314
  {
@@ -1208,7 +1323,7 @@ rule
1208
1323
  }
1209
1324
  | kNOT tLPAREN2 rparen
1210
1325
  {
1211
- debug20 14, val, result
1326
+ debug 20
1212
1327
  }
1213
1328
  | fcall brace_block
1214
1329
  {
@@ -1226,9 +1341,10 @@ rule
1226
1341
  iter.insert 1, call # FIX
1227
1342
  result = iter
1228
1343
  }
1229
- | tLAMBDA lambda
1344
+ | lambda
1230
1345
  {
1231
- result = val[1] # TODO: fix lineno
1346
+ expr, = val
1347
+ result = expr
1232
1348
  }
1233
1349
  | k_if expr_value then compstmt if_tail k_end
1234
1350
  {
@@ -1260,6 +1376,12 @@ rule
1260
1376
  (_, line), _, body, _ = val
1261
1377
  result = new_case nil, body, line
1262
1378
  }
1379
+ | k_case expr_value opt_terms p_case_body k_end
1380
+ {
1381
+ (_, line), expr, _, body, _ = val
1382
+
1383
+ result = new_case expr, body, line
1384
+ }
1263
1385
  | k_for for_var kIN expr_value_do compstmt k_end
1264
1386
  {
1265
1387
  _, var, _, iter, body, _ = val
@@ -1271,7 +1393,6 @@ rule
1271
1393
  }
1272
1394
  cpath superclass
1273
1395
  {
1274
- self.comments.push self.lexer.comments
1275
1396
  if (self.in_def || self.in_single > 0) then
1276
1397
  yyerror "class definition in method body"
1277
1398
  end
@@ -1281,7 +1402,7 @@ rule
1281
1402
  {
1282
1403
  result = new_class val
1283
1404
  self.env.unextend
1284
- self.lexer.comments # we don't care about comments in the body
1405
+ self.lexer.ignore_body_comments
1285
1406
  }
1286
1407
  | k_class tLSHFT
1287
1408
  {
@@ -1302,7 +1423,7 @@ rule
1302
1423
  {
1303
1424
  result = new_sclass val
1304
1425
  self.env.unextend
1305
- self.lexer.comments # we don't care about comments in the body
1426
+ self.lexer.ignore_body_comments
1306
1427
  }
1307
1428
  | k_module
1308
1429
  {
@@ -1310,7 +1431,6 @@ rule
1310
1431
  }
1311
1432
  cpath
1312
1433
  {
1313
- self.comments.push self.lexer.comments
1314
1434
  yyerror "module definition in method body" if
1315
1435
  self.in_def or self.in_single > 0
1316
1436
 
@@ -1320,53 +1440,67 @@ rule
1320
1440
  {
1321
1441
  result = new_module val
1322
1442
  self.env.unextend
1323
- self.lexer.comments # we don't care about comments in the body
1443
+ self.lexer.ignore_body_comments
1324
1444
  }
1325
1445
  | k_def fname
1326
1446
  {
1327
- result = [self.in_def, self.lexer.cmdarg.stack.dup]
1447
+ result = self.in_def
1328
1448
 
1329
- self.comments.push self.lexer.comments
1330
- self.in_def = true
1449
+ self.in_def = true # group = local_push
1331
1450
  self.env.extend
1332
- # TODO: local->cmdargs = cmdarg_stack;
1333
- # TODO: port local_push_gen and local_pop_gen
1334
- lexer.cmdarg.stack.replace [false]
1451
+ lexer.cmdarg.push false
1452
+ lexer.cond.push false
1335
1453
  }
1336
- f_arglist bodystmt { result = lexer.lineno } k_end
1454
+ f_arglist bodystmt k_end
1337
1455
  {
1338
- in_def, cmdarg = val[2]
1339
-
1340
- result = new_defn val
1456
+ result, in_def = new_defn val
1341
1457
 
1342
- lexer.cmdarg.stack.replace cmdarg
1458
+ lexer.cond.pop # group = local_pop
1459
+ lexer.cmdarg.pop
1343
1460
  self.env.unextend
1344
1461
  self.in_def = in_def
1345
- self.lexer.comments # we don't care about comments in the body
1462
+
1463
+ self.lexer.ignore_body_comments
1346
1464
  }
1347
1465
  | k_def singleton dot_or_colon
1348
1466
  {
1349
- self.comments.push self.lexer.comments
1350
1467
  lexer.lex_state = EXPR_FNAME
1351
1468
  }
1352
1469
  fname
1353
1470
  {
1354
- self.in_single += 1
1471
+ result = self.in_def
1472
+
1473
+ self.in_single += 1 # TODO: remove?
1474
+
1475
+ self.in_def = true # local_push
1355
1476
  self.env.extend
1356
- lexer.lex_state = EXPR_ENDFN # force for args
1357
- result = [lexer.lineno, self.lexer.cmdarg.stack.dup]
1358
- lexer.cmdarg.stack.replace [false]
1477
+ lexer.cmdarg.push false
1478
+ lexer.cond.push false
1479
+
1480
+ lexer.lex_state = EXPR_ENDFN|EXPR_LABEL
1359
1481
  }
1360
1482
  f_arglist bodystmt k_end
1361
1483
  {
1362
- _, cmdarg = val[5]
1363
- result = new_defs val
1364
1484
 
1365
- lexer.cmdarg.stack.replace cmdarg
1485
+ # [kdef, recv, _, _, (name, line), in_def, args, body, kend]
1486
+ # =>
1487
+ # [kdef, recv, (name, line), in_def, args, body, kend]
1366
1488
 
1489
+ val.delete_at 3
1490
+ val.delete_at 2
1491
+
1492
+ result, in_def = new_defs val
1493
+
1494
+ lexer.cond.pop # group = local_pop
1495
+ lexer.cmdarg.pop
1367
1496
  self.env.unextend
1497
+ self.in_def = in_def
1498
+
1368
1499
  self.in_single -= 1
1369
- self.lexer.comments # we don't care about comments in the body
1500
+
1501
+ # TODO: restore cur_arg ? what's cur_arg?
1502
+
1503
+ self.lexer.ignore_body_comments
1370
1504
  }
1371
1505
  | kBREAK
1372
1506
  {
@@ -1403,8 +1537,17 @@ rule
1403
1537
  k_case: kCASE
1404
1538
  k_for: kFOR
1405
1539
  k_class: kCLASS
1540
+ {
1541
+ self.comments.push self.lexer.comments
1542
+ }
1406
1543
  k_module: kMODULE
1544
+ {
1545
+ self.comments.push self.lexer.comments
1546
+ }
1407
1547
  k_def: kDEF
1548
+ {
1549
+ self.comments.push self.lexer.comments
1550
+ }
1408
1551
  k_do: kDO
1409
1552
  k_do_block: kDO_BLOCK
1410
1553
  k_rescue: kRESCUE
@@ -1465,51 +1608,42 @@ rule
1465
1608
 
1466
1609
  result = block_var args
1467
1610
  }
1468
- | f_marg_list tCOMMA tSTAR f_norm_arg
1611
+ | f_marg_list tCOMMA f_rest_marg
1469
1612
  {
1470
- args, _, _, splat = val
1613
+ args, _, rest = val
1471
1614
 
1472
- result = block_var args, "*#{splat}".to_sym
1615
+ result = block_var args, rest
1473
1616
  }
1474
- | f_marg_list tCOMMA tSTAR f_norm_arg tCOMMA f_marg_list
1617
+ | f_marg_list tCOMMA f_rest_marg tCOMMA f_marg_list
1475
1618
  {
1476
- args, _, _, splat, _, args2 = val
1619
+ lhs, _, splat, _, rhs = val
1477
1620
 
1478
- result = block_var args, "*#{splat}".to_sym, args2
1621
+ result = block_var lhs, splat, rhs
1479
1622
  }
1480
- | f_marg_list tCOMMA tSTAR
1623
+ | f_rest_marg
1481
1624
  {
1482
- args, _, _ = val
1625
+ rest, = val
1483
1626
 
1484
- result = block_var args, :*
1627
+ result = block_var rest
1485
1628
  }
1486
- | f_marg_list tCOMMA tSTAR tCOMMA f_marg_list
1629
+ | f_rest_marg tCOMMA f_marg_list
1487
1630
  {
1488
- args, _, _, _, args2 = val
1631
+ splat, _, rest = val
1489
1632
 
1490
- result = block_var args, :*, args2
1633
+ result = block_var splat, rest
1491
1634
  }
1492
- | tSTAR f_norm_arg
1493
- {
1494
- _, splat = val
1495
1635
 
1496
- result = block_var :"*#{splat}"
1497
- }
1498
- | tSTAR f_norm_arg tCOMMA f_marg_list
1636
+ f_rest_marg: tSTAR f_norm_arg
1499
1637
  {
1500
- _, splat, _, args = val
1638
+ _, (id, line) = val
1501
1639
 
1502
- result = block_var :"*#{splat}", args
1640
+ result = args ["*#{id}".to_sym]
1641
+ result.line line
1503
1642
  }
1504
1643
  | tSTAR
1505
1644
  {
1506
- result = block_var :*
1507
- }
1508
- | tSTAR tCOMMA f_marg_list
1509
- {
1510
- _, _, args = val
1511
-
1512
- result = block_var :*, args
1645
+ result = args [:*]
1646
+ result.line lexer.lineno # FIX: tSTAR -> line
1513
1647
  }
1514
1648
 
1515
1649
  block_args_tail: f_block_kwarg tCOMMA f_kwrest opt_f_block_arg
@@ -1524,10 +1658,14 @@ rule
1524
1658
  {
1525
1659
  result = call_args val
1526
1660
  }
1661
+ | f_no_kwarg opt_f_block_arg
1662
+ {
1663
+ result = args val
1664
+ }
1527
1665
  | f_block_arg
1528
1666
  {
1529
- line = lexer.lineno
1530
- result = call_args val # TODO: push line down
1667
+ (id, line), = val
1668
+ result = call_args [id]
1531
1669
  result.line line
1532
1670
  }
1533
1671
 
@@ -1636,13 +1774,13 @@ opt_block_args_tail: tCOMMA block_args_tail
1636
1774
 
1637
1775
  bvar: tIDENTIFIER
1638
1776
  {
1639
- id, = val
1640
- line = lexer.lineno
1777
+ (id, line), = val
1641
1778
  result = s(:shadow, id.to_sym).line line
1642
1779
  }
1643
1780
  | f_bad_arg
1644
1781
 
1645
- lambda: {
1782
+ lambda: tLAMBDA
1783
+ {
1646
1784
  self.env.extend :dynamic
1647
1785
  result = [lexer.lineno, lexer.lpar_beg]
1648
1786
  lexer.paren_nest += 1
@@ -1650,20 +1788,19 @@ opt_block_args_tail: tCOMMA block_args_tail
1650
1788
  }
1651
1789
  f_larglist
1652
1790
  {
1653
- result = lexer.cmdarg.store(false)
1791
+ lexer.cmdarg.push false
1654
1792
  }
1655
1793
  lambda_body
1656
1794
  {
1657
- (line, lpar), args, cmdarg, body = val
1795
+ _, (line, lpar), args, _cmdarg, body = val
1658
1796
  lexer.lpar_beg = lpar
1659
1797
 
1660
- lexer.cmdarg.restore cmdarg
1661
- lexer.cmdarg.lexpop
1798
+ lexer.cmdarg.pop
1662
1799
 
1663
1800
  call = s(:lambda).line line
1664
1801
  result = new_iter call, args, body
1665
- result.line = line
1666
- self.env.unextend
1802
+ result.line line
1803
+ self.env.unextend # TODO: dynapush & dynapop
1667
1804
  }
1668
1805
 
1669
1806
  f_larglist: tLPAREN2 f_args opt_bv_decl rparen
@@ -1697,23 +1834,28 @@ opt_block_args_tail: tCOMMA block_args_tail
1697
1834
  ## if (nd_type($1) == NODE_YIELD) {
1698
1835
  ## compile_error(PARSER_ARG "block given to yield");
1699
1836
 
1700
- syntax_error "Both block arg and actual block given." if
1701
- val[0].block_pass?
1837
+ cmd, blk = val
1702
1838
 
1703
- val = invert_block_call val if inverted? val
1839
+ syntax_error "Both block arg and actual block given." if
1840
+ cmd.block_pass?
1704
1841
 
1705
- cmd, blk = val
1842
+ if inverted? val then
1843
+ val = invert_block_call val
1844
+ cmd, blk = val
1845
+ end
1706
1846
 
1707
1847
  result = blk
1708
1848
  result.insert 1, cmd
1709
1849
  }
1710
1850
  | block_call call_op2 operation2 opt_paren_args
1711
1851
  {
1712
- result = new_call val[0], val[2].to_sym, val[3]
1852
+ lhs, _, (id, _line), args = val
1853
+
1854
+ result = new_call lhs, id.to_sym, args
1713
1855
  }
1714
1856
  | block_call call_op2 operation2 opt_paren_args brace_block
1715
1857
  {
1716
- iter1, _, name, args, iter2 = val
1858
+ iter1, _, (name, _line), args, iter2 = val
1717
1859
 
1718
1860
  call = new_call iter1, name.to_sym, args
1719
1861
  iter2.insert 1, call
@@ -1722,7 +1864,7 @@ opt_block_args_tail: tCOMMA block_args_tail
1722
1864
  }
1723
1865
  | block_call call_op2 operation2 command_args do_block
1724
1866
  {
1725
- iter1, _, name, args, iter2 = val
1867
+ iter1, _, (name, _line), args, iter2 = val
1726
1868
 
1727
1869
  call = new_call iter1, name.to_sym, args
1728
1870
  iter2.insert 1, call
@@ -1730,28 +1872,29 @@ opt_block_args_tail: tCOMMA block_args_tail
1730
1872
  result = iter2
1731
1873
  }
1732
1874
 
1733
- method_call: fcall
1875
+ method_call: fcall paren_args
1734
1876
  {
1735
- result = self.lexer.lineno
1736
- }
1737
- paren_args
1738
- {
1739
- call, lineno, args = val
1877
+ call, args = val
1740
1878
 
1741
1879
  result = call.concat args.sexp_body if args
1742
- result.line lineno
1743
1880
  }
1744
1881
  | primary_value call_op operation2 opt_paren_args
1745
1882
  {
1746
- result = new_call val[0], val[2].to_sym, val[3], val[1]
1883
+ recv, call_op, (op, _line), args = val
1884
+
1885
+ result = new_call recv, op.to_sym, args, call_op
1747
1886
  }
1748
1887
  | primary_value tCOLON2 operation2 paren_args
1749
1888
  {
1750
- result = new_call val[0], val[2].to_sym, val[3]
1889
+ recv, _, (op, _line), args = val
1890
+
1891
+ result = new_call recv, op.to_sym, args
1751
1892
  }
1752
1893
  | primary_value tCOLON2 operation3
1753
1894
  {
1754
- result = new_call val[0], val[2].to_sym
1895
+ lhs, _, (id, _line) = val
1896
+
1897
+ result = new_call lhs, id.to_sym
1755
1898
  }
1756
1899
  | primary_value call_op paren_args
1757
1900
  {
@@ -1784,7 +1927,7 @@ opt_block_args_tail: tCOMMA block_args_tail
1784
1927
  _, line, body, _ = val
1785
1928
 
1786
1929
  result = body
1787
- result.line = line
1930
+ result.line line
1788
1931
 
1789
1932
  self.env.unextend
1790
1933
  }
@@ -1798,7 +1941,7 @@ opt_block_args_tail: tCOMMA block_args_tail
1798
1941
  _, line, body, _ = val
1799
1942
 
1800
1943
  result = body
1801
- result.line = line
1944
+ result.line line
1802
1945
 
1803
1946
  self.env.unextend
1804
1947
  }
@@ -1816,29 +1959,557 @@ opt_block_args_tail: tCOMMA block_args_tail
1816
1959
  }
1817
1960
 
1818
1961
  do_body: { self.env.extend :dynamic; result = self.lexer.lineno }
1819
- { result = lexer.cmdarg.store(false) }
1962
+ { lexer.cmdarg.push false }
1820
1963
  opt_block_param
1821
1964
  bodystmt
1822
1965
  {
1823
- line, cmdarg, param, cmpstmt = val
1966
+ line, _cmdarg, param, cmpstmt = val
1824
1967
 
1825
1968
  result = new_do_body param, cmpstmt, line
1969
+ lexer.cmdarg.pop
1826
1970
  self.env.unextend
1827
- lexer.cmdarg.restore cmdarg
1971
+ }
1972
+
1973
+ case_args: arg_value
1974
+ {
1975
+ arg, = val
1976
+
1977
+ result = s(:array, arg).line arg.line
1978
+ }
1979
+ | tSTAR arg_value
1980
+ {
1981
+ _, arg = val
1982
+
1983
+ result = s(:array, s(:splat, arg).line(arg.line)).line arg.line
1984
+ }
1985
+ | case_args tCOMMA arg_value
1986
+ {
1987
+ args, _, id = val
1988
+
1989
+ result = self.list_append args, id
1990
+ }
1991
+ | case_args tCOMMA tSTAR arg_value
1992
+ {
1993
+ args, _, _, id = val
1994
+
1995
+ result = self.list_append args, s(:splat, id).line(id.line)
1828
1996
  }
1829
1997
 
1830
1998
  case_body: k_when
1831
1999
  {
1832
2000
  result = self.lexer.lineno
1833
2001
  }
1834
- args then compstmt cases
2002
+ case_args then compstmt cases
1835
2003
  {
1836
2004
  result = new_when(val[2], val[4])
1837
- result.line = val[1]
2005
+ result.line val[1]
1838
2006
  result << val[5] if val[5]
1839
2007
  }
1840
2008
 
1841
2009
  cases: opt_else | case_body
2010
+ ######################################################################
2011
+
2012
+ p_case_body: kIN
2013
+ {
2014
+ self.lexer.lex_state = EXPR_BEG|EXPR_LABEL
2015
+ self.lexer.command_start = false
2016
+ result = self.in_kwarg
2017
+ self.in_kwarg = true
2018
+ push_pvtbl
2019
+ push_pktbl
2020
+ }
2021
+ p_top_expr then
2022
+ {
2023
+ pop_pktbl
2024
+ pop_pvtbl
2025
+ old_kwargs = _values[-3]
2026
+ self.in_kwarg = old_kwargs
2027
+ }
2028
+ compstmt
2029
+ p_cases
2030
+ {
2031
+ (_, line), _, pat, _, _, body, cases = val
2032
+
2033
+ result = new_in pat, body, cases, line
2034
+ }
2035
+
2036
+ p_cases: opt_else
2037
+ | p_case_body
2038
+
2039
+ p_top_expr: p_top_expr_body
2040
+ | p_top_expr_body kIF_MOD expr_value
2041
+ {
2042
+ body, _, cond = val
2043
+ body = remove_begin body
2044
+
2045
+ result = s(:if, cond, body, nil).line body.line
2046
+ }
2047
+ | p_top_expr_body kUNLESS_MOD expr_value
2048
+ {
2049
+ body, _, cond = val
2050
+ body = remove_begin body
2051
+
2052
+ result = s(:if, cond, nil, body).line body.line
2053
+ }
2054
+
2055
+ p_top_expr_body: p_expr
2056
+ | p_expr tCOMMA
2057
+ {
2058
+ expr, _ = val
2059
+
2060
+ tail = new_array_pattern_tail nil, true, nil, nil
2061
+ result = new_array_pattern nil, expr, tail, expr.line
2062
+ }
2063
+ | p_expr tCOMMA p_args
2064
+ {
2065
+ expr, _, args = val
2066
+
2067
+ result = new_array_pattern nil, expr, args, expr.line
2068
+ }
2069
+ | p_args_tail
2070
+ {
2071
+ args, = val
2072
+ result = new_array_pattern nil, nil, args, args.line
2073
+ }
2074
+ | p_kwargs
2075
+ {
2076
+ kwargs, = val
2077
+ result = new_hash_pattern nil, kwargs, kwargs.line
2078
+ }
2079
+
2080
+ p_expr: p_as
2081
+
2082
+ p_as: p_expr tASSOC p_variable
2083
+ {
2084
+ # NODE *n = NEW_LIST($1, &@$);
2085
+ # n = list_append(p, n, $3);
2086
+ # $$ = new_hash(p, n, &@$);
2087
+
2088
+ expr, _, var = val
2089
+
2090
+ id = var.last
2091
+
2092
+ self.env[id] = :lvar # HACK: need to extend env
2093
+ lhs = s(:lasgn, id).line var.line
2094
+
2095
+ result = new_assign lhs, expr
2096
+ }
2097
+ | p_alt
2098
+
2099
+ p_alt: p_alt tPIPE p_expr_basic
2100
+ {
2101
+ lhs, _, rhs = val
2102
+
2103
+ result = s(:or, lhs, rhs).line lhs.line
2104
+ }
2105
+ | p_expr_basic
2106
+
2107
+ p_lparen: tLPAREN2 { push_pktbl }
2108
+ p_lbracket: tLBRACK2 { push_pktbl }
2109
+
2110
+ p_expr_basic: p_value
2111
+ | p_const p_lparen p_args tRPAREN
2112
+ {
2113
+ lhs, _, args, _ = val
2114
+
2115
+ pop_pktbl
2116
+ result = new_array_pattern(lhs, nil, args, lhs.line)
2117
+ }
2118
+ | p_const p_lparen p_kwargs tRPAREN
2119
+ {
2120
+ lhs, _, kwargs, _ = val
2121
+
2122
+ pop_pktbl
2123
+ result = new_hash_pattern(lhs, kwargs, lhs.line)
2124
+ }
2125
+ | p_const tLPAREN2 tRPAREN
2126
+ {
2127
+ const, _, _ = val
2128
+
2129
+ tail = new_array_pattern_tail nil, nil, nil, nil
2130
+ result = new_array_pattern const, nil, tail, const.line
2131
+ }
2132
+ | p_const p_lbracket p_args rbracket
2133
+ {
2134
+ const, _, pre_arg, _ = val
2135
+
2136
+ pop_pktbl
2137
+ result = new_array_pattern const, nil, pre_arg, const.line
2138
+ }
2139
+ | p_const p_lbracket p_kwargs rbracket
2140
+ {
2141
+ const, _, kwargs, _ = val
2142
+
2143
+ result = new_hash_pattern const, kwargs, const.line
2144
+ }
2145
+ | p_const tLBRACK2 rbracket
2146
+ {
2147
+ const, _, _ = val
2148
+
2149
+ tail = new_array_pattern_tail nil, nil, nil, nil
2150
+ result = new_array_pattern const, nil, tail, const.line
2151
+ }
2152
+ | tLBRACK { push_pktbl } p_args rbracket
2153
+ {
2154
+ _, _, pat, _ = val
2155
+
2156
+ pop_pktbl
2157
+ result = new_array_pattern nil, nil, pat, pat.line
2158
+ }
2159
+ | tLBRACK rbracket
2160
+ {
2161
+ (_, line), _ = val
2162
+
2163
+ result = s(:array_pat).line line
2164
+ }
2165
+ | tLBRACE
2166
+ {
2167
+ push_pktbl
2168
+ result = self.in_kwarg
2169
+ self.in_kwarg = false
2170
+ }
2171
+ p_kwargs rbrace
2172
+ {
2173
+ _, in_kwarg, kwargs, _ = val
2174
+
2175
+ pop_pktbl
2176
+ self.in_kwarg = in_kwarg
2177
+
2178
+ result = new_hash_pattern(nil, kwargs, kwargs.line)
2179
+ }
2180
+ | tLBRACE rbrace
2181
+ {
2182
+ (_, line), _ = val
2183
+
2184
+ tail = new_hash_pattern_tail nil, nil, line
2185
+ result = new_hash_pattern nil, tail, line
2186
+ }
2187
+ | tLPAREN { push_pktbl } p_expr tRPAREN
2188
+ {
2189
+ _, _, expr, _ = val
2190
+
2191
+ pop_pktbl
2192
+ result = expr
2193
+ }
2194
+
2195
+ p_args: p_expr
2196
+ {
2197
+ expr, = val
2198
+
2199
+ ary = s(:array_TAIL, expr).line expr.line
2200
+ result = new_array_pattern_tail(ary, nil, nil, nil).line expr.line
2201
+ }
2202
+ | p_args_head
2203
+ {
2204
+ head, = val
2205
+
2206
+ result = new_array_pattern_tail head, true, nil, nil
2207
+ }
2208
+ | p_args_head p_arg
2209
+ {
2210
+ head, tail = val
2211
+
2212
+ both = array_pat_concat head, tail
2213
+
2214
+ result = new_array_pattern_tail both, nil, nil, nil
2215
+ result.line head.line
2216
+ }
2217
+ | p_args_head tSTAR tIDENTIFIER
2218
+ {
2219
+ head, _, (id, _line) = val
2220
+
2221
+ result = new_array_pattern_tail head, true, id.to_sym, nil
2222
+ result.line head.line
2223
+ }
2224
+ | p_args_head tSTAR tIDENTIFIER tCOMMA p_args_post
2225
+ {
2226
+ head, _, (id, _line), _, post = val
2227
+
2228
+ result = new_array_pattern_tail head, true, id.to_sym, post
2229
+ result.line head.line
2230
+ }
2231
+ | p_args_head tSTAR
2232
+ {
2233
+ expr, _ = val
2234
+
2235
+ result = new_array_pattern_tail(expr, true, nil, nil).line expr.line
2236
+ }
2237
+ | p_args_head tSTAR tCOMMA p_args_post
2238
+ {
2239
+ head, _, _, post = val
2240
+
2241
+ result = new_array_pattern_tail(head, true, nil, post).line head.line
2242
+ }
2243
+ | p_args_tail
2244
+
2245
+ p_args_head: p_arg tCOMMA
2246
+ {
2247
+ arg, _ = val
2248
+ result = arg
2249
+ }
2250
+ | p_args_head p_arg tCOMMA
2251
+ {
2252
+ head, tail, _ = val
2253
+
2254
+ result = s(:PATTERN, *head.sexp_body, *tail.sexp_body)
2255
+ result.line head.line
2256
+ }
2257
+
2258
+ p_args_tail: tSTAR tIDENTIFIER
2259
+ {
2260
+ _, (id, line) = val
2261
+
2262
+ result = new_array_pattern_tail nil, true, id.to_sym, nil
2263
+ result.line line
2264
+ }
2265
+ | tSTAR tIDENTIFIER tCOMMA p_args_post
2266
+ {
2267
+ _, (id, line), _, rhs = val
2268
+
2269
+ result = new_array_pattern_tail nil, true, id.to_sym, rhs
2270
+ result.line line
2271
+ }
2272
+ | tSTAR
2273
+ {
2274
+ (_, line), = val
2275
+
2276
+ result = new_array_pattern_tail nil, true, nil, nil
2277
+ result.line line
2278
+ }
2279
+ | tSTAR tCOMMA p_args_post
2280
+ {
2281
+ (_, line), _, args = val
2282
+
2283
+ result = new_array_pattern_tail nil, true, nil, args
2284
+ result.line line
2285
+ }
2286
+
2287
+ p_args_post: p_arg
2288
+ | p_args_post tCOMMA p_arg
2289
+ {
2290
+ lhs, _, rhs = val
2291
+
2292
+ result = array_pat_concat lhs, rhs
2293
+ }
2294
+
2295
+ p_arg: p_expr
2296
+ {
2297
+ expr, = val
2298
+ expr = s(:array_TAIL, expr).line expr.line unless
2299
+ expr.sexp_type == :array_TAIL
2300
+ result = expr
2301
+ }
2302
+
2303
+ p_kwargs: p_kwarg tCOMMA p_kwrest
2304
+ {
2305
+ kw_arg, _, rest = val
2306
+ # TODO? new_unique_key_hash(p, $1, &@$)
2307
+ result = new_hash_pattern_tail kw_arg, rest, kw_arg.line
2308
+ }
2309
+ | p_kwarg
2310
+ {
2311
+ kwarg, = val
2312
+ # TODO? new_unique_key_hash(p, $1, &@$)
2313
+ result = new_hash_pattern_tail kwarg, nil, kwarg.line
2314
+ }
2315
+ | p_kwarg tCOMMA
2316
+ {
2317
+ kwarg, _ = val
2318
+ # TODO? new_unique_key_hash(p, $1, &@$)
2319
+ result = new_hash_pattern_tail kwarg, nil, kwarg.line
2320
+ }
2321
+ | p_kwrest
2322
+ {
2323
+ rest, = val
2324
+
2325
+ result = new_hash_pattern_tail nil, rest, rest.line
2326
+ }
2327
+ | p_kwarg tCOMMA p_kwnorest
2328
+ {
2329
+ kwarg, _, norest = val
2330
+
2331
+ # TODO? new_unique_key_hash(p, $1, &@$)
2332
+ result = new_hash_pattern_tail kwarg, norest, kwarg.line
2333
+ }
2334
+ | p_kwnorest
2335
+ {
2336
+ norest, = val
2337
+
2338
+ result = new_hash_pattern_tail nil, norest, norest.line
2339
+ }
2340
+
2341
+ p_kwarg: p_kw # TODO? rb_ary_new_from_args(1, $1)
2342
+ | p_kwarg tCOMMA p_kw
2343
+ {
2344
+ kwarg, _, kw = val
2345
+ kwarg.concat kw.sexp_body
2346
+ result = kwarg
2347
+ }
2348
+
2349
+ p_kw: p_kw_label p_expr
2350
+ {
2351
+ # TODO: error_duplicate_pattern_key(p, get_id($1), &@1);
2352
+ lhs, rhs = val
2353
+
2354
+ result = s(:PAIR, lhs, rhs).line lhs.line
2355
+ }
2356
+ | p_kw_label
2357
+ {
2358
+ lhs, = val
2359
+
2360
+ # TODO: error_duplicate_pattern_variable(p, get_id($1), &@1);
2361
+
2362
+ # TODO: if ($1 && !is_local_id(get_id($1))) {
2363
+ # yyerror1(&@1, "key must be valid as local variables");
2364
+ # }
2365
+
2366
+ # $$ = list_append(p, NEW_LIST(NEW_LIT(ID2SYM($1), &@$), &@$),
2367
+ # assignable(p, $1, 0, &@$));
2368
+
2369
+
2370
+ case lhs.sexp_type
2371
+ when :lit then
2372
+ assignable [lhs.value, lhs.line]
2373
+ else
2374
+ # TODO or done?
2375
+ debug 666
2376
+ end
2377
+
2378
+ # TODO PAIR -> LIST ?
2379
+ result = s(:PAIR, lhs, nil).line lhs.line
2380
+ }
2381
+
2382
+ p_kw_label: tLABEL
2383
+ {
2384
+ (id, line), = val
2385
+
2386
+ result = s(:lit, id.to_sym).line line
2387
+ }
2388
+
2389
+ p_kwrest: kwrest_mark tIDENTIFIER
2390
+ {
2391
+ _, (id, line) = val
2392
+
2393
+ name = id.to_sym
2394
+ self.assignable [name, line]
2395
+ result = s(:kwrest, :"**#{name}").line line
2396
+ }
2397
+ | kwrest_mark
2398
+ {
2399
+ (_, line), = val
2400
+
2401
+ result = s(:kwrest, :"**").line line
2402
+ }
2403
+
2404
+ p_kwnorest: kwrest_mark kNIL
2405
+ {
2406
+ (_, line), _ = val
2407
+
2408
+ # TODO: or s(:norest)? s(:**nil)?
2409
+ result = s(:kwrest, :"**nil").line line
2410
+ }
2411
+
2412
+ p_value: p_primitive
2413
+ | p_primitive tDOT2 p_primitive
2414
+ {
2415
+ lhs, _, rhs = val
2416
+
2417
+ lhs = value_expr lhs
2418
+ rhs = value_expr rhs
2419
+
2420
+ result = s(:dot2, lhs, rhs).line lhs.line
2421
+ }
2422
+ | p_primitive tDOT3 p_primitive
2423
+ {
2424
+ lhs, _, rhs = val
2425
+
2426
+ lhs = value_expr lhs
2427
+ rhs = value_expr rhs
2428
+
2429
+ result = s(:dot3, lhs, rhs).line lhs.line
2430
+ }
2431
+ | p_primitive tDOT2
2432
+ {
2433
+ v1, _ = val
2434
+
2435
+ result = s(:dot2, v1, nil).line v1.line
2436
+ }
2437
+ | p_primitive tDOT3
2438
+ {
2439
+ v1, _ = val
2440
+
2441
+ result = s(:dot3, v1, nil).line v1.line
2442
+ }
2443
+ | p_variable
2444
+ | p_var_ref
2445
+ | p_const
2446
+ | tBDOT2 p_primitive
2447
+ {
2448
+ _, v1 = val
2449
+
2450
+ result = s(:dot2, nil, v1).line v1.line
2451
+ }
2452
+ | tBDOT3 p_primitive
2453
+ {
2454
+ _, v1 = val
2455
+
2456
+ result = s(:dot3, nil, v1).line v1.line
2457
+ }
2458
+
2459
+ p_primitive: literal
2460
+ | strings
2461
+ | xstring
2462
+ | regexp
2463
+ | words
2464
+ | qwords
2465
+ | symbols
2466
+ | qsymbols
2467
+ | keyword_variable
2468
+ {
2469
+ # TODO? if (!($$ = gettable(p, $1, &@$))) $$ = NEW_BEGIN(0, &@$);
2470
+ var, = val
2471
+
2472
+ result = var
2473
+ }
2474
+ | lambda
2475
+
2476
+ p_variable: tIDENTIFIER
2477
+ {
2478
+ (id, line), = val
2479
+
2480
+ # TODO: error_duplicate_pattern_variable(p, $1, &@1);
2481
+ # TODO: assignable(p, $1, 0, &@$);
2482
+ result = s(:lvar, id.to_sym).line line
2483
+ }
2484
+
2485
+ p_var_ref: tCARET tIDENTIFIER
2486
+ {
2487
+ _, (id, line) = val
2488
+
2489
+ # TODO: check id against env for lvar or dvar
2490
+
2491
+ result = s(:lvar, id.to_sym).line line
2492
+ }
2493
+
2494
+ p_const: tCOLON3 cname
2495
+ {
2496
+ _, (id, line) = val
2497
+ result = s(:colon3, id.to_sym).line line
2498
+ }
2499
+ | p_const tCOLON2 cname
2500
+ {
2501
+ lhs, _, (id, _line) = val
2502
+
2503
+ l = lhs.line
2504
+ result = s(:const, s(:colon2, lhs, id.to_sym).line(l)).line l
2505
+ }
2506
+ | tCONSTANT
2507
+ {
2508
+ # TODO $$ = gettable(p, $1, &@$);
2509
+ (id, line), = val
2510
+ result = s(:const, id.to_sym).line line
2511
+ }
2512
+ ######################################################################
1842
2513
 
1843
2514
  opt_rescue: k_rescue exc_list exc_var then compstmt opt_rescue
1844
2515
  {
@@ -1880,17 +2551,10 @@ opt_block_args_tail: tCOMMA block_args_tail
1880
2551
 
1881
2552
  literal: numeric
1882
2553
  {
1883
- line = lexer.lineno
1884
- result = s(:lit, val[0])
1885
- result.line = line
2554
+ (lit, line), = val
2555
+ result = s(:lit, lit).line line
1886
2556
  }
1887
2557
  | symbol
1888
- {
1889
- line = lexer.lineno
1890
- result = s(:lit, val[0])
1891
- result.line = line
1892
- }
1893
- | dsym
1894
2558
 
1895
2559
  strings: string
1896
2560
  {
@@ -1901,7 +2565,7 @@ opt_block_args_tail: tCOMMA block_args_tail
1901
2565
 
1902
2566
  string: tCHAR
1903
2567
  {
1904
- debug20 23, val, result
2568
+ debug 37
1905
2569
  }
1906
2570
  | string1
1907
2571
  | string string1
@@ -1911,11 +2575,11 @@ opt_block_args_tail: tCOMMA block_args_tail
1911
2575
 
1912
2576
  string1: tSTRING_BEG string_contents tSTRING_END
1913
2577
  {
1914
- _, str, (_, func) = val
2578
+ (_, line), str, (_, func) = val
1915
2579
 
1916
- str = dedent str if func =~ RubyLexer::STR_FUNC_ICNTNT
2580
+ str = dedent str if func =~ RubyLexer::STR_FUNC_DEDENT
1917
2581
 
1918
- result = str
2582
+ result = str.line line
1919
2583
  }
1920
2584
  | tSTRING
1921
2585
  {
@@ -1924,7 +2588,7 @@ opt_block_args_tail: tCOMMA block_args_tail
1924
2588
 
1925
2589
  xstring: tXSTRING_BEG xstring_contents tSTRING_END
1926
2590
  {
1927
- result = new_xstring val[1]
2591
+ result = new_xstring val
1928
2592
  # TODO: dedent?!?! SERIOUSLY?!?
1929
2593
  }
1930
2594
 
@@ -1935,11 +2599,15 @@ opt_block_args_tail: tCOMMA block_args_tail
1935
2599
 
1936
2600
  words: tWORDS_BEG tSPACE tSTRING_END
1937
2601
  {
1938
- result = s(:array).line lexer.lineno
2602
+ (_, line), _, _ = val
2603
+
2604
+ result = s(:array).line line
1939
2605
  }
1940
2606
  | tWORDS_BEG word_list tSTRING_END
1941
2607
  {
1942
- result = val[1]
2608
+ (_, line), list, _ = val
2609
+
2610
+ result = list.line line
1943
2611
  }
1944
2612
 
1945
2613
  word_list: none
@@ -1959,18 +2627,20 @@ opt_block_args_tail: tCOMMA block_args_tail
1959
2627
 
1960
2628
  symbols: tSYMBOLS_BEG tSPACE tSTRING_END
1961
2629
  {
1962
- result = s(:array).line lexer.lineno
2630
+ (_, line), _, _ = val
2631
+
2632
+ result = s(:array).line line
1963
2633
  }
1964
- | tSYMBOLS_BEG { result = lexer.lineno } symbol_list tSTRING_END
2634
+ | tSYMBOLS_BEG symbol_list tSTRING_END
1965
2635
  {
1966
- _, line, list, _, = val
1967
- list.line = line
2636
+ (_, line), list, _, = val
2637
+ list.line line
1968
2638
  result = list
1969
2639
  }
1970
2640
 
1971
2641
  symbol_list: none
1972
2642
  {
1973
- result = new_symbol_list.line lexer.lineno
2643
+ result = new_symbol_list
1974
2644
  }
1975
2645
  | symbol_list word tSPACE
1976
2646
  {
@@ -1980,20 +2650,28 @@ opt_block_args_tail: tCOMMA block_args_tail
1980
2650
 
1981
2651
  qwords: tQWORDS_BEG tSPACE tSTRING_END
1982
2652
  {
1983
- result = s(:array).line lexer.lineno
2653
+ (_, line), _, _ = val
2654
+
2655
+ result = s(:array).line line
1984
2656
  }
1985
2657
  | tQWORDS_BEG qword_list tSTRING_END
1986
2658
  {
1987
- result = val[1]
2659
+ (_, line), list, _ = val
2660
+
2661
+ result = list.line line
1988
2662
  }
1989
2663
 
1990
2664
  qsymbols: tQSYMBOLS_BEG tSPACE tSTRING_END
1991
2665
  {
1992
- result = s(:array).line lexer.lineno # FIX
2666
+ (_, line), _, _ = val
2667
+
2668
+ result = s(:array).line line
1993
2669
  }
1994
2670
  | tQSYMBOLS_BEG qsym_list tSTRING_END
1995
2671
  {
1996
- result = val[1]
2672
+ (_, line), list, _ = val
2673
+
2674
+ result = list.line line
1997
2675
  }
1998
2676
 
1999
2677
  qword_list: none
@@ -2016,7 +2694,8 @@ opt_block_args_tail: tCOMMA block_args_tail
2016
2694
 
2017
2695
  string_contents: none
2018
2696
  {
2019
- result = s(:str, "").line lexer.lineno
2697
+ line = prev_value_to_lineno _values.last
2698
+ result = s(:str, +"").line line
2020
2699
  }
2021
2700
  | string_contents string_content
2022
2701
  {
@@ -2066,12 +2745,13 @@ regexp_contents: none
2066
2745
  result = [lexer.lex_strterm,
2067
2746
  lexer.brace_nest,
2068
2747
  lexer.string_nest, # TODO: remove
2069
- lexer.cond.store,
2070
- lexer.cmdarg.store,
2071
2748
  lexer.lex_state,
2072
2749
  lexer.lineno,
2073
2750
  ]
2074
2751
 
2752
+ lexer.cmdarg.push false
2753
+ lexer.cond.push false
2754
+
2075
2755
  lexer.lex_strterm = nil
2076
2756
  lexer.brace_nest = 0
2077
2757
  lexer.string_nest = 0
@@ -2083,14 +2763,15 @@ regexp_contents: none
2083
2763
  {
2084
2764
  _, memo, stmt, _ = val
2085
2765
 
2086
- lex_strterm, brace_nest, string_nest, oldcond, oldcmdarg, oldlex_state, line = memo
2766
+ lex_strterm, brace_nest, string_nest, oldlex_state, line = memo
2767
+ # TODO: heredoc_indent
2087
2768
 
2088
2769
  lexer.lex_strterm = lex_strterm
2089
2770
  lexer.brace_nest = brace_nest
2090
2771
  lexer.string_nest = string_nest
2091
2772
 
2092
- lexer.cond.restore oldcond
2093
- lexer.cmdarg.restore oldcmdarg
2773
+ lexer.cond.pop
2774
+ lexer.cmdarg.pop
2094
2775
 
2095
2776
  lexer.lex_state = oldlex_state
2096
2777
 
@@ -2105,29 +2786,49 @@ regexp_contents: none
2105
2786
  when nil then
2106
2787
  result = s(:evstr).line line
2107
2788
  else
2108
- debug20 25
2789
+ debug 38
2109
2790
  raise "unknown string body: #{stmt.inspect}"
2110
2791
  end
2111
2792
  }
2112
2793
 
2113
- string_dvar: tGVAR { result = s(:gvar, val[0].to_sym).line lexer.lineno }
2114
- | tIVAR { result = s(:ivar, val[0].to_sym).line lexer.lineno }
2115
- | tCVAR { result = s(:cvar, val[0].to_sym).line lexer.lineno }
2794
+ string_dvar: tGVAR
2795
+ {
2796
+ (id, line), = val
2797
+ result = s(:gvar, id.to_sym).line line
2798
+ }
2799
+ | tIVAR
2800
+ {
2801
+ (id, line), = val
2802
+ result = s(:ivar, id.to_sym).line line
2803
+ }
2804
+ | tCVAR
2805
+ {
2806
+ (id, line), = val
2807
+ result = s(:cvar, id.to_sym).line line
2808
+ }
2116
2809
  | backref
2117
2810
 
2118
- symbol: tSYMBEG sym
2811
+ symbol: ssym
2812
+ | dsym
2813
+
2814
+ ssym: tSYMBEG sym
2119
2815
  {
2816
+ _, (id, line) = val
2817
+
2120
2818
  lexer.lex_state = EXPR_END
2121
- result = val[1].to_sym
2819
+ result = s(:lit, id.to_sym).line line
2122
2820
  }
2123
2821
  | tSYMBOL
2124
2822
  {
2125
- result = val[0].to_sym
2823
+ (id, line), = val
2824
+
2825
+ lexer.lex_state = EXPR_END
2826
+ result = s(:lit, id.to_sym).line line
2126
2827
  }
2127
2828
 
2128
2829
  sym: fname | tIVAR | tGVAR | tCVAR
2129
2830
 
2130
- dsym: tSYMBEG xstring_contents tSTRING_END
2831
+ dsym: tSYMBEG string_contents tSTRING_END
2131
2832
  {
2132
2833
  _, result, _ = val
2133
2834
 
@@ -2143,14 +2844,15 @@ regexp_contents: none
2143
2844
  when :evstr then
2144
2845
  result = s(:dsym, "", result).line result.line
2145
2846
  else
2146
- debug20 26, val, result
2847
+ debug 39
2147
2848
  end
2148
2849
  }
2149
2850
 
2150
2851
  numeric: simple_numeric
2151
- | tUMINUS_NUM simple_numeric
2852
+ | tUMINUS_NUM simple_numeric =tLOWEST
2152
2853
  {
2153
- result = -val[1] # TODO: pt_testcase
2854
+ _, (num, line) = val
2855
+ result = [-num, line]
2154
2856
  }
2155
2857
 
2156
2858
  simple_numeric: tINTEGER
@@ -2183,8 +2885,10 @@ keyword_variable: kNIL { result = s(:nil).line lexer.lineno }
2183
2885
 
2184
2886
  var_ref: user_variable
2185
2887
  {
2186
- var = val[0]
2888
+ raise "NO: #{val.inspect}" if Sexp === val.first
2889
+ (var, line), = val
2187
2890
  result = Sexp === var ? var : self.gettable(var)
2891
+ result.line line
2188
2892
  }
2189
2893
  | keyword_variable
2190
2894
  {
@@ -2199,11 +2903,19 @@ keyword_variable: kNIL { result = s(:nil).line lexer.lineno }
2199
2903
  | keyword_variable
2200
2904
  {
2201
2905
  result = self.assignable val[0]
2202
- debug20 29, val, result
2906
+ debug 40
2203
2907
  }
2204
2908
 
2205
- backref: tNTH_REF { result = s(:nth_ref, val[0]).line lexer.lineno }
2206
- | tBACK_REF { result = s(:back_ref, val[0]).line lexer.lineno }
2909
+ backref: tNTH_REF
2910
+ {
2911
+ (ref, line), = val
2912
+ result = s(:nth_ref, ref).line line
2913
+ }
2914
+ | tBACK_REF
2915
+ {
2916
+ (ref, line), = val
2917
+ result = s(:back_ref, ref).line line
2918
+ }
2207
2919
 
2208
2920
  superclass: tLT
2209
2921
  {
@@ -2221,9 +2933,15 @@ keyword_variable: kNIL { result = s(:nil).line lexer.lineno }
2221
2933
 
2222
2934
  f_arglist: tLPAREN2 f_args rparen
2223
2935
  {
2224
- result = val[1]
2225
- self.lexer.lex_state = EXPR_BEG
2226
- self.lexer.command_start = true
2936
+ result = end_args val
2937
+ }
2938
+ | tLPAREN2 f_arg tCOMMA args_forward rparen
2939
+ {
2940
+ result = end_args val
2941
+ }
2942
+ | tLPAREN2 args_forward rparen
2943
+ {
2944
+ result = end_args val
2227
2945
  }
2228
2946
  | {
2229
2947
  result = self.in_kwarg
@@ -2232,12 +2950,7 @@ keyword_variable: kNIL { result = s(:nil).line lexer.lineno }
2232
2950
  }
2233
2951
  f_args term
2234
2952
  {
2235
- kwarg, args, _ = val
2236
-
2237
- self.in_kwarg = kwarg
2238
- result = args
2239
- lexer.lex_state = EXPR_BEG
2240
- lexer.command_start = true
2953
+ result = end_args val
2241
2954
  }
2242
2955
 
2243
2956
  args_tail: f_kwarg tCOMMA f_kwrest opt_f_block_arg
@@ -2252,6 +2965,10 @@ keyword_variable: kNIL { result = s(:nil).line lexer.lineno }
2252
2965
  {
2253
2966
  result = args val
2254
2967
  }
2968
+ | f_no_kwarg opt_f_block_arg
2969
+ {
2970
+ result = args val
2971
+ }
2255
2972
  | f_block_arg
2256
2973
 
2257
2974
  opt_args_tail: tCOMMA args_tail
@@ -2322,6 +3039,12 @@ keyword_variable: kNIL { result = s(:nil).line lexer.lineno }
2322
3039
  |
2323
3040
  {
2324
3041
  result = args val
3042
+ # result.line lexer.lineno
3043
+ }
3044
+
3045
+ args_forward: tBDOT3
3046
+ {
3047
+ result = s(:forward_args).line lexer.lineno
2325
3048
  }
2326
3049
 
2327
3050
  f_bad_arg: tCONSTANT
@@ -2344,10 +3067,11 @@ keyword_variable: kNIL { result = s(:nil).line lexer.lineno }
2344
3067
  f_norm_arg: f_bad_arg
2345
3068
  | tIDENTIFIER
2346
3069
  {
2347
- identifier = val[0].to_sym
3070
+ (id, line), = val
3071
+ identifier = id.to_sym
2348
3072
  self.env[identifier] = :lvar
2349
3073
 
2350
- result = identifier
3074
+ result = [identifier, line]
2351
3075
  }
2352
3076
 
2353
3077
  f_arg_asgn: f_norm_arg
@@ -2355,22 +3079,14 @@ keyword_variable: kNIL { result = s(:nil).line lexer.lineno }
2355
3079
  f_arg_item: f_arg_asgn
2356
3080
  | tLPAREN f_margs rparen
2357
3081
  {
2358
- result = val[1]
3082
+ _, margs, _ = val
3083
+
3084
+ result = margs
2359
3085
  }
2360
3086
 
2361
3087
  f_arg: f_arg_item
2362
3088
  {
2363
- arg, = val
2364
-
2365
- case arg
2366
- when Symbol then
2367
- result = s(:args, arg).line lexer.lineno
2368
- when Sexp then
2369
- result = arg
2370
- else
2371
- debug20 32
2372
- raise "Unknown f_arg type: #{val.inspect}"
2373
- end
3089
+ result = new_arg val
2374
3090
  }
2375
3091
  | f_arg tCOMMA f_arg_item
2376
3092
  {
@@ -2382,7 +3098,7 @@ keyword_variable: kNIL { result = s(:nil).line lexer.lineno }
2382
3098
  result = s(:args, list).line list.line
2383
3099
  end
2384
3100
 
2385
- result << item
3101
+ result << (Sexp === item ? item : item.first)
2386
3102
  }
2387
3103
 
2388
3104
  f_label: tLABEL
@@ -2443,26 +3159,37 @@ keyword_variable: kNIL { result = s(:nil).line lexer.lineno }
2443
3159
  kwrest_mark: tPOW
2444
3160
  | tDSTAR
2445
3161
 
3162
+ f_no_kwarg: kwrest_mark kNIL
3163
+ {
3164
+ result = :"**nil"
3165
+ }
3166
+
2446
3167
  f_kwrest: kwrest_mark tIDENTIFIER
2447
3168
  {
2448
- name = val[1].to_sym
2449
- self.assignable name
2450
- result = :"**#{name}"
3169
+ _, (id, line) = val
3170
+
3171
+ name = id.to_sym
3172
+ self.assignable [name, line]
3173
+ result = [:"**#{name}", line]
2451
3174
  }
2452
3175
  | kwrest_mark
2453
3176
  {
2454
- result = :"**"
3177
+ id = :"**"
3178
+ self.env[id] = :lvar # TODO: needed?!?
3179
+ result = [id, lexer.lineno] # TODO: tPOW/tDSTAR include lineno
2455
3180
  }
2456
3181
 
2457
3182
  f_opt: f_arg_asgn tEQL arg_value
2458
3183
  {
2459
- result = self.assignable val[0], val[2]
3184
+ lhs, _, rhs = val
3185
+ result = self.assignable lhs, rhs
2460
3186
  # TODO: detect duplicate names
2461
3187
  }
2462
3188
 
2463
3189
  f_block_opt: f_arg_asgn tEQL primary_value
2464
3190
  {
2465
- result = self.assignable val[0], val[2]
3191
+ lhs, _, rhs = val
3192
+ result = self.assignable lhs, rhs
2466
3193
  }
2467
3194
 
2468
3195
  f_block_optarg: f_block_opt
@@ -2492,30 +3219,33 @@ keyword_variable: kNIL { result = s(:nil).line lexer.lineno }
2492
3219
  f_rest_arg: restarg_mark tIDENTIFIER
2493
3220
  {
2494
3221
  # TODO: differs from parse.y - needs tests
2495
- name = val[1].to_sym
2496
- self.assignable name
2497
- result = :"*#{name}"
3222
+ _, (id, line) = val
3223
+ name = id.to_sym
3224
+ self.assignable [name, line]
3225
+ result = [:"*#{name}", line]
2498
3226
  }
2499
3227
  | restarg_mark
2500
3228
  {
2501
3229
  name = :"*"
2502
3230
  self.env[name] = :lvar
2503
- result = name
3231
+ result = [name, lexer.lineno] # FIX: tSTAR to include lineno
2504
3232
  }
2505
3233
 
2506
3234
  blkarg_mark: tAMPER2 | tAMPER
2507
3235
 
2508
3236
  f_block_arg: blkarg_mark tIDENTIFIER
2509
3237
  {
2510
- identifier = val[1].to_sym
3238
+ _, (id, line) = val
3239
+ identifier = id.to_sym
2511
3240
 
2512
3241
  self.env[identifier] = :lvar
2513
- result = "&#{identifier}".to_sym
3242
+ result = ["&#{identifier}".to_sym, line]
2514
3243
  }
2515
3244
 
2516
3245
  opt_f_block_arg: tCOMMA f_block_arg
2517
3246
  {
2518
- result = val[1]
3247
+ _, arg = val
3248
+ result = arg
2519
3249
  }
2520
3250
  |
2521
3251
  {
@@ -2564,9 +3294,11 @@ keyword_variable: kNIL { result = s(:nil).line lexer.lineno }
2564
3294
  }
2565
3295
  | tSTRING_BEG string_contents tLABEL_END arg_value
2566
3296
  {
2567
- _, sym, _, value = val
3297
+ (_, line), sym, _, value = val
3298
+
2568
3299
  sym.sexp_type = :dsym
2569
- result = s(:array, sym, value).line sym.line
3300
+
3301
+ result = s(:array, sym, value).line line
2570
3302
  }
2571
3303
  | tDSTAR arg_value
2572
3304
  {
@@ -2589,6 +3321,7 @@ keyword_variable: kNIL { result = s(:nil).line lexer.lineno }
2589
3321
  opt_nl: | tNL
2590
3322
  rparen: opt_nl tRPAREN
2591
3323
  rbracket: opt_nl tRBRACK
3324
+ rbrace: opt_nl tRCURLY
2592
3325
  trailer: | tNL | tCOMMA
2593
3326
 
2594
3327
  term: tSEMI { yyerrok }