brakeman 4.5.1 → 4.10.1

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