brakeman 5.4.0 → 6.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (438) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +22 -0
  3. data/README.md +3 -3
  4. data/bundle/load.rb +14 -15
  5. data/bundle/ruby/{2.7.0/gems/highline-2.0.3 → 3.0.0/gems/highline-2.1.0}/Changelog.md +6 -0
  6. data/bundle/ruby/{2.7.0/gems/highline-2.0.3 → 3.0.0/gems/highline-2.1.0}/Gemfile +2 -5
  7. data/bundle/ruby/{2.7.0/gems/highline-2.0.3 → 3.0.0/gems/highline-2.1.0}/README.md +1 -2
  8. data/bundle/ruby/{2.7.0/gems/highline-2.0.3 → 3.0.0/gems/highline-2.1.0}/highline.gemspec +1 -1
  9. data/bundle/ruby/{2.7.0/gems/highline-2.0.3 → 3.0.0/gems/highline-2.1.0}/lib/highline/menu.rb +0 -0
  10. data/bundle/ruby/{2.7.0/gems/highline-2.0.3 → 3.0.0/gems/highline-2.1.0}/lib/highline/question.rb +0 -0
  11. data/bundle/ruby/{2.7.0/gems/highline-2.0.3 → 3.0.0/gems/highline-2.1.0}/lib/highline/style.rb +0 -0
  12. data/bundle/ruby/{2.7.0/gems/highline-2.0.3 → 3.0.0/gems/highline-2.1.0}/lib/highline/terminal.rb +0 -0
  13. data/bundle/ruby/{2.7.0/gems/highline-2.0.3 → 3.0.0/gems/highline-2.1.0}/lib/highline/version.rb +1 -1
  14. data/bundle/ruby/{2.7.0/gems/highline-2.0.3 → 3.0.0/gems/highline-2.1.0}/lib/highline.rb +0 -0
  15. data/bundle/ruby/3.0.0/gems/parallel-1.23.0/lib/parallel/version.rb +4 -0
  16. data/bundle/ruby/{2.7.0/gems/parallel-1.22.1 → 3.0.0/gems/parallel-1.23.0}/lib/parallel.rb +43 -3
  17. data/bundle/ruby/{2.7.0/gems/ruby_parser-3.19.1 → 3.0.0/gems/ruby_parser-3.20.1}/History.rdoc +30 -0
  18. data/bundle/ruby/{2.7.0/gems/ruby_parser-3.19.1 → 3.0.0/gems/ruby_parser-3.20.1}/Manifest.txt +2 -0
  19. data/bundle/ruby/{2.7.0/gems/ruby_parser-3.19.1 → 3.0.0/gems/ruby_parser-3.20.1}/README.rdoc +2 -1
  20. data/bundle/ruby/{2.7.0/gems/ruby_parser-3.19.1 → 3.0.0/gems/ruby_parser-3.20.1}/lib/ruby20_parser.rb +171 -135
  21. data/bundle/ruby/{2.7.0/gems/ruby_parser-3.19.1 → 3.0.0/gems/ruby_parser-3.20.1}/lib/ruby20_parser.y +50 -16
  22. data/bundle/ruby/{2.7.0/gems/ruby_parser-3.19.1 → 3.0.0/gems/ruby_parser-3.20.1}/lib/ruby21_parser.rb +111 -75
  23. data/bundle/ruby/{2.7.0/gems/ruby_parser-3.19.1 → 3.0.0/gems/ruby_parser-3.20.1}/lib/ruby21_parser.y +50 -16
  24. data/bundle/ruby/{2.7.0/gems/ruby_parser-3.19.1 → 3.0.0/gems/ruby_parser-3.20.1}/lib/ruby22_parser.rb +239 -203
  25. data/bundle/ruby/{2.7.0/gems/ruby_parser-3.19.1 → 3.0.0/gems/ruby_parser-3.20.1}/lib/ruby22_parser.y +50 -16
  26. data/bundle/ruby/{2.7.0/gems/ruby_parser-3.19.1 → 3.0.0/gems/ruby_parser-3.20.1}/lib/ruby23_parser.rb +384 -348
  27. data/bundle/ruby/{2.7.0/gems/ruby_parser-3.19.1/lib/ruby24_parser.y → 3.0.0/gems/ruby_parser-3.20.1/lib/ruby23_parser.y} +51 -25
  28. data/bundle/ruby/{2.7.0/gems/ruby_parser-3.19.1 → 3.0.0/gems/ruby_parser-3.20.1}/lib/ruby24_parser.rb +97 -61
  29. data/bundle/ruby/{2.7.0/gems/ruby_parser-3.19.1/lib/ruby23_parser.y → 3.0.0/gems/ruby_parser-3.20.1/lib/ruby24_parser.y} +59 -17
  30. data/bundle/ruby/{2.7.0/gems/ruby_parser-3.19.1 → 3.0.0/gems/ruby_parser-3.20.1}/lib/ruby25_parser.rb +93 -57
  31. data/bundle/ruby/{2.7.0/gems/ruby_parser-3.19.1 → 3.0.0/gems/ruby_parser-3.20.1}/lib/ruby25_parser.y +50 -16
  32. data/bundle/ruby/{2.7.0/gems/ruby_parser-3.19.1 → 3.0.0/gems/ruby_parser-3.20.1}/lib/ruby26_parser.rb +93 -57
  33. data/bundle/ruby/{2.7.0/gems/ruby_parser-3.19.1 → 3.0.0/gems/ruby_parser-3.20.1}/lib/ruby26_parser.y +50 -16
  34. data/bundle/ruby/{2.7.0/gems/ruby_parser-3.19.1 → 3.0.0/gems/ruby_parser-3.20.1}/lib/ruby27_parser.rb +600 -548
  35. data/bundle/ruby/{2.7.0/gems/ruby_parser-3.19.1 → 3.0.0/gems/ruby_parser-3.20.1}/lib/ruby27_parser.y +63 -17
  36. data/bundle/ruby/{2.7.0/gems/ruby_parser-3.19.1 → 3.0.0/gems/ruby_parser-3.20.1}/lib/ruby30_parser.rb +383 -341
  37. data/bundle/ruby/{2.7.0/gems/ruby_parser-3.19.1 → 3.0.0/gems/ruby_parser-3.20.1}/lib/ruby30_parser.y +55 -17
  38. data/bundle/ruby/{2.7.0/gems/ruby_parser-3.19.1 → 3.0.0/gems/ruby_parser-3.20.1}/lib/ruby31_parser.rb +200 -158
  39. data/bundle/ruby/{2.7.0/gems/ruby_parser-3.19.1/lib/ruby3_parser.yy → 3.0.0/gems/ruby_parser-3.20.1/lib/ruby31_parser.y} +55 -72
  40. data/bundle/ruby/3.0.0/gems/ruby_parser-3.20.1/lib/ruby32_parser.rb +13664 -0
  41. data/bundle/ruby/{2.7.0/gems/ruby_parser-3.19.1/lib/ruby31_parser.y → 3.0.0/gems/ruby_parser-3.20.1/lib/ruby32_parser.y} +56 -18
  42. data/bundle/ruby/3.0.0/gems/ruby_parser-3.20.1/lib/ruby3_parser.yy +3576 -0
  43. data/bundle/ruby/{2.7.0/gems/ruby_parser-3.19.1 → 3.0.0/gems/ruby_parser-3.20.1}/lib/ruby_lexer.rb +11 -4
  44. data/bundle/ruby/{2.7.0/gems/ruby_parser-3.19.1 → 3.0.0/gems/ruby_parser-3.20.1}/lib/ruby_parser.rb +2 -0
  45. data/bundle/ruby/{2.7.0/gems/ruby_parser-3.19.1 → 3.0.0/gems/ruby_parser-3.20.1}/lib/ruby_parser.yy +63 -17
  46. data/bundle/ruby/{2.7.0/gems/ruby_parser-3.19.1 → 3.0.0/gems/ruby_parser-3.20.1}/lib/ruby_parser_extras.rb +30 -17
  47. data/bundle/ruby/{2.7.0/gems/sexp_processor-4.16.1 → 3.0.0/gems/sexp_processor-4.17.0}/History.rdoc +13 -0
  48. data/bundle/ruby/{2.7.0/gems/sexp_processor-4.16.1 → 3.0.0/gems/sexp_processor-4.17.0}/lib/pt_testcase.rb +3 -3
  49. data/bundle/ruby/{2.7.0/gems/sexp_processor-4.16.1 → 3.0.0/gems/sexp_processor-4.17.0}/lib/sexp.rb +8 -2
  50. data/bundle/ruby/{2.7.0/gems/sexp_processor-4.16.1 → 3.0.0/gems/sexp_processor-4.17.0}/lib/sexp_processor.rb +1 -1
  51. data/bundle/ruby/{2.7.0/gems/sexp_processor-4.16.1 → 3.0.0/gems/sexp_processor-4.17.0}/lib/strict_sexp.rb +6 -5
  52. data/lib/brakeman/app_tree.rb +0 -1
  53. data/lib/brakeman/checks/base_check.rb +2 -3
  54. data/lib/brakeman/checks/check_content_tag.rb +8 -5
  55. data/lib/brakeman/checks/check_eol_ruby.rb +3 -1
  56. data/lib/brakeman/checks/check_redirect.rb +60 -29
  57. data/lib/brakeman/checks/check_unscoped_find.rb +8 -0
  58. data/lib/brakeman/checks/eol_check.rb +2 -2
  59. data/lib/brakeman/processors/alias_processor.rb +50 -19
  60. data/lib/brakeman/processors/gem_processor.rb +2 -2
  61. data/lib/brakeman/report/report_github.rb +1 -1
  62. data/lib/brakeman/rescanner.rb +3 -1
  63. data/lib/brakeman/scanner.rb +1 -2
  64. data/lib/brakeman/tracker/config.rb +43 -4
  65. data/lib/brakeman/tracker.rb +1 -1
  66. data/lib/brakeman/util.rb +20 -4
  67. data/lib/brakeman/version.rb +1 -1
  68. data/lib/brakeman.rb +6 -2
  69. metadata +407 -420
  70. data/bundle/ruby/2.7.0/gems/highline-2.0.3/appveyor.yml +0 -37
  71. data/bundle/ruby/2.7.0/gems/parallel-1.22.1/lib/parallel/processor_count.rb +0 -44
  72. data/bundle/ruby/2.7.0/gems/parallel-1.22.1/lib/parallel/version.rb +0 -4
  73. data/bundle/ruby/2.7.0/gems/ruby_parser-legacy-1.0.0/History.rdoc +0 -6
  74. data/bundle/ruby/2.7.0/gems/ruby_parser-legacy-1.0.0/Manifest.txt +0 -19
  75. data/bundle/ruby/2.7.0/gems/ruby_parser-legacy-1.0.0/README.rdoc +0 -54
  76. data/bundle/ruby/2.7.0/gems/ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy/ruby18_parser.rb +0 -5794
  77. data/bundle/ruby/2.7.0/gems/ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy/ruby18_parser.y +0 -1909
  78. data/bundle/ruby/2.7.0/gems/ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy/ruby19_parser.rb +0 -6186
  79. data/bundle/ruby/2.7.0/gems/ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy/ruby19_parser.y +0 -2117
  80. data/bundle/ruby/2.7.0/gems/ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy/ruby_lexer.rb +0 -1412
  81. data/bundle/ruby/2.7.0/gems/ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy/ruby_lexer.rex +0 -179
  82. data/bundle/ruby/2.7.0/gems/ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy/ruby_lexer.rex.rb +0 -323
  83. data/bundle/ruby/2.7.0/gems/ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy/ruby_parser.rb +0 -30
  84. data/bundle/ruby/2.7.0/gems/ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy/ruby_parser_extras.rb +0 -1388
  85. data/bundle/ruby/2.7.0/gems/ruby_parser-legacy-1.0.0/lib/ruby_parser/legacy.rb +0 -5
  86. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/erubis-2.7.0/CHANGES.txt +0 -0
  87. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/erubis-2.7.0/MIT-LICENSE +0 -0
  88. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/erubis-2.7.0/README.txt +0 -0
  89. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/erubis-2.7.0/contrib/erubis +0 -0
  90. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/erubis-2.7.0/contrib/erubis-run.rb +0 -0
  91. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/erubis-2.7.0/contrib/inline-require +0 -0
  92. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/erubis-2.7.0/lib/erubis/context.rb +0 -0
  93. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/erubis-2.7.0/lib/erubis/converter.rb +0 -0
  94. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/erubis-2.7.0/lib/erubis/engine/ec.rb +0 -0
  95. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/erubis-2.7.0/lib/erubis/engine/ecpp.rb +0 -0
  96. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/erubis-2.7.0/lib/erubis/engine/ejava.rb +0 -0
  97. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/erubis-2.7.0/lib/erubis/engine/ejavascript.rb +0 -0
  98. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/erubis-2.7.0/lib/erubis/engine/enhanced.rb +0 -0
  99. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/erubis-2.7.0/lib/erubis/engine/eperl.rb +0 -0
  100. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/erubis-2.7.0/lib/erubis/engine/ephp.rb +0 -0
  101. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/erubis-2.7.0/lib/erubis/engine/eruby.rb +0 -0
  102. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/erubis-2.7.0/lib/erubis/engine/escheme.rb +0 -0
  103. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/erubis-2.7.0/lib/erubis/engine/optimized.rb +0 -0
  104. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/erubis-2.7.0/lib/erubis/engine.rb +0 -0
  105. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/erubis-2.7.0/lib/erubis/enhancer.rb +0 -0
  106. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/erubis-2.7.0/lib/erubis/error.rb +0 -0
  107. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/erubis-2.7.0/lib/erubis/evaluator.rb +0 -0
  108. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/erubis-2.7.0/lib/erubis/generator.rb +0 -0
  109. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/erubis-2.7.0/lib/erubis/helper.rb +0 -0
  110. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/erubis-2.7.0/lib/erubis/helpers/rails_form_helper.rb +0 -0
  111. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/erubis-2.7.0/lib/erubis/helpers/rails_helper.rb +0 -0
  112. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/erubis-2.7.0/lib/erubis/local-setting.rb +0 -0
  113. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/erubis-2.7.0/lib/erubis/main.rb +0 -0
  114. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/erubis-2.7.0/lib/erubis/preprocessing.rb +0 -0
  115. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/erubis-2.7.0/lib/erubis/tiny.rb +0 -0
  116. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/erubis-2.7.0/lib/erubis/util.rb +0 -0
  117. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/erubis-2.7.0/lib/erubis.rb +0 -0
  118. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/erubis-2.7.0/setup.rb +0 -0
  119. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/haml-5.2.2/CHANGELOG.md +0 -0
  120. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/haml-5.2.2/FAQ.md +0 -0
  121. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/haml-5.2.2/Gemfile +0 -0
  122. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/haml-5.2.2/MIT-LICENSE +0 -0
  123. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/haml-5.2.2/README.md +0 -0
  124. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/haml-5.2.2/REFERENCE.md +0 -0
  125. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/haml-5.2.2/TODO +0 -0
  126. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/haml-5.2.2/haml.gemspec +0 -0
  127. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/haml-5.2.2/lib/haml/attribute_builder.rb +0 -0
  128. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/haml-5.2.2/lib/haml/attribute_compiler.rb +0 -0
  129. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/haml-5.2.2/lib/haml/attribute_parser.rb +0 -0
  130. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/haml-5.2.2/lib/haml/buffer.rb +0 -0
  131. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/haml-5.2.2/lib/haml/compiler.rb +0 -0
  132. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/haml-5.2.2/lib/haml/engine.rb +0 -0
  133. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/haml-5.2.2/lib/haml/error.rb +0 -0
  134. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/haml-5.2.2/lib/haml/escapable.rb +0 -0
  135. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/haml-5.2.2/lib/haml/exec.rb +0 -0
  136. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/haml-5.2.2/lib/haml/filters.rb +0 -0
  137. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/haml-5.2.2/lib/haml/generator.rb +0 -0
  138. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/haml-5.2.2/lib/haml/helpers/action_view_extensions.rb +0 -0
  139. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/haml-5.2.2/lib/haml/helpers/action_view_mods.rb +0 -0
  140. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/haml-5.2.2/lib/haml/helpers/action_view_xss_mods.rb +0 -0
  141. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/haml-5.2.2/lib/haml/helpers/safe_erubi_template.rb +0 -0
  142. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/haml-5.2.2/lib/haml/helpers/safe_erubis_template.rb +0 -0
  143. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/haml-5.2.2/lib/haml/helpers/xss_mods.rb +0 -0
  144. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/haml-5.2.2/lib/haml/helpers.rb +0 -0
  145. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/haml-5.2.2/lib/haml/options.rb +0 -0
  146. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/haml-5.2.2/lib/haml/parser.rb +0 -0
  147. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/haml-5.2.2/lib/haml/plugin.rb +0 -0
  148. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/haml-5.2.2/lib/haml/railtie.rb +0 -0
  149. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/haml-5.2.2/lib/haml/sass_rails_filter.rb +0 -0
  150. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/haml-5.2.2/lib/haml/template/options.rb +0 -0
  151. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/haml-5.2.2/lib/haml/template.rb +0 -0
  152. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/haml-5.2.2/lib/haml/temple_engine.rb +0 -0
  153. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/haml-5.2.2/lib/haml/temple_line_counter.rb +0 -0
  154. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/haml-5.2.2/lib/haml/util.rb +0 -0
  155. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/haml-5.2.2/lib/haml/version.rb +0 -0
  156. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/haml-5.2.2/lib/haml.rb +0 -0
  157. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/haml-5.2.2/yard/default/fulldoc/html/css/common.sass +0 -0
  158. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/haml-5.2.2/yard/default/layout/html/footer.erb +0 -0
  159. /data/bundle/ruby/{2.7.0/gems/highline-2.0.3 → 3.0.0/gems/highline-2.1.0}/AUTHORS +0 -0
  160. /data/bundle/ruby/{2.7.0/gems/highline-2.0.3 → 3.0.0/gems/highline-2.1.0}/COPYING +0 -0
  161. /data/bundle/ruby/{2.7.0/gems/highline-2.0.3 → 3.0.0/gems/highline-2.1.0}/LICENSE +0 -0
  162. /data/bundle/ruby/{2.7.0/gems/highline-2.0.3 → 3.0.0/gems/highline-2.1.0}/TODO +0 -0
  163. /data/bundle/ruby/{2.7.0/gems/highline-2.0.3 → 3.0.0/gems/highline-2.1.0}/lib/highline/builtin_styles.rb +0 -0
  164. /data/bundle/ruby/{2.7.0/gems/highline-2.0.3 → 3.0.0/gems/highline-2.1.0}/lib/highline/color_scheme.rb +0 -0
  165. /data/bundle/ruby/{2.7.0/gems/highline-2.0.3 → 3.0.0/gems/highline-2.1.0}/lib/highline/compatibility.rb +0 -0
  166. /data/bundle/ruby/{2.7.0/gems/highline-2.0.3 → 3.0.0/gems/highline-2.1.0}/lib/highline/custom_errors.rb +0 -0
  167. /data/bundle/ruby/{2.7.0/gems/highline-2.0.3 → 3.0.0/gems/highline-2.1.0}/lib/highline/import.rb +0 -0
  168. /data/bundle/ruby/{2.7.0/gems/highline-2.0.3 → 3.0.0/gems/highline-2.1.0}/lib/highline/io_console_compatible.rb +0 -0
  169. /data/bundle/ruby/{2.7.0/gems/highline-2.0.3 → 3.0.0/gems/highline-2.1.0}/lib/highline/list.rb +0 -0
  170. /data/bundle/ruby/{2.7.0/gems/highline-2.0.3 → 3.0.0/gems/highline-2.1.0}/lib/highline/list_renderer.rb +0 -0
  171. /data/bundle/ruby/{2.7.0/gems/highline-2.0.3 → 3.0.0/gems/highline-2.1.0}/lib/highline/menu/item.rb +0 -0
  172. /data/bundle/ruby/{2.7.0/gems/highline-2.0.3 → 3.0.0/gems/highline-2.1.0}/lib/highline/paginator.rb +0 -0
  173. /data/bundle/ruby/{2.7.0/gems/highline-2.0.3 → 3.0.0/gems/highline-2.1.0}/lib/highline/question/answer_converter.rb +0 -0
  174. /data/bundle/ruby/{2.7.0/gems/highline-2.0.3 → 3.0.0/gems/highline-2.1.0}/lib/highline/question_asker.rb +0 -0
  175. /data/bundle/ruby/{2.7.0/gems/highline-2.0.3 → 3.0.0/gems/highline-2.1.0}/lib/highline/simulate.rb +0 -0
  176. /data/bundle/ruby/{2.7.0/gems/highline-2.0.3 → 3.0.0/gems/highline-2.1.0}/lib/highline/statement.rb +0 -0
  177. /data/bundle/ruby/{2.7.0/gems/highline-2.0.3 → 3.0.0/gems/highline-2.1.0}/lib/highline/string.rb +0 -0
  178. /data/bundle/ruby/{2.7.0/gems/highline-2.0.3 → 3.0.0/gems/highline-2.1.0}/lib/highline/string_extensions.rb +0 -0
  179. /data/bundle/ruby/{2.7.0/gems/highline-2.0.3 → 3.0.0/gems/highline-2.1.0}/lib/highline/template_renderer.rb +0 -0
  180. /data/bundle/ruby/{2.7.0/gems/highline-2.0.3 → 3.0.0/gems/highline-2.1.0}/lib/highline/terminal/io_console.rb +0 -0
  181. /data/bundle/ruby/{2.7.0/gems/highline-2.0.3 → 3.0.0/gems/highline-2.1.0}/lib/highline/terminal/ncurses.rb +0 -0
  182. /data/bundle/ruby/{2.7.0/gems/highline-2.0.3 → 3.0.0/gems/highline-2.1.0}/lib/highline/terminal/unix_stty.rb +0 -0
  183. /data/bundle/ruby/{2.7.0/gems/highline-2.0.3 → 3.0.0/gems/highline-2.1.0}/lib/highline/wrapper.rb +0 -0
  184. /data/bundle/ruby/{2.7.0/gems/parallel-1.22.1 → 3.0.0/gems/parallel-1.23.0}/MIT-LICENSE.txt +0 -0
  185. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/rexml-3.2.5/LICENSE.txt +0 -0
  186. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/rexml-3.2.5/NEWS.md +0 -0
  187. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/rexml-3.2.5/README.md +0 -0
  188. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/rexml-3.2.5/lib/rexml/attlistdecl.rb +0 -0
  189. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/rexml-3.2.5/lib/rexml/attribute.rb +0 -0
  190. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/rexml-3.2.5/lib/rexml/cdata.rb +0 -0
  191. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/rexml-3.2.5/lib/rexml/child.rb +0 -0
  192. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/rexml-3.2.5/lib/rexml/comment.rb +0 -0
  193. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/rexml-3.2.5/lib/rexml/doctype.rb +0 -0
  194. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/rexml-3.2.5/lib/rexml/document.rb +0 -0
  195. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/rexml-3.2.5/lib/rexml/dtd/attlistdecl.rb +0 -0
  196. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/rexml-3.2.5/lib/rexml/dtd/dtd.rb +0 -0
  197. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/rexml-3.2.5/lib/rexml/dtd/elementdecl.rb +0 -0
  198. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/rexml-3.2.5/lib/rexml/dtd/entitydecl.rb +0 -0
  199. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/rexml-3.2.5/lib/rexml/dtd/notationdecl.rb +0 -0
  200. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/rexml-3.2.5/lib/rexml/element.rb +0 -0
  201. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/rexml-3.2.5/lib/rexml/encoding.rb +0 -0
  202. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/rexml-3.2.5/lib/rexml/entity.rb +0 -0
  203. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/rexml-3.2.5/lib/rexml/formatters/default.rb +0 -0
  204. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/rexml-3.2.5/lib/rexml/formatters/pretty.rb +0 -0
  205. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/rexml-3.2.5/lib/rexml/formatters/transitive.rb +0 -0
  206. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/rexml-3.2.5/lib/rexml/functions.rb +0 -0
  207. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/rexml-3.2.5/lib/rexml/instruction.rb +0 -0
  208. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/rexml-3.2.5/lib/rexml/light/node.rb +0 -0
  209. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/rexml-3.2.5/lib/rexml/namespace.rb +0 -0
  210. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/rexml-3.2.5/lib/rexml/node.rb +0 -0
  211. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/rexml-3.2.5/lib/rexml/output.rb +0 -0
  212. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/rexml-3.2.5/lib/rexml/parent.rb +0 -0
  213. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/rexml-3.2.5/lib/rexml/parseexception.rb +0 -0
  214. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb +0 -0
  215. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/rexml-3.2.5/lib/rexml/parsers/lightparser.rb +0 -0
  216. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/rexml-3.2.5/lib/rexml/parsers/pullparser.rb +0 -0
  217. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/rexml-3.2.5/lib/rexml/parsers/sax2parser.rb +0 -0
  218. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/rexml-3.2.5/lib/rexml/parsers/streamparser.rb +0 -0
  219. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/rexml-3.2.5/lib/rexml/parsers/treeparser.rb +0 -0
  220. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/rexml-3.2.5/lib/rexml/parsers/ultralightparser.rb +0 -0
  221. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/rexml-3.2.5/lib/rexml/parsers/xpathparser.rb +0 -0
  222. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/rexml-3.2.5/lib/rexml/quickpath.rb +0 -0
  223. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/rexml-3.2.5/lib/rexml/rexml.rb +0 -0
  224. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/rexml-3.2.5/lib/rexml/sax2listener.rb +0 -0
  225. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/rexml-3.2.5/lib/rexml/security.rb +0 -0
  226. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/rexml-3.2.5/lib/rexml/source.rb +0 -0
  227. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/rexml-3.2.5/lib/rexml/streamlistener.rb +0 -0
  228. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/rexml-3.2.5/lib/rexml/text.rb +0 -0
  229. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/rexml-3.2.5/lib/rexml/undefinednamespaceexception.rb +0 -0
  230. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/rexml-3.2.5/lib/rexml/validation/relaxng.rb +0 -0
  231. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/rexml-3.2.5/lib/rexml/validation/validation.rb +0 -0
  232. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/rexml-3.2.5/lib/rexml/validation/validationexception.rb +0 -0
  233. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/rexml-3.2.5/lib/rexml/xmldecl.rb +0 -0
  234. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/rexml-3.2.5/lib/rexml/xmltokens.rb +0 -0
  235. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/rexml-3.2.5/lib/rexml/xpath.rb +0 -0
  236. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/rexml-3.2.5/lib/rexml/xpath_parser.rb +0 -0
  237. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/rexml-3.2.5/lib/rexml.rb +0 -0
  238. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/ruby2ruby-2.4.4/History.rdoc +0 -0
  239. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/ruby2ruby-2.4.4/Manifest.txt +0 -0
  240. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/ruby2ruby-2.4.4/README.rdoc +0 -0
  241. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/ruby2ruby-2.4.4/lib/ruby2ruby.rb +0 -0
  242. /data/bundle/ruby/{2.7.0/gems/ruby_parser-3.19.1 → 3.0.0/gems/ruby_parser-3.20.1}/compare/normalize.rb +0 -0
  243. /data/bundle/ruby/{2.7.0/gems/ruby_parser-3.19.1 → 3.0.0/gems/ruby_parser-3.20.1}/debugging.md +0 -0
  244. /data/bundle/ruby/{2.7.0/gems/ruby_parser-3.19.1 → 3.0.0/gems/ruby_parser-3.20.1}/gauntlet.md +0 -0
  245. /data/bundle/ruby/{2.7.0/gems/ruby_parser-3.19.1 → 3.0.0/gems/ruby_parser-3.20.1}/lib/rp_extensions.rb +0 -0
  246. /data/bundle/ruby/{2.7.0/gems/ruby_parser-3.19.1 → 3.0.0/gems/ruby_parser-3.20.1}/lib/rp_stringscanner.rb +0 -0
  247. /data/bundle/ruby/{2.7.0/gems/ruby_parser-3.19.1 → 3.0.0/gems/ruby_parser-3.20.1}/lib/ruby_lexer.rex +0 -0
  248. /data/bundle/ruby/{2.7.0/gems/ruby_parser-3.19.1 → 3.0.0/gems/ruby_parser-3.20.1}/lib/ruby_lexer.rex.rb +0 -0
  249. /data/bundle/ruby/{2.7.0/gems/ruby_parser-3.19.1 → 3.0.0/gems/ruby_parser-3.20.1}/lib/ruby_lexer_strings.rb +0 -0
  250. /data/bundle/ruby/{2.7.0/gems/ruby_parser-3.19.1 → 3.0.0/gems/ruby_parser-3.20.1}/tools/munge.rb +0 -0
  251. /data/bundle/ruby/{2.7.0/gems/ruby_parser-3.19.1 → 3.0.0/gems/ruby_parser-3.20.1}/tools/ripper.rb +0 -0
  252. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/safe_yaml-1.0.5/CHANGES.md +0 -0
  253. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/safe_yaml-1.0.5/Gemfile +0 -0
  254. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/safe_yaml-1.0.5/LICENSE.txt +0 -0
  255. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/safe_yaml-1.0.5/README.md +0 -0
  256. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/safe_yaml-1.0.5/bundle_install_all_ruby_versions.sh +0 -0
  257. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/deep.rb +0 -0
  258. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/libyaml_checker.rb +0 -0
  259. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/load.rb +0 -0
  260. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/parse/date.rb +0 -0
  261. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/parse/hexadecimal.rb +0 -0
  262. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/parse/sexagesimal.rb +0 -0
  263. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/psych_handler.rb +0 -0
  264. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/psych_resolver.rb +0 -0
  265. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/resolver.rb +0 -0
  266. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/safe_to_ruby_visitor.rb +0 -0
  267. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/store.rb +0 -0
  268. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/syck_hack.rb +0 -0
  269. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/syck_node_monkeypatch.rb +0 -0
  270. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/syck_resolver.rb +0 -0
  271. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/transform/to_boolean.rb +0 -0
  272. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/transform/to_date.rb +0 -0
  273. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/transform/to_float.rb +0 -0
  274. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/transform/to_integer.rb +0 -0
  275. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/transform/to_nil.rb +0 -0
  276. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/transform/to_symbol.rb +0 -0
  277. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/transform/transformation_map.rb +0 -0
  278. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/transform.rb +0 -0
  279. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/safe_yaml-1.0.5/lib/safe_yaml/version.rb +0 -0
  280. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/safe_yaml-1.0.5/lib/safe_yaml.rb +0 -0
  281. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/safe_yaml-1.0.5/run_specs_all_ruby_versions.sh +0 -0
  282. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/safe_yaml-1.0.5/safe_yaml.gemspec +0 -0
  283. /data/bundle/ruby/{2.7.0/gems/sexp_processor-4.16.1 → 3.0.0/gems/sexp_processor-4.17.0}/Manifest.txt +0 -0
  284. /data/bundle/ruby/{2.7.0/gems/sexp_processor-4.16.1 → 3.0.0/gems/sexp_processor-4.17.0}/README.rdoc +0 -0
  285. /data/bundle/ruby/{2.7.0/gems/sexp_processor-4.16.1 → 3.0.0/gems/sexp_processor-4.17.0}/lib/composite_sexp_processor.rb +0 -0
  286. /data/bundle/ruby/{2.7.0/gems/sexp_processor-4.16.1 → 3.0.0/gems/sexp_processor-4.17.0}/lib/sexp_matcher.rb +0 -0
  287. /data/bundle/ruby/{2.7.0/gems/sexp_processor-4.16.1 → 3.0.0/gems/sexp_processor-4.17.0}/lib/unique.rb +0 -0
  288. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/slim-4.1.0/CHANGES +0 -0
  289. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/slim-4.1.0/Gemfile +0 -0
  290. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/slim-4.1.0/LICENSE +0 -0
  291. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/slim-4.1.0/README.jp.md +0 -0
  292. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/slim-4.1.0/README.md +0 -0
  293. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/slim-4.1.0/lib/slim/code_attributes.rb +0 -0
  294. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/slim-4.1.0/lib/slim/command.rb +0 -0
  295. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/slim-4.1.0/lib/slim/controls.rb +0 -0
  296. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/slim-4.1.0/lib/slim/do_inserter.rb +0 -0
  297. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/slim-4.1.0/lib/slim/embedded.rb +0 -0
  298. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/slim-4.1.0/lib/slim/end_inserter.rb +0 -0
  299. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/slim-4.1.0/lib/slim/engine.rb +0 -0
  300. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/slim-4.1.0/lib/slim/erb_converter.rb +0 -0
  301. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/slim-4.1.0/lib/slim/filter.rb +0 -0
  302. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/slim-4.1.0/lib/slim/grammar.rb +0 -0
  303. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/slim-4.1.0/lib/slim/include.rb +0 -0
  304. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/slim-4.1.0/lib/slim/interpolation.rb +0 -0
  305. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/slim-4.1.0/lib/slim/logic_less/context.rb +0 -0
  306. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/slim-4.1.0/lib/slim/logic_less/filter.rb +0 -0
  307. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/slim-4.1.0/lib/slim/logic_less.rb +0 -0
  308. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/slim-4.1.0/lib/slim/parser.rb +0 -0
  309. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/slim-4.1.0/lib/slim/smart/escaper.rb +0 -0
  310. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/slim-4.1.0/lib/slim/smart/filter.rb +0 -0
  311. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/slim-4.1.0/lib/slim/smart/parser.rb +0 -0
  312. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/slim-4.1.0/lib/slim/smart.rb +0 -0
  313. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/slim-4.1.0/lib/slim/splat/builder.rb +0 -0
  314. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/slim-4.1.0/lib/slim/splat/filter.rb +0 -0
  315. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/slim-4.1.0/lib/slim/template.rb +0 -0
  316. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/slim-4.1.0/lib/slim/translator.rb +0 -0
  317. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/slim-4.1.0/lib/slim/version.rb +0 -0
  318. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/slim-4.1.0/lib/slim.rb +0 -0
  319. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/slim-4.1.0/slim.gemspec +0 -0
  320. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/temple-0.8.2/CHANGES +0 -0
  321. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/temple-0.8.2/EXPRESSIONS.md +0 -0
  322. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/temple-0.8.2/Gemfile +0 -0
  323. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/temple-0.8.2/LICENSE +0 -0
  324. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/temple-0.8.2/README.md +0 -0
  325. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/temple-0.8.2/lib/temple/engine.rb +0 -0
  326. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/temple-0.8.2/lib/temple/erb/engine.rb +0 -0
  327. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/temple-0.8.2/lib/temple/erb/parser.rb +0 -0
  328. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/temple-0.8.2/lib/temple/erb/template.rb +0 -0
  329. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/temple-0.8.2/lib/temple/erb/trimming.rb +0 -0
  330. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/temple-0.8.2/lib/temple/exceptions.rb +0 -0
  331. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/temple-0.8.2/lib/temple/filter.rb +0 -0
  332. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/temple-0.8.2/lib/temple/filters/code_merger.rb +0 -0
  333. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/temple-0.8.2/lib/temple/filters/control_flow.rb +0 -0
  334. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/temple-0.8.2/lib/temple/filters/dynamic_inliner.rb +0 -0
  335. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/temple-0.8.2/lib/temple/filters/encoding.rb +0 -0
  336. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/temple-0.8.2/lib/temple/filters/eraser.rb +0 -0
  337. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/temple-0.8.2/lib/temple/filters/escapable.rb +0 -0
  338. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/temple-0.8.2/lib/temple/filters/multi_flattener.rb +0 -0
  339. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/temple-0.8.2/lib/temple/filters/remove_bom.rb +0 -0
  340. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/temple-0.8.2/lib/temple/filters/static_analyzer.rb +0 -0
  341. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/temple-0.8.2/lib/temple/filters/static_merger.rb +0 -0
  342. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/temple-0.8.2/lib/temple/filters/string_splitter.rb +0 -0
  343. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/temple-0.8.2/lib/temple/filters/validator.rb +0 -0
  344. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/temple-0.8.2/lib/temple/generator.rb +0 -0
  345. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/temple-0.8.2/lib/temple/generators/array.rb +0 -0
  346. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/temple-0.8.2/lib/temple/generators/array_buffer.rb +0 -0
  347. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/temple-0.8.2/lib/temple/generators/erb.rb +0 -0
  348. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/temple-0.8.2/lib/temple/generators/rails_output_buffer.rb +0 -0
  349. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/temple-0.8.2/lib/temple/generators/string_buffer.rb +0 -0
  350. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/temple-0.8.2/lib/temple/grammar.rb +0 -0
  351. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/temple-0.8.2/lib/temple/html/attribute_merger.rb +0 -0
  352. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/temple-0.8.2/lib/temple/html/attribute_remover.rb +0 -0
  353. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/temple-0.8.2/lib/temple/html/attribute_sorter.rb +0 -0
  354. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/temple-0.8.2/lib/temple/html/dispatcher.rb +0 -0
  355. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/temple-0.8.2/lib/temple/html/fast.rb +0 -0
  356. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/temple-0.8.2/lib/temple/html/filter.rb +0 -0
  357. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/temple-0.8.2/lib/temple/html/pretty.rb +0 -0
  358. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/temple-0.8.2/lib/temple/html/safe.rb +0 -0
  359. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/temple-0.8.2/lib/temple/map.rb +0 -0
  360. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/temple-0.8.2/lib/temple/mixins/dispatcher.rb +0 -0
  361. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/temple-0.8.2/lib/temple/mixins/engine_dsl.rb +0 -0
  362. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/temple-0.8.2/lib/temple/mixins/grammar_dsl.rb +0 -0
  363. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/temple-0.8.2/lib/temple/mixins/options.rb +0 -0
  364. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/temple-0.8.2/lib/temple/mixins/template.rb +0 -0
  365. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/temple-0.8.2/lib/temple/parser.rb +0 -0
  366. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/temple-0.8.2/lib/temple/static_analyzer.rb +0 -0
  367. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/temple-0.8.2/lib/temple/templates/rails.rb +0 -0
  368. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/temple-0.8.2/lib/temple/templates/tilt.rb +0 -0
  369. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/temple-0.8.2/lib/temple/templates.rb +0 -0
  370. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/temple-0.8.2/lib/temple/utils.rb +0 -0
  371. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/temple-0.8.2/lib/temple/version.rb +0 -0
  372. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/temple-0.8.2/lib/temple.rb +0 -0
  373. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/temple-0.8.2/temple.gemspec +0 -0
  374. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/terminal-table-1.8.0/Gemfile +0 -0
  375. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/terminal-table-1.8.0/History.rdoc +0 -0
  376. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/terminal-table-1.8.0/LICENSE.txt +0 -0
  377. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/terminal-table-1.8.0/Manifest +0 -0
  378. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/terminal-table-1.8.0/README.rdoc +0 -0
  379. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/terminal-table-1.8.0/Todo.rdoc +0 -0
  380. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/terminal-table-1.8.0/lib/terminal-table/cell.rb +0 -0
  381. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/terminal-table-1.8.0/lib/terminal-table/import.rb +0 -0
  382. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/terminal-table-1.8.0/lib/terminal-table/row.rb +0 -0
  383. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/terminal-table-1.8.0/lib/terminal-table/separator.rb +0 -0
  384. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/terminal-table-1.8.0/lib/terminal-table/style.rb +0 -0
  385. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/terminal-table-1.8.0/lib/terminal-table/table.rb +0 -0
  386. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/terminal-table-1.8.0/lib/terminal-table/table_helper.rb +0 -0
  387. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/terminal-table-1.8.0/lib/terminal-table/version.rb +0 -0
  388. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/terminal-table-1.8.0/lib/terminal-table.rb +0 -0
  389. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/terminal-table-1.8.0/terminal-table.gemspec +0 -0
  390. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/tilt-2.0.11/COPYING +0 -0
  391. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/tilt-2.0.11/lib/tilt/asciidoc.rb +0 -0
  392. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/tilt-2.0.11/lib/tilt/babel.rb +0 -0
  393. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/tilt-2.0.11/lib/tilt/bluecloth.rb +0 -0
  394. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/tilt-2.0.11/lib/tilt/builder.rb +0 -0
  395. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/tilt-2.0.11/lib/tilt/coffee.rb +0 -0
  396. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/tilt-2.0.11/lib/tilt/commonmarker.rb +0 -0
  397. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/tilt-2.0.11/lib/tilt/creole.rb +0 -0
  398. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/tilt-2.0.11/lib/tilt/csv.rb +0 -0
  399. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/tilt-2.0.11/lib/tilt/dummy.rb +0 -0
  400. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/tilt-2.0.11/lib/tilt/erb.rb +0 -0
  401. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/tilt-2.0.11/lib/tilt/erubi.rb +0 -0
  402. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/tilt-2.0.11/lib/tilt/erubis.rb +0 -0
  403. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/tilt-2.0.11/lib/tilt/etanni.rb +0 -0
  404. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/tilt-2.0.11/lib/tilt/haml.rb +0 -0
  405. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/tilt-2.0.11/lib/tilt/kramdown.rb +0 -0
  406. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/tilt-2.0.11/lib/tilt/less.rb +0 -0
  407. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/tilt-2.0.11/lib/tilt/liquid.rb +0 -0
  408. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/tilt-2.0.11/lib/tilt/livescript.rb +0 -0
  409. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/tilt-2.0.11/lib/tilt/mapping.rb +0 -0
  410. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/tilt-2.0.11/lib/tilt/markaby.rb +0 -0
  411. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/tilt-2.0.11/lib/tilt/maruku.rb +0 -0
  412. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/tilt-2.0.11/lib/tilt/nokogiri.rb +0 -0
  413. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/tilt-2.0.11/lib/tilt/pandoc.rb +0 -0
  414. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/tilt-2.0.11/lib/tilt/plain.rb +0 -0
  415. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/tilt-2.0.11/lib/tilt/prawn.rb +0 -0
  416. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/tilt-2.0.11/lib/tilt/radius.rb +0 -0
  417. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/tilt-2.0.11/lib/tilt/rdiscount.rb +0 -0
  418. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/tilt-2.0.11/lib/tilt/rdoc.rb +0 -0
  419. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/tilt-2.0.11/lib/tilt/redcarpet.rb +0 -0
  420. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/tilt-2.0.11/lib/tilt/redcloth.rb +0 -0
  421. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/tilt-2.0.11/lib/tilt/rst-pandoc.rb +0 -0
  422. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/tilt-2.0.11/lib/tilt/sass.rb +0 -0
  423. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/tilt-2.0.11/lib/tilt/sigil.rb +0 -0
  424. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/tilt-2.0.11/lib/tilt/string.rb +0 -0
  425. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/tilt-2.0.11/lib/tilt/template.rb +0 -0
  426. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/tilt-2.0.11/lib/tilt/typescript.rb +0 -0
  427. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/tilt-2.0.11/lib/tilt/wikicloth.rb +0 -0
  428. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/tilt-2.0.11/lib/tilt/yajl.rb +0 -0
  429. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/tilt-2.0.11/lib/tilt.rb +0 -0
  430. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/unicode-display_width-1.8.0/CHANGELOG.md +0 -0
  431. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/unicode-display_width-1.8.0/MIT-LICENSE.txt +0 -0
  432. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/unicode-display_width-1.8.0/README.md +0 -0
  433. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/unicode-display_width-1.8.0/data/display_width.marshal.gz +0 -0
  434. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/unicode-display_width-1.8.0/lib/unicode/display_width/constants.rb +0 -0
  435. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/unicode-display_width-1.8.0/lib/unicode/display_width/index.rb +0 -0
  436. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/unicode-display_width-1.8.0/lib/unicode/display_width/no_string_ext.rb +0 -0
  437. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/unicode-display_width-1.8.0/lib/unicode/display_width/string_ext.rb +0 -0
  438. /data/bundle/ruby/{2.7.0 → 3.0.0}/gems/unicode-display_width-1.8.0/lib/unicode/display_width.rb +0 -0
@@ -0,0 +1,3576 @@
1
+ # -*- racc -*-
2
+
3
+ #if V == 30
4
+ class Ruby30Parser
5
+ #elif V == 31
6
+ class Ruby31Parser
7
+ #elif V == 32
8
+ class Ruby32Parser
9
+ #else
10
+ fail "version not specified or supported on code generation"
11
+ #endif
12
+
13
+ token kCLASS kMODULE kDEF kUNDEF kBEGIN kRESCUE kENSURE kEND kIF kUNLESS
14
+ kTHEN kELSIF kELSE kCASE kWHEN kWHILE kUNTIL kFOR kBREAK kNEXT
15
+ kREDO kRETRY kIN kDO kDO_COND kDO_BLOCK kDO_LAMBDA kRETURN kYIELD kSUPER
16
+ kSELF kNIL kTRUE kFALSE kAND kOR kNOT kIF_MOD kUNLESS_MOD kWHILE_MOD
17
+ kUNTIL_MOD kRESCUE_MOD kALIAS kDEFINED klBEGIN klEND k__LINE__
18
+ k__FILE__ k__ENCODING__ tIDENTIFIER tFID tGVAR tIVAR tCONSTANT
19
+ tLABEL tCVAR tNTH_REF tBACK_REF tSTRING_CONTENT tINTEGER tFLOAT
20
+ tREGEXP_END tUPLUS tUMINUS tUMINUS_NUM tPOW tCMP tEQ tEQQ tNEQ
21
+ tGEQ tLEQ tANDOP tOROP tMATCH tNMATCH tDOT tDOT2 tDOT3 tAREF
22
+ tASET tLSHFT tRSHFT tCOLON2 tCOLON3 tOP_ASGN tASSOC tLPAREN
23
+ tLPAREN2 tRPAREN tLPAREN_ARG tLBRACK tLBRACK2 tRBRACK tLBRACE
24
+ tLBRACE_ARG tSTAR tSTAR2 tAMPER tAMPER2 tTILDE tPERCENT tDIVIDE
25
+ tPLUS tMINUS tLT tGT tPIPE tBANG tCARET tLCURLY tRCURLY
26
+ tBACK_REF2 tSYMBEG tSTRING_BEG tXSTRING_BEG tREGEXP_BEG
27
+ tWORDS_BEG tQWORDS_BEG tSTRING_DBEG tSTRING_DVAR tSTRING_END
28
+ tSTRING tSYMBOL tNL tEH tCOLON tCOMMA tSPACE tSEMI tLAMBDA
29
+ tLAMBEG tDSTAR tCHAR tSYMBOLS_BEG tQSYMBOLS_BEG tSTRING_DEND
30
+ tRATIONAL tIMAGINARY
31
+ tLABEL_END
32
+ tLONELY
33
+ tBDOT2 tBDOT3
34
+
35
+ preclow
36
+ nonassoc tLOWEST
37
+ nonassoc tLBRACE_ARG
38
+ nonassoc kIF_MOD kUNLESS_MOD kWHILE_MOD kUNTIL_MOD
39
+ left kOR kAND
40
+ right kNOT
41
+ nonassoc kDEFINED
42
+ right tEQL tOP_ASGN
43
+ left kRESCUE_MOD
44
+ right tEH tCOLON
45
+ nonassoc tDOT2 tDOT3 tBDOT2 tBDOT3
46
+ left tOROP
47
+ left tANDOP
48
+ nonassoc tCMP tEQ tEQQ tNEQ tMATCH tNMATCH
49
+ left tGT tGEQ tLT tLEQ
50
+ left tPIPE tCARET
51
+ left tAMPER2
52
+ left tLSHFT tRSHFT
53
+ left tPLUS tMINUS
54
+ left tSTAR2 tDIVIDE tPERCENT # TODO: tSTAR2 -> tMULT
55
+ right tUMINUS_NUM tUMINUS
56
+ right tPOW
57
+ right tBANG tTILDE tUPLUS
58
+ prechigh
59
+
60
+ rule
61
+
62
+ program: {
63
+ self.lexer.lex_state = EXPR_BEG
64
+ }
65
+ top_compstmt
66
+ {
67
+ result = new_compstmt val
68
+
69
+ lexer.cond.pop # local_pop
70
+ lexer.cmdarg.pop
71
+ }
72
+
73
+ top_compstmt: top_stmts opt_terms
74
+ {
75
+ stmt, _ = val
76
+ result = stmt
77
+ }
78
+
79
+ top_stmts: none
80
+ | top_stmt
81
+ | top_stmts terms top_stmt
82
+ {
83
+ result = self.block_append val[0], val[2]
84
+ }
85
+ | error top_stmt
86
+
87
+ top_stmt: stmt
88
+ | klBEGIN
89
+ {
90
+ if (self.in_def || self.in_single > 0) then
91
+ debug 1
92
+ yyerror "BEGIN in method"
93
+ end
94
+ self.env.extend
95
+ }
96
+ begin_block
97
+ {
98
+ (_, lineno), _, iter = val
99
+ iter.line lineno
100
+
101
+ (_, preexe,) = iter
102
+ preexe.line lineno
103
+
104
+ result = iter
105
+ }
106
+
107
+ begin_block: tLCURLY { result = lexer.lineno } top_compstmt tRCURLY
108
+ {
109
+ _, line, stmt, _ = val
110
+ result = new_iter s(:preexe).line(line), 0, stmt
111
+ }
112
+
113
+ bodystmt: compstmt opt_rescue k_else
114
+ {
115
+ res = _values[-2]
116
+ yyerror "else without rescue is useless" unless res
117
+ }
118
+ compstmt
119
+ opt_ensure
120
+ {
121
+ body, resc, _, _, els, ens = val
122
+
123
+ result = new_body [body, resc, els, ens]
124
+ }
125
+ | compstmt opt_rescue opt_ensure
126
+ {
127
+ body, resc, ens = val
128
+
129
+ result = new_body [body, resc, nil, ens]
130
+ }
131
+
132
+ compstmt: stmts opt_terms
133
+ {
134
+ result = new_compstmt val
135
+ }
136
+
137
+ stmts: none
138
+ | stmt_or_begin # TODO: newline_node ?
139
+ | stmts terms stmt_or_begin
140
+ {
141
+ result = self.block_append val[0], val[2]
142
+ }
143
+ | error stmt
144
+ {
145
+ result = val[1]
146
+ debug 2
147
+ }
148
+
149
+ stmt_or_begin: stmt
150
+ | klBEGIN
151
+ {
152
+ yyerror "BEGIN is permitted only at toplevel"
153
+ }
154
+ begin_block
155
+ {
156
+ result = val[2] # wtf?
157
+ }
158
+
159
+ stmt: kALIAS fitem
160
+ {
161
+ lexer.lex_state = EXPR_FNAME
162
+ }
163
+ fitem
164
+ {
165
+ (_, line), lhs, _, rhs = val
166
+ result = s(:alias, lhs, rhs).line(line).line line
167
+ }
168
+ | kALIAS tGVAR tGVAR
169
+ {
170
+ (_, line), (lhs, _), (rhs, _) = val
171
+ result = s(:valias, lhs.to_sym, rhs.to_sym).line line
172
+ }
173
+ | kALIAS tGVAR tBACK_REF
174
+ {
175
+ (_, line), (lhs, _), (rhs, _) = val
176
+ result = s(:valias, lhs.to_sym, :"$#{rhs}").line line
177
+ }
178
+ | kALIAS tGVAR tNTH_REF
179
+ {
180
+ yyerror "can't make alias for the number variables"
181
+ }
182
+ | kUNDEF undef_list
183
+ {
184
+ result = val[1]
185
+ }
186
+ | stmt kIF_MOD expr_value
187
+ {
188
+ t, _, c = val
189
+ result = new_if c, t, nil
190
+ }
191
+ | stmt kUNLESS_MOD expr_value
192
+ {
193
+ f, _, c = val
194
+ result = new_if c, nil, f
195
+ }
196
+ | stmt kWHILE_MOD expr_value
197
+ {
198
+ e, _, c = val
199
+ result = new_while e, c, true
200
+ }
201
+ | stmt kUNTIL_MOD expr_value
202
+ {
203
+ e, _, c = val
204
+ result = new_until e, c, true
205
+ }
206
+ | stmt kRESCUE_MOD stmt
207
+ {
208
+ body, _, resbody = val
209
+
210
+ resbody = new_resbody s(:array).line(resbody.line), resbody
211
+ result = new_rescue body, resbody
212
+ }
213
+ | klEND tLCURLY compstmt tRCURLY
214
+ {
215
+ (_, line), _, stmt, _ = val
216
+
217
+ if (self.in_def || self.in_single > 0) then
218
+ debug 3
219
+ yyerror "END in method; use at_exit"
220
+ end
221
+
222
+ result = new_iter s(:postexe).line(line), 0, stmt
223
+ }
224
+ | command_asgn
225
+ | mlhs tEQL command_call
226
+ {
227
+ result = new_masgn val[0], val[2], :wrap
228
+ }
229
+ | lhs tEQL mrhs
230
+ {
231
+ lhs, _, rhs = val
232
+
233
+ result = new_assign lhs, s(:svalue, rhs).line(rhs.line)
234
+ }
235
+ | mlhs tEQL mrhs_arg kRESCUE_MOD stmt
236
+ {
237
+ # unwraps s(:to_ary, rhs)
238
+ lhs, _, (_, rhs), _, resbody = val
239
+
240
+ resbody = new_resbody s(:array).line(resbody.line), resbody
241
+
242
+ result = new_masgn lhs, new_rescue(rhs, resbody), :wrap
243
+ }
244
+ | mlhs tEQL mrhs_arg
245
+ {
246
+ result = new_masgn val[0], val[2]
247
+ }
248
+ | expr
249
+
250
+ command_asgn: lhs tEQL command_rhs
251
+ {
252
+ result = new_assign val[0], val[2]
253
+ }
254
+ # | lhs tEQL command_asgn
255
+ # {
256
+ # result = new_assign val[0], val[2]
257
+ # }
258
+ | var_lhs tOP_ASGN command_rhs
259
+ {
260
+ result = new_op_asgn val
261
+ }
262
+ | primary_value tLBRACK2 opt_call_args rbracket tOP_ASGN command_rhs
263
+ {
264
+ result = new_op_asgn1 val
265
+ }
266
+ | primary_value call_op tIDENTIFIER tOP_ASGN command_rhs
267
+ {
268
+ prim, (call_op, _), (id, _), (op_asgn, _), rhs = val
269
+
270
+ result = s(:op_asgn, prim, rhs, id.to_sym, op_asgn.to_sym)
271
+ result.sexp_type = :safe_op_asgn if call_op == '&.'
272
+ result.line prim.line
273
+ }
274
+ | primary_value call_op tCONSTANT tOP_ASGN command_rhs
275
+ {
276
+ prim, (call_op, _), (id, _), (op_asgn, _), rhs = val
277
+
278
+ result = s(:op_asgn, prim, rhs, id.to_sym, op_asgn.to_sym)
279
+ result.sexp_type = :safe_op_asgn if call_op == '&.'
280
+ result.line prim.line
281
+ }
282
+ | primary_value tCOLON2 tCONSTANT tOP_ASGN command_rhs
283
+ {
284
+ lhs1, _, (lhs2, line), (id, _), rhs = val
285
+
286
+ result = s(:op_asgn, lhs1, rhs, lhs2.to_sym, id.to_sym).line line
287
+ }
288
+ | primary_value tCOLON2 tIDENTIFIER tOP_ASGN command_rhs
289
+ {
290
+ lhs1, _, (lhs2, line), (id, _), rhs = val
291
+
292
+ result = s(:op_asgn, lhs1, rhs, lhs2.to_sym, id.to_sym).line line
293
+ }
294
+ #if V > 30
295
+ | defn_head f_opt_paren_args tEQL command
296
+ {
297
+ result = new_endless_defn val
298
+ }
299
+ | defn_head f_opt_paren_args tEQL command kRESCUE_MOD arg
300
+ {
301
+ result = new_endless_defn val
302
+ }
303
+ | defs_head f_opt_paren_args tEQL command
304
+ {
305
+ result = new_endless_defs val
306
+ }
307
+ | defs_head f_opt_paren_args tEQL command kRESCUE_MOD arg
308
+ {
309
+ result = new_endless_defs val
310
+ }
311
+ #endif
312
+ | backref tOP_ASGN command_rhs
313
+ {
314
+ self.backref_assign_error val[0]
315
+ }
316
+
317
+ command_rhs: command_call =tOP_ASGN
318
+ {
319
+ expr, = val
320
+ result = value_expr expr
321
+ }
322
+ | command_call kRESCUE_MOD stmt
323
+ {
324
+ expr, (_, line), resbody = val
325
+
326
+ expr = value_expr expr
327
+ ary = s(:array).line line
328
+ result = new_rescue(expr, new_resbody(ary, resbody))
329
+ }
330
+ | command_asgn
331
+
332
+ expr: command_call
333
+ | expr kAND expr
334
+ {
335
+ lhs, _, rhs = val
336
+ result = logical_op :and, lhs, rhs
337
+ }
338
+ | expr kOR expr
339
+ {
340
+ lhs, _, rhs = val
341
+ result = logical_op :or, lhs, rhs
342
+ }
343
+ | kNOT opt_nl expr
344
+ {
345
+ (_, line), _, expr = val
346
+ result = new_call(expr, :"!").line line
347
+ # REFACTOR: call_uni_op
348
+ }
349
+ | tBANG command_call
350
+ {
351
+ _, cmd = val
352
+ result = new_call(cmd, :"!").line cmd.line
353
+ # TODO: fix line number to tBANG... but causes BAD shift/reduce conflict
354
+ # REFACTOR: call_uni_op -- see parse26.y
355
+ }
356
+ | arg tASSOC
357
+ {
358
+ # value_expr($1);
359
+ self.lexer.lex_state = EXPR_BEG|EXPR_LABEL
360
+ self.lexer.command_start = false
361
+ result = self.in_kwarg
362
+ self.in_kwarg = true
363
+ self.env.extend
364
+ }
365
+ #if V == 30
366
+ p_expr
367
+ #else
368
+ p_top_expr_body
369
+ #endif
370
+ {
371
+ lhs, _, in_kwarg, rhs = val
372
+
373
+ self.env.unextend
374
+ self.in_kwarg = in_kwarg
375
+
376
+ rhs = new_in rhs, nil, nil, rhs.line
377
+ result = new_case lhs, rhs, rhs.line
378
+ }
379
+ | arg
380
+ kIN
381
+ {
382
+ # TODO? value_expr($1);
383
+ self.lexer.lex_state = EXPR_BEG|EXPR_LABEL
384
+ self.lexer.command_start = false
385
+ result = self.in_kwarg
386
+ self.in_kwarg = true
387
+ self.env.extend
388
+ }
389
+ #if V == 30
390
+ p_expr
391
+ #else
392
+ p_top_expr_body
393
+ #endif
394
+ {
395
+ self.env.unextend
396
+
397
+ expr, _, old_kwarg, pat = val
398
+
399
+ expr = value_expr expr
400
+
401
+ self.in_kwarg = old_kwarg
402
+ pat_in = new_in pat, nil, nil, expr.line
403
+ result = new_case expr, pat_in, expr.line
404
+ }
405
+ | arg =tLBRACE_ARG
406
+
407
+ def_name: fname
408
+ {
409
+ # TODO: numparam_name(p, fname);
410
+
411
+ (id, line), = val
412
+ old_in_def = self.in_def
413
+
414
+ self.in_def = true # group = local_push
415
+ self.env.extend
416
+ lexer.cmdarg.push false
417
+ lexer.cond.push false
418
+
419
+ result = [id.to_sym, line, old_in_def]
420
+ }
421
+ defn_head: k_def def_name
422
+ {
423
+ _, name = val
424
+ result = name
425
+ }
426
+ defs_head: k_def singleton dot_or_colon
427
+ {
428
+ lexer.lex_state = EXPR_FNAME
429
+ }
430
+ def_name
431
+ {
432
+ lexer.lex_state = EXPR_ENDFN|EXPR_LABEL
433
+ self.in_single += 1 # TODO: remove?
434
+
435
+ # self.in_def = true # local_push
436
+ # self.env.extend
437
+ # lexer.cmdarg.push false
438
+ # lexer.cond.push false
439
+
440
+ _, recv, _, _, name = val
441
+
442
+ result = [recv, name]
443
+ }
444
+
445
+ expr_value: expr
446
+ {
447
+ result = value_expr(val[0])
448
+ }
449
+
450
+ expr_value_do: {
451
+ lexer.cond.push true
452
+ }
453
+ expr_value do
454
+ {
455
+ lexer.cond.pop
456
+ }
457
+ {
458
+ _, expr, _, _ = val
459
+ result = expr
460
+ }
461
+
462
+ command_call: command
463
+ | block_command
464
+
465
+ block_command: block_call
466
+ | block_call call_op2 operation2 command_args
467
+ {
468
+ blk, _, (msg, _line), args = val
469
+ result = new_call(blk, msg.to_sym, args).line blk.line
470
+ }
471
+
472
+ cmd_brace_block: tLBRACE_ARG
473
+ {
474
+ # self.env.extend(:dynamic)
475
+ result = self.lexer.lineno
476
+ }
477
+ brace_body tRCURLY
478
+ {
479
+ _, line, body, _ = val
480
+
481
+ result = body
482
+ result.line line
483
+
484
+ # self.env.unextend
485
+ }
486
+
487
+ fcall: operation
488
+ {
489
+ (msg, line), = val
490
+ result = new_call(nil, msg.to_sym).line line
491
+ }
492
+
493
+ command: fcall command_args =tLOWEST
494
+ {
495
+ call, args = val
496
+ result = call.concat args.sexp_body
497
+ }
498
+ | fcall command_args cmd_brace_block
499
+ {
500
+ call, args, block = val
501
+
502
+ result = call.concat args.sexp_body
503
+
504
+ if block then
505
+ block_dup_check result, block
506
+
507
+ result, operation = block, result
508
+ result.insert 1, operation
509
+ end
510
+ }
511
+ | primary_value call_op operation2 command_args =tLOWEST
512
+ {
513
+ lhs, callop, (op, _), args = val
514
+
515
+ result = new_call lhs, op.to_sym, args, callop
516
+ result.line lhs.line
517
+ }
518
+ | primary_value call_op operation2 command_args cmd_brace_block
519
+ {
520
+ recv, _, (msg, _line), args, block = val
521
+ call = new_call recv, msg.to_sym, args, val[1]
522
+
523
+ block_dup_check call, block
524
+
525
+ block.insert 1, call
526
+ result = block
527
+ }
528
+ | primary_value tCOLON2 operation2 command_args =tLOWEST
529
+ {
530
+ lhs, _, (id, line), args = val
531
+
532
+ result = new_call lhs, id.to_sym, args
533
+ result.line line
534
+ }
535
+ | primary_value tCOLON2 operation2 command_args cmd_brace_block
536
+ {
537
+ recv, _, (msg, _line), args, block = val
538
+ call = new_call recv, msg.to_sym, args
539
+
540
+ block_dup_check call, block
541
+
542
+ block.insert 1, call
543
+ result = block
544
+ }
545
+ | kSUPER command_args
546
+ {
547
+ result = new_super val[1]
548
+ }
549
+ | kYIELD command_args
550
+ {
551
+ (_, line), args = val
552
+ result = new_yield args
553
+ result.line line # TODO: push to new_yield
554
+ }
555
+ | k_return call_args
556
+ {
557
+ line = val[0].last
558
+ result = s(:return, ret_args(val[1])).line(line)
559
+ }
560
+ | kBREAK call_args
561
+ {
562
+ (_, line), args = val
563
+ result = s(:break, ret_args(args)).line line
564
+ }
565
+ | kNEXT call_args
566
+ {
567
+ line = val[0].last
568
+ result = s(:next, ret_args(val[1])).line(line)
569
+ }
570
+
571
+ mlhs: mlhs_basic
572
+ | tLPAREN mlhs_inner rparen
573
+ {
574
+ result = val[1]
575
+ }
576
+
577
+ mlhs_inner: mlhs_basic
578
+ | tLPAREN mlhs_inner rparen
579
+ {
580
+ _, arg, _ = val
581
+ l = arg.line
582
+
583
+ result = s(:masgn, s(:array, arg).line(l)).line l
584
+ }
585
+
586
+ mlhs_basic: mlhs_head
587
+ {
588
+ head, = val
589
+ result = s(:masgn, head).line head.line
590
+ }
591
+ | mlhs_head mlhs_item
592
+ {
593
+ lhs, rhs = val
594
+ result = s(:masgn, lhs << rhs.compact).line lhs.line
595
+ }
596
+ | mlhs_head tSTAR mlhs_node
597
+ {
598
+ head, _, tail = val
599
+ head << s(:splat, tail).line(tail.line)
600
+ result = s(:masgn, head).line head.line
601
+ }
602
+ | mlhs_head tSTAR mlhs_node tCOMMA mlhs_post
603
+ {
604
+ ary1, _, splat, _, ary2 = val
605
+
606
+ result = list_append ary1, s(:splat, splat).line(splat.line)
607
+ result.concat ary2.sexp_body
608
+ result = s(:masgn, result).line result.line
609
+ }
610
+ | mlhs_head tSTAR
611
+ {
612
+ head, _ = val
613
+ l = head.line
614
+ result = s(:masgn, head << s(:splat).line(l)).line l
615
+ }
616
+ | mlhs_head tSTAR tCOMMA mlhs_post
617
+ {
618
+ head, _, _, post = val
619
+ ary = list_append head, s(:splat).line(head.line)
620
+ ary.concat post.sexp_body
621
+ result = s(:masgn, ary).line ary.line
622
+ }
623
+ | tSTAR mlhs_node
624
+ {
625
+ _, node = val
626
+ l = node.line
627
+ splat = s(:splat, node).line l
628
+ ary = s(:array, splat).line l
629
+ result = s(:masgn, ary).line l
630
+ }
631
+ | tSTAR mlhs_node tCOMMA mlhs_post
632
+ {
633
+ _, node, _, post = val
634
+
635
+ splat = s(:splat, node).line node.line
636
+ ary = s(:array, splat).line splat.line
637
+ ary.concat post.sexp_body
638
+ result = s(:masgn, ary).line ary.line
639
+ }
640
+ | tSTAR
641
+ {
642
+ l = lexer.lineno
643
+ result = s(:masgn, s(:array, s(:splat).line(l)).line(l)).line l
644
+ }
645
+ | tSTAR tCOMMA mlhs_post
646
+ {
647
+ _, _, post = val
648
+ l = post.line
649
+
650
+ splat = s(:splat).line l
651
+ ary = s(:array, splat, *post.sexp_body).line l
652
+ result = s(:masgn, ary).line l
653
+ }
654
+
655
+ mlhs_item: mlhs_node
656
+ | tLPAREN mlhs_inner rparen
657
+ {
658
+ result = val[1]
659
+ }
660
+
661
+ mlhs_head: mlhs_item tCOMMA
662
+ {
663
+ lhs, _ = val
664
+ result = s(:array, lhs).line lhs.line
665
+ }
666
+ | mlhs_head mlhs_item tCOMMA
667
+ {
668
+ result = val[0] << val[1].compact
669
+ }
670
+
671
+ mlhs_post: mlhs_item
672
+ {
673
+ item, = val
674
+ result = s(:array, item).line item.line
675
+ }
676
+ | mlhs_post tCOMMA mlhs_item
677
+ {
678
+ result = list_append val[0], val[2]
679
+ }
680
+
681
+ mlhs_node: user_variable
682
+ {
683
+ result = self.assignable val[0]
684
+ }
685
+ | keyword_variable
686
+ {
687
+ result = self.assignable val[0]
688
+ }
689
+ | primary_value tLBRACK2 opt_call_args rbracket
690
+ {
691
+ result = self.aryset val[0], val[2]
692
+ }
693
+ | primary_value call_op tIDENTIFIER
694
+ {
695
+ lhs, call_op, (id, _line) = val
696
+
697
+ result = new_attrasgn lhs, id, call_op
698
+ }
699
+ | primary_value tCOLON2 tIDENTIFIER
700
+ {
701
+ recv, _, (id, _line) = val
702
+ result = new_attrasgn recv, id
703
+ }
704
+ | primary_value call_op tCONSTANT
705
+ {
706
+ lhs, call_op, (id, _line) = val
707
+
708
+ result = new_attrasgn lhs, id, call_op
709
+ }
710
+ | primary_value tCOLON2 tCONSTANT
711
+ {
712
+ if (self.in_def || self.in_single > 0) then
713
+ debug 4
714
+ yyerror "dynamic constant assignment"
715
+ end
716
+
717
+ expr, _, (id, _line) = val
718
+ l = expr.line
719
+
720
+ result = s(:const, s(:colon2, expr, id.to_sym).line(l), nil).line l
721
+ }
722
+ | tCOLON3 tCONSTANT
723
+ {
724
+ if (self.in_def || self.in_single > 0) then
725
+ debug 5
726
+ yyerror "dynamic constant assignment"
727
+ end
728
+
729
+ _, (id, l) = val
730
+
731
+ result = s(:const, nil, s(:colon3, id.to_sym).line(l)).line l
732
+ }
733
+ | backref
734
+ {
735
+ ref, = val
736
+
737
+ self.backref_assign_error ref
738
+ }
739
+
740
+ lhs: user_variable
741
+ {
742
+ var, = val
743
+
744
+ result = self.assignable var
745
+ }
746
+ | keyword_variable
747
+ {
748
+ var, = val
749
+
750
+ result = self.assignable var
751
+
752
+ debug 6
753
+ }
754
+ | primary_value tLBRACK2 opt_call_args rbracket
755
+ {
756
+ lhs, _, args, _ = val
757
+
758
+ result = self.aryset lhs, args
759
+ }
760
+ | primary_value call_op tIDENTIFIER # REFACTOR
761
+ {
762
+ lhs, op, (id, _line) = val
763
+
764
+ result = new_attrasgn lhs, id, op
765
+ }
766
+ | primary_value tCOLON2 tIDENTIFIER
767
+ {
768
+ lhs, _, (id, _line) = val
769
+
770
+ result = new_attrasgn lhs, id
771
+ }
772
+ | primary_value call_op tCONSTANT # REFACTOR?
773
+ {
774
+ lhs, call_op, (id, _line) = val
775
+
776
+ result = new_attrasgn lhs, id, call_op
777
+ }
778
+ | primary_value tCOLON2 tCONSTANT
779
+ {
780
+ expr, _, (id, _line) = val
781
+
782
+ if (self.in_def || self.in_single > 0) then
783
+ debug 7
784
+ yyerror "dynamic constant assignment"
785
+ end
786
+
787
+ l = expr.line
788
+ result = s(:const, s(:colon2, expr, id.to_sym).line(l)).line l
789
+ }
790
+ | tCOLON3 tCONSTANT
791
+ {
792
+ _, (id, l) = val
793
+
794
+ if (self.in_def || self.in_single > 0) then
795
+ debug 8
796
+ yyerror "dynamic constant assignment"
797
+ end
798
+
799
+ result = s(:const, s(:colon3, id.to_sym).line(l)).line l
800
+ }
801
+ | backref
802
+ {
803
+ self.backref_assign_error val[0]
804
+ }
805
+
806
+ cname: tIDENTIFIER
807
+ {
808
+ yyerror "class/module name must be CONSTANT"
809
+ }
810
+ | tCONSTANT
811
+
812
+ cpath: tCOLON3 cname
813
+ {
814
+ result = wrap :colon3, val[1]
815
+ }
816
+ | cname
817
+ {
818
+ (id, line), = val
819
+ result = [id.to_sym, line] # TODO: sexp?
820
+ }
821
+ | primary_value tCOLON2 cname
822
+ {
823
+ pval, _, (name, _line) = val
824
+
825
+ result = s(:colon2, pval, name.to_sym)
826
+ result.line pval.line
827
+ }
828
+
829
+ fname: tIDENTIFIER | tCONSTANT | tFID
830
+ | op
831
+ {
832
+ lexer.lex_state = EXPR_END
833
+ }
834
+
835
+ | reswords
836
+
837
+ fitem: fname
838
+ {
839
+ result = wrap :lit, val[0]
840
+ }
841
+ | symbol
842
+
843
+ undef_list: fitem
844
+ {
845
+ result = new_undef val[0]
846
+ }
847
+ |
848
+ undef_list tCOMMA
849
+ {
850
+ lexer.lex_state = EXPR_FNAME
851
+ }
852
+ fitem
853
+ {
854
+ result = new_undef val[0], val[3]
855
+ }
856
+
857
+ op: tPIPE | tCARET | tAMPER2 | tCMP | tEQ | tEQQ
858
+ | tMATCH | tNMATCH | tGT | tGEQ | tLT | tLEQ
859
+ | tNEQ | tLSHFT | tRSHFT | tPLUS | tMINUS | tSTAR2
860
+ | tSTAR | tDIVIDE | tPERCENT | tPOW | tDSTAR | tBANG | tTILDE
861
+ | tUPLUS | tUMINUS | tAREF | tASET | tBACK_REF2
862
+
863
+ reswords: k__LINE__ | k__FILE__ | k__ENCODING__ | klBEGIN | klEND
864
+ | kALIAS | kAND | kBEGIN | kBREAK | kCASE
865
+ | kCLASS | kDEF | kDEFINED | kDO | kELSE
866
+ | kELSIF | kEND | kENSURE | kFALSE | kFOR
867
+ | kIN | kMODULE | kNEXT | kNIL | kNOT
868
+ | kOR | kREDO | kRESCUE | kRETRY | kRETURN
869
+ | kSELF | kSUPER | kTHEN | kTRUE | kUNDEF
870
+ | kWHEN | kYIELD | kIF | kUNLESS | kWHILE
871
+ | kUNTIL
872
+
873
+ arg: lhs tEQL arg_rhs
874
+ {
875
+ result = new_assign val[0], val[2]
876
+ }
877
+ | var_lhs tOP_ASGN arg_rhs
878
+ {
879
+ result = new_op_asgn val
880
+ }
881
+ | primary_value tLBRACK2 opt_call_args rbracket tOP_ASGN arg_rhs
882
+ {
883
+ result = new_op_asgn1 val
884
+ }
885
+ | primary_value call_op tIDENTIFIER tOP_ASGN arg_rhs
886
+ {
887
+ result = new_op_asgn2 val
888
+ }
889
+ | primary_value call_op tCONSTANT tOP_ASGN arg_rhs
890
+ {
891
+ result = new_op_asgn2 val
892
+ }
893
+ | primary_value tCOLON2 tIDENTIFIER tOP_ASGN arg_rhs
894
+ {
895
+ lhs, _, (id, _line), (op, _), rhs = val
896
+
897
+ result = s(:op_asgn, lhs, rhs, id.to_sym, op.to_sym).line lhs.line
898
+ }
899
+ | primary_value tCOLON2 tCONSTANT tOP_ASGN arg_rhs
900
+ {
901
+ lhs1, _, (lhs2, _line), op, rhs = val
902
+
903
+ lhs = s(:colon2, lhs1, lhs2.to_sym).line lhs1.line
904
+ result = new_const_op_asgn [lhs, op, rhs]
905
+ }
906
+ | tCOLON3 tCONSTANT tOP_ASGN arg_rhs
907
+ {
908
+ _, lhs, op, rhs = val
909
+
910
+ lhs = wrap :colon3, lhs
911
+ result = new_const_op_asgn [lhs, op, rhs]
912
+ }
913
+ | backref tOP_ASGN arg_rhs
914
+ {
915
+ # TODO: lhs = var_field val[0]
916
+ asgn = new_op_asgn val
917
+ result = self.backref_assign_error asgn
918
+ }
919
+ | arg tDOT2 arg
920
+ {
921
+ v1, v2 = val[0], val[2]
922
+ if v1.sexp_type == :lit and v2.sexp_type == :lit and Integer === v1.last and Integer === v2.last then
923
+ result = s(:lit, (v1.last)..(v2.last)).line v1.line
924
+ else
925
+ result = s(:dot2, v1, v2).line v1.line
926
+ end
927
+ }
928
+ | arg tDOT3 arg
929
+ {
930
+ v1, v2 = val[0], val[2]
931
+ if v1.sexp_type == :lit and v2.sexp_type == :lit and Integer === v1.last and Integer === v2.last then
932
+ result = s(:lit, (v1.last)...(v2.last)).line v1.line
933
+ else
934
+ result = s(:dot3, v1, v2).line v1.line
935
+ end
936
+ }
937
+ | arg tDOT2
938
+ {
939
+ v1, _ = val
940
+ v2 = nil
941
+
942
+ result = s(:dot2, v1, v2).line v1.line
943
+ }
944
+ | arg tDOT3
945
+ {
946
+ v1, _ = val
947
+ v2 = nil
948
+
949
+ result = s(:dot3, v1, v2).line v1.line
950
+ }
951
+
952
+ | tBDOT2 arg
953
+ {
954
+ _, v2, = val
955
+ v1 = nil
956
+
957
+ result = s(:dot2, v1, v2).line v2.line
958
+ }
959
+ | tBDOT3 arg
960
+ {
961
+ _, v2 = val
962
+ v1 = nil
963
+
964
+ result = s(:dot3, v1, v2).line v2.line
965
+ }
966
+
967
+ | arg tPLUS arg
968
+ {
969
+ result = new_call val[0], :+, argl(val[2])
970
+ }
971
+ | arg tMINUS arg
972
+ {
973
+ result = new_call val[0], :-, argl(val[2])
974
+ }
975
+ | arg tSTAR2 arg # TODO: rename
976
+ {
977
+ result = new_call val[0], :*, argl(val[2])
978
+ }
979
+ | arg tDIVIDE arg
980
+ {
981
+ result = new_call val[0], :"/", argl(val[2])
982
+ }
983
+ | arg tPERCENT arg
984
+ {
985
+ result = new_call val[0], :"%", argl(val[2])
986
+ }
987
+ | arg tPOW arg
988
+ {
989
+ result = new_call val[0], :**, argl(val[2])
990
+ }
991
+ | tUMINUS_NUM simple_numeric tPOW arg
992
+ {
993
+ _, num, _, arg = val
994
+ lit = wrap :lit, num
995
+ result = new_call(new_call(lit, :"**", argl(arg)), :"-@")
996
+
997
+ }
998
+ | tUPLUS arg
999
+ {
1000
+ result = new_call val[1], :"+@"
1001
+ }
1002
+ | tUMINUS arg
1003
+ {
1004
+ result = new_call val[1], :"-@"
1005
+ }
1006
+ | arg tPIPE arg
1007
+ {
1008
+ result = new_call val[0], :"|", argl(val[2])
1009
+ }
1010
+ | arg tCARET arg
1011
+ {
1012
+ result = new_call val[0], :"^", argl(val[2])
1013
+ }
1014
+ | arg tAMPER2 arg
1015
+ {
1016
+ result = new_call val[0], :"&", argl(val[2])
1017
+ }
1018
+ | arg tCMP arg
1019
+ {
1020
+ result = new_call val[0], :"<=>", argl(val[2])
1021
+ }
1022
+ | rel_expr =tCMP
1023
+ | arg tEQ arg
1024
+ {
1025
+ result = new_call val[0], :"==", argl(val[2])
1026
+ }
1027
+ | arg tEQQ arg
1028
+ {
1029
+ result = new_call val[0], :"===", argl(val[2])
1030
+ }
1031
+ | arg tNEQ arg
1032
+ {
1033
+ result = new_call val[0], :"!=", argl(val[2])
1034
+ }
1035
+ | arg tMATCH arg
1036
+ {
1037
+ lhs, _, rhs = val
1038
+ result = new_match lhs, rhs
1039
+ }
1040
+ | arg tNMATCH arg
1041
+ {
1042
+ lhs, _, rhs = val
1043
+ result = s(:not, new_match(lhs, rhs)).line lhs.line
1044
+ }
1045
+ | tBANG arg
1046
+ {
1047
+ _, arg = val
1048
+ result = new_call arg, :"!"
1049
+ result.line arg.line
1050
+ }
1051
+ | tTILDE arg
1052
+ {
1053
+ result = new_call value_expr(val[1]), :"~"
1054
+ }
1055
+ | arg tLSHFT arg
1056
+ {
1057
+ val[0] = value_expr val[0]
1058
+ val[2] = value_expr val[2]
1059
+ result = new_call val[0], :"\<\<", argl(val[2])
1060
+ }
1061
+ | arg tRSHFT arg
1062
+ {
1063
+ val[0] = value_expr val[0]
1064
+ val[2] = value_expr val[2]
1065
+ result = new_call val[0], :">>", argl(val[2])
1066
+ }
1067
+ | arg tANDOP arg
1068
+ {
1069
+ result = logical_op :and, val[0], val[2]
1070
+ }
1071
+ | arg tOROP arg
1072
+ {
1073
+ result = logical_op :or, val[0], val[2]
1074
+ }
1075
+ | kDEFINED opt_nl arg
1076
+ {
1077
+ (_, line), _, arg = val
1078
+ result = s(:defined, arg).line line
1079
+ }
1080
+ | arg tEH arg opt_nl tCOLON arg
1081
+ {
1082
+ c, _, t, _, _, f = val
1083
+ result = s(:if, c, t, f).line c.line
1084
+ }
1085
+ | defn_head f_opt_paren_args tEQL arg
1086
+ {
1087
+ result = new_endless_defn val
1088
+ }
1089
+ | defn_head f_opt_paren_args tEQL arg kRESCUE_MOD arg
1090
+ {
1091
+ result = new_endless_defn val
1092
+ }
1093
+ | defs_head f_opt_paren_args tEQL arg
1094
+ {
1095
+ result = new_endless_defs val
1096
+ }
1097
+ | defs_head f_opt_paren_args tEQL arg kRESCUE_MOD arg
1098
+ {
1099
+ result = new_endless_defs val
1100
+ }
1101
+ | primary
1102
+
1103
+ relop: tGT
1104
+ | tLT
1105
+ | tGEQ
1106
+ | tLEQ
1107
+
1108
+ rel_expr: arg relop arg =tGT
1109
+ {
1110
+ lhs, (op, _), rhs = val
1111
+ result = new_call lhs, op.to_sym, argl(rhs)
1112
+ }
1113
+ | rel_expr relop arg =tGT
1114
+ {
1115
+ lhs, (op, _), rhs = val
1116
+ warn "comparison '%s' after comparison", op
1117
+ result = new_call lhs, op.to_sym, argl(rhs)
1118
+ }
1119
+
1120
+ arg_value: arg
1121
+ {
1122
+ result = value_expr(val[0])
1123
+ }
1124
+
1125
+ aref_args: none
1126
+ | args trailer
1127
+ {
1128
+ result = args [val[0]]
1129
+ }
1130
+ | args tCOMMA assocs trailer
1131
+ {
1132
+ result = args [val[0], array_to_hash(val[2])]
1133
+ }
1134
+ | assocs trailer
1135
+ {
1136
+ result = args [array_to_hash(val[0])]
1137
+ }
1138
+
1139
+ arg_rhs: arg =tOP_ASGN
1140
+ | arg kRESCUE_MOD arg
1141
+ {
1142
+ body, (_, line), resbody = val
1143
+ body = value_expr body
1144
+ resbody = remove_begin resbody
1145
+
1146
+ ary = s(:array).line line
1147
+ result = new_rescue(body, new_resbody(ary, resbody))
1148
+ }
1149
+
1150
+ paren_args: tLPAREN2 opt_call_args rparen
1151
+ {
1152
+ _, args, (_, line_max) = val
1153
+
1154
+ result = args
1155
+ result.line_max = line_max if args
1156
+ }
1157
+ | tLPAREN2 args tCOMMA args_forward rparen
1158
+ {
1159
+ yyerror "Unexpected ..." unless
1160
+ self.lexer.is_local_id(:"*") &&
1161
+ self.lexer.is_local_id(:"**") &&
1162
+ self.lexer.is_local_id(:"&")
1163
+
1164
+ result = call_args val
1165
+ }
1166
+ | tLPAREN2 args_forward rparen
1167
+ {
1168
+ yyerror "Unexpected ..." unless
1169
+ self.lexer.is_local_id(:"*") &&
1170
+ self.lexer.is_local_id(:"**") &&
1171
+ self.lexer.is_local_id(:"&")
1172
+
1173
+ result = call_args val
1174
+ }
1175
+
1176
+ opt_paren_args: none
1177
+ | paren_args
1178
+
1179
+ opt_call_args: none
1180
+ | call_args
1181
+ | args tCOMMA
1182
+ {
1183
+ result = args val
1184
+ }
1185
+ | args tCOMMA assocs tCOMMA
1186
+ {
1187
+ result = args [val[0], array_to_hash(val[2])]
1188
+ }
1189
+ | assocs tCOMMA
1190
+ {
1191
+ result = args [array_to_hash(val[0])]
1192
+ }
1193
+
1194
+ call_args: command
1195
+ {
1196
+ warning "parenthesize argument(s) for future version"
1197
+ result = call_args val
1198
+ }
1199
+ | args opt_block_arg
1200
+ {
1201
+ result = call_args val
1202
+ }
1203
+ | assocs opt_block_arg
1204
+ {
1205
+ result = call_args [array_to_hash(val[0]), val[1]]
1206
+ }
1207
+ | args tCOMMA assocs opt_block_arg
1208
+ {
1209
+ result = call_args [val[0], array_to_hash(val[2]), val[3]]
1210
+ }
1211
+ | block_arg
1212
+ {
1213
+ result = call_args val
1214
+ }
1215
+
1216
+ command_args: {
1217
+ # parse26.y line 2200
1218
+
1219
+ # If call_args starts with a open paren '(' or
1220
+ # '[', look-ahead reading of the letters calls
1221
+ # CMDARG_PUSH(0), but the push must be done
1222
+ # after CMDARG_PUSH(1). So this code makes them
1223
+ # consistent by first cancelling the premature
1224
+ # CMDARG_PUSH(0), doing CMDARG_PUSH(1), and
1225
+ # finally redoing CMDARG_PUSH(0).
1226
+
1227
+ result = yychar = self.last_token_type.first
1228
+ lookahead = [:tLPAREN, :tLPAREN_ARG, :tLPAREN2, :tLBRACK, :tLBRACK2].include?(yychar)
1229
+ lexer.cmdarg.pop if lookahead
1230
+ lexer.cmdarg.push true
1231
+ lexer.cmdarg.push false if lookahead
1232
+ }
1233
+ call_args
1234
+ {
1235
+ yychar, args = val
1236
+
1237
+ # call_args can be followed by tLBRACE_ARG (that
1238
+ # does CMDARG_PUSH(0) in the lexer) but the push
1239
+ # must be done after CMDARG_POP() in the parser.
1240
+ # So this code does CMDARG_POP() to pop 0 pushed
1241
+ # by tLBRACE_ARG, CMDARG_POP() to pop 1 pushed
1242
+ # by command_args, and CMDARG_PUSH(0) to restore
1243
+ # back the flag set by tLBRACE_ARG.
1244
+
1245
+ lookahead = [:tLBRACE_ARG].include?(yychar)
1246
+ lexer.cmdarg.pop if lookahead
1247
+ lexer.cmdarg.pop
1248
+ lexer.cmdarg.push false if lookahead
1249
+ result = args
1250
+ }
1251
+
1252
+ block_arg: tAMPER arg_value
1253
+ {
1254
+ _, arg = val
1255
+ result = s(:block_pass, arg).line arg.line
1256
+ }
1257
+ #if V > 30
1258
+ | tAMPER
1259
+ {
1260
+ (_, line), = val
1261
+ result = s(:block_pass).line line
1262
+ }
1263
+ #endif
1264
+
1265
+ opt_block_arg: tCOMMA block_arg
1266
+ {
1267
+ result = val[1]
1268
+ }
1269
+ | none
1270
+
1271
+ args: arg_value
1272
+ {
1273
+ arg, = val
1274
+ lineno = arg.line || lexer.lineno # HACK
1275
+
1276
+ result = s(:array, arg).line lineno
1277
+ }
1278
+ | tSTAR arg_value
1279
+ {
1280
+ _, arg = val
1281
+ result = s(:array, s(:splat, arg).line(arg.line)).line arg.line
1282
+ }
1283
+ | args tCOMMA arg_value
1284
+ {
1285
+ args, _, id = val
1286
+ result = self.list_append args, id
1287
+ }
1288
+ | args tCOMMA tSTAR arg_value
1289
+ {
1290
+ # TODO: the line number from tSTAR has been dropped
1291
+ args, _, _, id = val
1292
+ line = lexer.lineno
1293
+ result = self.list_append args, s(:splat, id).line(line)
1294
+ }
1295
+
1296
+ mrhs_arg: mrhs
1297
+ {
1298
+ result = new_masgn_arg val[0]
1299
+ }
1300
+ | arg_value
1301
+ {
1302
+ result = new_masgn_arg val[0], :wrap
1303
+ }
1304
+
1305
+ mrhs: args tCOMMA arg_value
1306
+ {
1307
+ result = val[0] << val[2]
1308
+ }
1309
+ | args tCOMMA tSTAR arg_value
1310
+ {
1311
+ # TODO: make all tXXXX terminals include lexer.lineno
1312
+ arg, _, _, splat = val
1313
+ result = self.arg_concat arg, splat
1314
+ }
1315
+ | tSTAR arg_value
1316
+ {
1317
+ _, arg = val
1318
+ result = s(:splat, arg).line arg.line
1319
+ }
1320
+
1321
+ primary: literal
1322
+ | strings
1323
+ | xstring
1324
+ | regexp
1325
+ | words
1326
+ | qwords
1327
+ | symbols
1328
+ | qsymbols
1329
+ | var_ref
1330
+ | backref
1331
+ | tFID
1332
+ {
1333
+ (msg, line), = val
1334
+ result = new_call nil, msg.to_sym
1335
+ result.line line
1336
+ }
1337
+ | k_begin
1338
+ {
1339
+ lexer.cmdarg.push false
1340
+ result = self.lexer.lineno
1341
+ }
1342
+ bodystmt k_end
1343
+ {
1344
+ lexer.cmdarg.pop
1345
+ result = new_begin val
1346
+ }
1347
+ | tLPAREN_ARG
1348
+ {
1349
+ lexer.lex_state = EXPR_ENDARG
1350
+ result = lexer.lineno
1351
+ }
1352
+ rparen
1353
+ {
1354
+ _, line, _ = val
1355
+ result = s(:begin).line line
1356
+ }
1357
+ | tLPAREN_ARG
1358
+ stmt
1359
+ {
1360
+ lexer.lex_state = EXPR_ENDARG
1361
+ }
1362
+ rparen
1363
+ {
1364
+ _, stmt, _, _, = val
1365
+ # warning "(...) interpreted as grouped expression"
1366
+ result = stmt
1367
+ }
1368
+ | tLPAREN compstmt tRPAREN
1369
+ {
1370
+ _, stmt, _ = val
1371
+ result = stmt
1372
+ result ||= s(:nil).line lexer.lineno
1373
+ result.paren = true
1374
+ }
1375
+ | primary_value tCOLON2 tCONSTANT
1376
+ {
1377
+ expr, _, (id, _line) = val
1378
+
1379
+ result = s(:colon2, expr, id.to_sym).line expr.line
1380
+ }
1381
+ | tCOLON3 tCONSTANT
1382
+ {
1383
+ result = wrap :colon3, val[1]
1384
+ }
1385
+ | tLBRACK { result = lexer.lineno } aref_args rbracket
1386
+ {
1387
+ _, line, args, (_, line_max) = val
1388
+
1389
+ result = args || s(:array)
1390
+ result.sexp_type = :array # aref_args is :args
1391
+ result.line line
1392
+ result.line_max = line_max
1393
+ }
1394
+ | tLBRACE
1395
+ {
1396
+ result = self.lexer.lineno
1397
+ }
1398
+ assoc_list tRCURLY
1399
+ {
1400
+ result = new_hash val
1401
+ }
1402
+ | k_return
1403
+ {
1404
+ (_, line), = val
1405
+ result = s(:return).line line
1406
+ }
1407
+ | kYIELD tLPAREN2 call_args rparen
1408
+ {
1409
+ (_, line), _, args, _ = val
1410
+
1411
+ result = new_yield(args).line line
1412
+ }
1413
+ | kYIELD tLPAREN2 rparen
1414
+ {
1415
+ (_, line), _, _ = val
1416
+
1417
+ result = new_yield.line line
1418
+ }
1419
+ | kYIELD
1420
+ {
1421
+ (_, line), = val
1422
+
1423
+ result = new_yield.line line
1424
+ }
1425
+ | kDEFINED opt_nl tLPAREN2 expr rparen
1426
+ {
1427
+ (_, line), _, _, arg, _ = val
1428
+
1429
+ result = s(:defined, arg).line line
1430
+ }
1431
+ | kNOT tLPAREN2 expr rparen
1432
+ {
1433
+ _, _, lhs, _ = val
1434
+ result = new_call lhs, :"!"
1435
+ }
1436
+ | kNOT tLPAREN2 rparen
1437
+ {
1438
+ debug 9
1439
+ }
1440
+ | fcall brace_block
1441
+ {
1442
+ call, iter = val
1443
+
1444
+ iter.insert 1, call
1445
+ result = iter
1446
+ # FIX: probably not: call.line = iter.line
1447
+ }
1448
+ | method_call
1449
+ | method_call brace_block
1450
+ {
1451
+ call, iter = val[0], val[1]
1452
+ block_dup_check call, iter
1453
+ iter.insert 1, call # FIX
1454
+ result = iter
1455
+ }
1456
+ | lambda
1457
+ {
1458
+ expr, = val
1459
+ result = expr
1460
+ }
1461
+ | k_if expr_value then compstmt if_tail k_end
1462
+ {
1463
+ _, c, _, t, f, _ = val
1464
+ result = new_if c, t, f
1465
+ }
1466
+ | k_unless expr_value then compstmt opt_else k_end
1467
+ {
1468
+ _, c, _, t, f, _ = val
1469
+ result = new_if c, f, t
1470
+ }
1471
+ | k_while expr_value_do compstmt k_end
1472
+ {
1473
+ _, cond, body, _ = val
1474
+ result = new_while body, cond, true
1475
+ }
1476
+ | k_until expr_value_do compstmt k_end
1477
+ {
1478
+ _, cond, body, _ = val
1479
+ result = new_until body, cond, true
1480
+ }
1481
+ | k_case expr_value opt_terms case_body k_end
1482
+ {
1483
+ (_, line), expr, _, body, _ = val
1484
+ result = new_case expr, body, line
1485
+ }
1486
+ | k_case opt_terms case_body k_end
1487
+ {
1488
+ (_, line), _, body, _ = val
1489
+ result = new_case nil, body, line
1490
+ }
1491
+ | k_case expr_value opt_terms p_case_body k_end
1492
+ {
1493
+ (_, line), expr, _, body, _ = val
1494
+
1495
+ result = new_case expr, body, line
1496
+ }
1497
+ | k_for for_var kIN expr_value_do compstmt k_end
1498
+ {
1499
+ _, var, _, iter, body, _ = val
1500
+ result = new_for iter, var, body
1501
+ }
1502
+ | k_class
1503
+ {
1504
+ result = self.lexer.lineno
1505
+ }
1506
+ cpath superclass
1507
+ {
1508
+ if (self.in_def || self.in_single > 0) then
1509
+ yyerror "class definition in method body"
1510
+ end
1511
+ self.env.extend
1512
+ }
1513
+ bodystmt k_end
1514
+ {
1515
+ result = new_class val
1516
+ self.env.unextend
1517
+ self.lexer.ignore_body_comments
1518
+ }
1519
+ | k_class tLSHFT
1520
+ {
1521
+ result = self.lexer.lineno
1522
+ }
1523
+ expr
1524
+ {
1525
+ result = self.in_def
1526
+ self.in_def = false
1527
+ }
1528
+ term
1529
+ {
1530
+ result = self.in_single
1531
+ self.in_single = 0
1532
+ self.env.extend
1533
+ }
1534
+ bodystmt k_end
1535
+ {
1536
+ result = new_sclass val
1537
+ self.env.unextend
1538
+ self.lexer.ignore_body_comments
1539
+ }
1540
+ | k_module
1541
+ {
1542
+ result = self.lexer.lineno
1543
+ }
1544
+ cpath
1545
+ {
1546
+ yyerror "module definition in method body" if
1547
+ self.in_def or self.in_single > 0
1548
+
1549
+ self.env.extend
1550
+ }
1551
+ bodystmt k_end
1552
+ {
1553
+ result = new_module val
1554
+ self.env.unextend
1555
+ self.lexer.ignore_body_comments
1556
+ }
1557
+ | defn_head f_arglist bodystmt k_end
1558
+ {
1559
+ # [ [:f, 1, false], s(:args)...]
1560
+ # =>
1561
+ # [[:k_def, 666], [:f, 1], false, s(:args)...]
1562
+ val.insert 1, val.first.pop
1563
+ val.insert 0, [:k_def, 666]
1564
+
1565
+ result, in_def = new_defn val
1566
+
1567
+ lexer.cond.pop # group = local_pop
1568
+ lexer.cmdarg.pop
1569
+ self.env.unextend
1570
+ self.in_def = in_def
1571
+
1572
+ self.lexer.ignore_body_comments
1573
+ }
1574
+ | defs_head f_arglist bodystmt k_end
1575
+ {
1576
+ # [ [recv, [:name, 1, false]], s(:args...]
1577
+ # =>
1578
+ # [ recv, [:name, 1, false], s(:args...]
1579
+ # =>
1580
+ # [ recv, [:name, 1], false, s(:args...]
1581
+ # =>
1582
+ # [ :k_def, recv, [:name, 1], false, s(:args...]
1583
+
1584
+ val.prepend(*val.shift)
1585
+ val.insert 2, val[1].pop
1586
+ val.insert 0, [:k_def, 666]
1587
+
1588
+ result, in_def = new_defs val
1589
+
1590
+ lexer.cond.pop # group = local_pop
1591
+ lexer.cmdarg.pop
1592
+ self.env.unextend
1593
+ self.in_def = in_def
1594
+
1595
+ self.in_single -= 1
1596
+
1597
+ # TODO: restore cur_arg ? what's cur_arg?
1598
+
1599
+ self.lexer.ignore_body_comments
1600
+ }
1601
+ | kBREAK
1602
+ {
1603
+ (_, line), = val
1604
+ result = s(:break).line line
1605
+ }
1606
+ | kNEXT
1607
+ {
1608
+ (_, line), = val
1609
+ result = s(:next).line line
1610
+ }
1611
+ | kREDO
1612
+ {
1613
+ (_, line), = val
1614
+ result = s(:redo).line line
1615
+ }
1616
+ | kRETRY
1617
+ {
1618
+ (_, line), = val
1619
+ result = s(:retry).line line
1620
+ }
1621
+
1622
+ primary_value: primary
1623
+ {
1624
+ result = value_expr(val[0])
1625
+ }
1626
+
1627
+ # These are really stupid
1628
+ k_begin: kBEGIN
1629
+ k_if: kIF
1630
+ k_unless: kUNLESS
1631
+ k_while: kWHILE
1632
+ k_until: kUNTIL
1633
+ k_case: kCASE
1634
+ k_for: kFOR
1635
+ k_class: kCLASS
1636
+ {
1637
+ self.comments.push self.lexer.comments
1638
+ }
1639
+ k_module: kMODULE
1640
+ {
1641
+ self.comments.push self.lexer.comments
1642
+ }
1643
+ k_def: kDEF
1644
+ {
1645
+ self.comments.push self.lexer.comments
1646
+ }
1647
+ k_do: kDO
1648
+ k_do_block: kDO_BLOCK
1649
+ k_rescue: kRESCUE
1650
+ k_ensure: kENSURE
1651
+ k_when: kWHEN
1652
+ k_else: kELSE
1653
+ k_elsif: kELSIF
1654
+ k_end: kEND
1655
+ k_return: kRETURN
1656
+
1657
+ then: term
1658
+ | kTHEN
1659
+ | term kTHEN
1660
+
1661
+ do: term
1662
+ | kDO_COND
1663
+
1664
+ if_tail: opt_else
1665
+ | k_elsif expr_value then compstmt if_tail
1666
+ {
1667
+ (_, line), c, _, t, rest = val
1668
+
1669
+ result = s(:if, c, t, rest).line line
1670
+ }
1671
+
1672
+ opt_else: none
1673
+ | kELSE compstmt
1674
+ {
1675
+ result = val[1]
1676
+ }
1677
+
1678
+ for_var: lhs
1679
+ | mlhs
1680
+ {
1681
+ val[0].delete_at 1 if val[0][1].nil? # HACK
1682
+ }
1683
+
1684
+ f_marg: f_norm_arg
1685
+ | tLPAREN f_margs rparen
1686
+ {
1687
+ result = val[1]
1688
+ }
1689
+
1690
+ f_marg_list: f_marg
1691
+ {
1692
+ sym, = val
1693
+
1694
+ result = s(:array, sym).line lexer.lineno
1695
+ }
1696
+ | f_marg_list tCOMMA f_marg
1697
+ {
1698
+ result = list_append val[0], val[2]
1699
+ }
1700
+
1701
+ f_margs: f_marg_list
1702
+ {
1703
+ args, = val
1704
+
1705
+ result = block_var args
1706
+ }
1707
+ | f_marg_list tCOMMA f_rest_marg
1708
+ {
1709
+ args, _, rest = val
1710
+
1711
+ result = block_var args, rest
1712
+ }
1713
+ | f_marg_list tCOMMA f_rest_marg tCOMMA f_marg_list
1714
+ {
1715
+ lhs, _, splat, _, rhs = val
1716
+
1717
+ result = block_var lhs, splat, rhs
1718
+ }
1719
+ | f_rest_marg
1720
+ {
1721
+ rest, = val
1722
+
1723
+ result = block_var rest
1724
+ }
1725
+ | f_rest_marg tCOMMA f_marg_list
1726
+ {
1727
+ splat, _, rest = val
1728
+
1729
+ result = block_var splat, rest
1730
+ }
1731
+
1732
+ f_rest_marg: tSTAR f_norm_arg
1733
+ {
1734
+ _, (id, line) = val
1735
+
1736
+ result = args ["*#{id}".to_sym]
1737
+ result.line line
1738
+ }
1739
+ | tSTAR
1740
+ {
1741
+ result = args [:*]
1742
+ result.line lexer.lineno # FIX: tSTAR -> line
1743
+ }
1744
+
1745
+ f_any_kwrest: f_kwrest
1746
+ | f_no_kwarg
1747
+
1748
+ #if V > 30
1749
+ f_eq: tEQL # TODO: self.in_argdef = false
1750
+ #endif
1751
+
1752
+ block_args_tail: f_block_kwarg tCOMMA f_kwrest opt_f_block_arg
1753
+ {
1754
+ result = call_args val
1755
+ }
1756
+ | f_block_kwarg opt_f_block_arg
1757
+ {
1758
+ result = call_args val
1759
+ }
1760
+ | f_any_kwrest opt_f_block_arg
1761
+ {
1762
+ result = call_args val
1763
+ }
1764
+ | f_block_arg
1765
+ {
1766
+ (id, line), = val
1767
+ result = call_args [id]
1768
+ result.line line
1769
+ }
1770
+
1771
+ opt_block_args_tail: tCOMMA block_args_tail
1772
+ {
1773
+ result = args val
1774
+ }
1775
+ | none
1776
+
1777
+ excessed_comma: tCOMMA
1778
+ {
1779
+ result = s(:WTF_COMMA!)
1780
+ }
1781
+
1782
+ block_param: f_arg tCOMMA f_block_optarg tCOMMA f_rest_arg opt_block_args_tail
1783
+ {
1784
+ result = args val
1785
+ }
1786
+ | f_arg tCOMMA f_block_optarg tCOMMA f_rest_arg tCOMMA f_arg opt_block_args_tail
1787
+ {
1788
+ result = args val
1789
+ }
1790
+ | f_arg tCOMMA f_block_optarg opt_block_args_tail
1791
+ {
1792
+ result = args val
1793
+ }
1794
+ | f_arg tCOMMA f_block_optarg tCOMMA f_arg opt_block_args_tail
1795
+ {
1796
+ result = args val
1797
+ }
1798
+ | f_arg tCOMMA f_rest_arg opt_block_args_tail
1799
+ {
1800
+ result = args val
1801
+ }
1802
+ | f_arg excessed_comma
1803
+ {
1804
+ arg, _ = val
1805
+ result = arg << nil
1806
+ }
1807
+ | f_arg tCOMMA f_rest_arg tCOMMA f_arg opt_block_args_tail
1808
+ {
1809
+ result = args val
1810
+ }
1811
+ | f_arg opt_block_args_tail
1812
+ {
1813
+ result = args val
1814
+ }
1815
+ | f_block_optarg tCOMMA f_rest_arg opt_block_args_tail
1816
+ {
1817
+ result = args val
1818
+ }
1819
+ | f_block_optarg tCOMMA f_rest_arg tCOMMA f_arg opt_block_args_tail
1820
+ {
1821
+ result = args val
1822
+ }
1823
+ | f_block_optarg opt_block_args_tail
1824
+ {
1825
+ result = args val
1826
+ }
1827
+ | f_block_optarg tCOMMA f_arg opt_block_args_tail
1828
+ {
1829
+ result = args val
1830
+ }
1831
+ | f_rest_arg opt_block_args_tail
1832
+ {
1833
+ result = args val
1834
+ }
1835
+ | f_rest_arg tCOMMA f_arg opt_block_args_tail
1836
+ {
1837
+ result = args val
1838
+ }
1839
+ | block_args_tail
1840
+ {
1841
+ result = args val
1842
+ }
1843
+
1844
+ opt_block_param: none { result = 0 }
1845
+ | block_param_def
1846
+ {
1847
+ self.lexer.command_start = true
1848
+ }
1849
+
1850
+ block_param_def: tPIPE opt_bv_decl tPIPE
1851
+ {
1852
+ # TODO: current_arg = 0
1853
+ result = args val
1854
+ }
1855
+ | tOROP
1856
+ {
1857
+ result = s(:args).line lexer.lineno
1858
+ }
1859
+ | tPIPE block_param opt_bv_decl tPIPE
1860
+ {
1861
+ # TODO: current_arg = 0
1862
+ result = args val
1863
+ }
1864
+
1865
+ opt_bv_decl: opt_nl
1866
+ | opt_nl tSEMI bv_decls opt_nl
1867
+ {
1868
+ result = args val
1869
+ }
1870
+
1871
+ bv_decls: bvar
1872
+ {
1873
+ result = args val
1874
+ }
1875
+ | bv_decls tCOMMA bvar
1876
+ {
1877
+ result = args val
1878
+ }
1879
+
1880
+ bvar: tIDENTIFIER
1881
+ {
1882
+ result = wrap :shadow, val[0]
1883
+ }
1884
+ | f_bad_arg
1885
+
1886
+ lambda: tLAMBDA
1887
+ {
1888
+ self.env.extend :dynamic
1889
+ result = [lexer.lineno, lexer.lpar_beg]
1890
+ lexer.paren_nest += 1
1891
+ lexer.lpar_beg = lexer.paren_nest
1892
+ }
1893
+ f_larglist
1894
+ {
1895
+ lexer.cmdarg.push false
1896
+ }
1897
+ lambda_body
1898
+ {
1899
+ _, (line, lpar), args, _cmdarg, body = val
1900
+ lexer.lpar_beg = lpar
1901
+
1902
+ lexer.cmdarg.pop
1903
+
1904
+ call = s(:lambda).line line
1905
+ result = new_iter call, args, body
1906
+ result.line line
1907
+ self.env.unextend # TODO: dynapush & dynapop
1908
+ }
1909
+
1910
+ f_larglist: tLPAREN2 f_args opt_bv_decl rparen
1911
+ {
1912
+ result = args val
1913
+ }
1914
+ | f_args
1915
+ {
1916
+ result = val[0]
1917
+ result = 0 if result == s(:args)
1918
+ }
1919
+
1920
+ lambda_body: tLAMBEG compstmt tRCURLY
1921
+ {
1922
+ result = val[1]
1923
+ }
1924
+ | kDO_LAMBDA bodystmt kEND
1925
+ {
1926
+ result = val[1]
1927
+ }
1928
+
1929
+ do_block: k_do_block do_body kEND
1930
+ {
1931
+ (_, line), iter, _ = val
1932
+ result = iter.line line
1933
+ }
1934
+
1935
+ block_call: command do_block
1936
+ {
1937
+ # TODO:
1938
+ ## if (nd_type($1) == NODE_YIELD) {
1939
+ ## compile_error(PARSER_ARG "block given to yield");
1940
+
1941
+ cmd, blk = val
1942
+
1943
+ syntax_error "Both block arg and actual block given." if
1944
+ cmd.block_pass?
1945
+
1946
+ if inverted? val then
1947
+ val = invert_block_call val
1948
+ cmd, blk = val
1949
+ end
1950
+
1951
+ result = blk
1952
+ result.insert 1, cmd
1953
+ }
1954
+ | block_call call_op2 operation2 opt_paren_args
1955
+ {
1956
+ lhs, _, (id, _line), args = val
1957
+
1958
+ result = new_call lhs, id.to_sym, args
1959
+ }
1960
+ | block_call call_op2 operation2 opt_paren_args brace_block
1961
+ {
1962
+ iter1, _, (name, _line), args, iter2 = val
1963
+
1964
+ call = new_call iter1, name.to_sym, args
1965
+ iter2.insert 1, call
1966
+
1967
+ result = iter2
1968
+ }
1969
+ | block_call call_op2 operation2 command_args do_block
1970
+ {
1971
+ iter1, _, (name, _line), args, iter2 = val
1972
+
1973
+ call = new_call iter1, name.to_sym, args
1974
+ iter2.insert 1, call
1975
+
1976
+ result = iter2
1977
+ }
1978
+
1979
+ method_call: fcall paren_args
1980
+ {
1981
+ call, args = val
1982
+
1983
+ result = call
1984
+
1985
+ if args then
1986
+ call.concat args.sexp_body
1987
+ result.line_max = args.line_max
1988
+ end
1989
+ }
1990
+ | primary_value call_op operation2 opt_paren_args
1991
+ {
1992
+ recv, call_op, (op, op_line), args = val
1993
+
1994
+ result = new_call recv, op.to_sym, args, call_op
1995
+ result.line_max = op_line unless args
1996
+ }
1997
+ | primary_value tCOLON2 operation2 paren_args
1998
+ {
1999
+ recv, _, (op, _line), args = val
2000
+
2001
+ result = new_call recv, op.to_sym, args
2002
+ }
2003
+ | primary_value tCOLON2 operation3
2004
+ {
2005
+ lhs, _, (id, _line) = val
2006
+
2007
+ result = new_call lhs, id.to_sym
2008
+ }
2009
+ | primary_value call_op paren_args
2010
+ {
2011
+ result = new_call val[0], :call, val[2], val[1]
2012
+ }
2013
+ | primary_value tCOLON2 paren_args
2014
+ {
2015
+ result = new_call val[0], :call, val[2]
2016
+ }
2017
+ | kSUPER paren_args
2018
+ {
2019
+ result = new_super val[1]
2020
+ }
2021
+ | kSUPER
2022
+ {
2023
+ result = s(:zsuper).line lexer.lineno
2024
+ }
2025
+ | primary_value tLBRACK2 opt_call_args rbracket
2026
+ {
2027
+ result = new_aref val
2028
+ }
2029
+
2030
+ brace_block: tLCURLY
2031
+ {
2032
+ self.env.extend :dynamic
2033
+ result = self.lexer.lineno
2034
+ }
2035
+ brace_body tRCURLY
2036
+ {
2037
+ _, line, body, _ = val
2038
+
2039
+ result = body
2040
+ result.line line
2041
+
2042
+ self.env.unextend
2043
+ }
2044
+ | k_do
2045
+ {
2046
+ self.env.extend :dynamic
2047
+ result = self.lexer.lineno
2048
+ }
2049
+ do_body kEND
2050
+ {
2051
+ _, line, body, _ = val
2052
+
2053
+ result = body
2054
+ result.line line
2055
+
2056
+ self.env.unextend
2057
+ }
2058
+
2059
+ brace_body: { self.env.extend :dynamic; result = self.lexer.lineno }
2060
+ { result = lexer.cmdarg.store(false) }
2061
+ opt_block_param compstmt
2062
+ {
2063
+ line, cmdarg, param, cmpstmt = val
2064
+
2065
+ result = new_brace_body param, cmpstmt, line
2066
+ self.env.unextend
2067
+ lexer.cmdarg.restore cmdarg
2068
+ lexer.cmdarg.pop # because of: cmdarg_stack >> 1 ?
2069
+ }
2070
+
2071
+ do_body: { self.env.extend :dynamic; result = self.lexer.lineno }
2072
+ { lexer.cmdarg.push false }
2073
+ opt_block_param
2074
+ bodystmt
2075
+ {
2076
+ line, _cmdarg, param, cmpstmt = val
2077
+
2078
+ result = new_do_body param, cmpstmt, line
2079
+ lexer.cmdarg.pop
2080
+ self.env.unextend
2081
+ }
2082
+
2083
+ case_args: arg_value
2084
+ {
2085
+ arg, = val
2086
+
2087
+ result = s(:array, arg).line arg.line
2088
+ }
2089
+ | tSTAR arg_value
2090
+ {
2091
+ _, arg = val
2092
+
2093
+ result = s(:array, s(:splat, arg).line(arg.line)).line arg.line
2094
+ }
2095
+ | case_args tCOMMA arg_value
2096
+ {
2097
+ args, _, id = val
2098
+
2099
+ result = self.list_append args, id
2100
+ }
2101
+ | case_args tCOMMA tSTAR arg_value
2102
+ {
2103
+ args, _, _, id = val
2104
+
2105
+ result = self.list_append args, s(:splat, id).line(id.line)
2106
+ }
2107
+
2108
+ case_body: k_when
2109
+ {
2110
+ result = self.lexer.lineno
2111
+ }
2112
+ case_args then compstmt cases
2113
+ {
2114
+ result = new_when(val[2], val[4])
2115
+ result.line val[1]
2116
+ result << val[5] if val[5]
2117
+ }
2118
+
2119
+ cases: opt_else | case_body
2120
+ ######################################################################
2121
+
2122
+ p_case_body: kIN
2123
+ {
2124
+ self.lexer.lex_state = EXPR_BEG|EXPR_LABEL
2125
+ self.lexer.command_start = false
2126
+ result = self.in_kwarg
2127
+ self.in_kwarg = true
2128
+ push_pvtbl
2129
+ push_pktbl
2130
+ }
2131
+ p_top_expr then
2132
+ {
2133
+ pop_pktbl
2134
+ pop_pvtbl
2135
+ old_kwargs = _values[-3]
2136
+ self.in_kwarg = old_kwargs
2137
+ }
2138
+ compstmt
2139
+ p_cases
2140
+ {
2141
+ (_, line), _, pat, _, _, body, cases = val
2142
+
2143
+ result = new_in pat, body, cases, line
2144
+ }
2145
+
2146
+ p_cases: opt_else
2147
+ | p_case_body
2148
+
2149
+ p_top_expr: p_top_expr_body
2150
+ | p_top_expr_body kIF_MOD expr_value
2151
+ {
2152
+ body, _, cond = val
2153
+ body = remove_begin body
2154
+
2155
+ result = s(:if, cond, body, nil).line body.line
2156
+ }
2157
+ | p_top_expr_body kUNLESS_MOD expr_value
2158
+ {
2159
+ body, _, cond = val
2160
+ body = remove_begin body
2161
+
2162
+ result = s(:if, cond, nil, body).line body.line
2163
+ }
2164
+
2165
+ p_top_expr_body: p_expr
2166
+ | p_expr tCOMMA
2167
+ {
2168
+ expr, _ = val
2169
+
2170
+ tail = new_array_pattern_tail nil, true, nil, nil
2171
+ result = new_array_pattern nil, expr, tail, expr.line
2172
+ }
2173
+ | p_expr tCOMMA p_args
2174
+ {
2175
+ expr, _, args = val
2176
+
2177
+ result = new_array_pattern nil, expr, args, expr.line
2178
+ }
2179
+ | p_find
2180
+ {
2181
+ find, = val
2182
+
2183
+ result = new_find_pattern nil, find
2184
+ }
2185
+ | p_args_tail
2186
+ {
2187
+ args, = val
2188
+ result = new_array_pattern nil, nil, args, args.line
2189
+ }
2190
+ | p_kwargs
2191
+ {
2192
+ kwargs, = val
2193
+ result = new_hash_pattern nil, kwargs, kwargs.line
2194
+ }
2195
+
2196
+ p_expr: p_as
2197
+
2198
+ p_as: p_expr tASSOC p_variable
2199
+ {
2200
+ # NODE *n = NEW_LIST($1, &@$);
2201
+ # n = list_append(p, n, $3);
2202
+ # $$ = new_hash(p, n, &@$);
2203
+
2204
+ expr, _, var = val
2205
+
2206
+ id = var.last
2207
+
2208
+ self.env[id] = :lvar # HACK: need to extend env
2209
+ lhs = s(:lasgn, id).line var.line
2210
+
2211
+ result = new_assign lhs, expr
2212
+ }
2213
+ | p_alt
2214
+
2215
+ p_alt: p_alt tPIPE p_expr_basic
2216
+ {
2217
+ lhs, _, rhs = val
2218
+
2219
+ result = s(:or, lhs, rhs).line lhs.line
2220
+ }
2221
+ | p_expr_basic
2222
+
2223
+ p_lparen: tLPAREN2 { push_pktbl }
2224
+ p_lbracket: tLBRACK2 { push_pktbl }
2225
+
2226
+ p_expr_basic: p_value
2227
+ #if V > 30
2228
+ | p_variable
2229
+ #endif
2230
+ | p_const p_lparen p_args tRPAREN
2231
+ {
2232
+ lhs, _, args, _ = val
2233
+
2234
+ pop_pktbl
2235
+ result = new_array_pattern(lhs, nil, args, lhs.line)
2236
+ }
2237
+ | p_const p_lparen p_find tRPAREN
2238
+ {
2239
+ const, _, find, _ = val
2240
+
2241
+ pop_pktbl
2242
+ result = new_find_pattern(const, find).line const.line
2243
+ }
2244
+ | p_const p_lparen p_kwargs tRPAREN
2245
+ {
2246
+ lhs, _, kwargs, _ = val
2247
+
2248
+ pop_pktbl
2249
+ result = new_hash_pattern(lhs, kwargs, lhs.line)
2250
+ }
2251
+ | p_const tLPAREN2 tRPAREN
2252
+ {
2253
+ const, _, _ = val
2254
+
2255
+ tail = new_array_pattern_tail nil, nil, nil, nil
2256
+ result = new_array_pattern const, nil, tail, const.line
2257
+ }
2258
+ | p_const p_lbracket p_args rbracket
2259
+ {
2260
+ const, _, pre_arg, _ = val
2261
+
2262
+ pop_pktbl
2263
+ result = new_array_pattern const, nil, pre_arg, const.line
2264
+ }
2265
+ | p_const p_lbracket p_find rbracket
2266
+ {
2267
+ const, _, find, _ = val
2268
+
2269
+ pop_pktbl
2270
+ result = new_find_pattern(const, find).line const.line
2271
+ }
2272
+ | p_const p_lbracket p_kwargs rbracket
2273
+ {
2274
+ const, _, kwargs, _ = val
2275
+
2276
+ result = new_hash_pattern const, kwargs, const.line
2277
+ }
2278
+ | p_const tLBRACK2 rbracket
2279
+ {
2280
+ const, _, _ = val
2281
+
2282
+ tail = new_array_pattern_tail nil, nil, nil, nil
2283
+ result = new_array_pattern const, nil, tail, const.line
2284
+ }
2285
+ | tLBRACK p_args rbracket
2286
+ {
2287
+ _, pat, _ = val
2288
+
2289
+ result = new_array_pattern nil, nil, pat, pat.line
2290
+ }
2291
+ | tLBRACK p_find rbracket
2292
+ {
2293
+ _, find, _ = val
2294
+
2295
+ result = new_find_pattern nil, find
2296
+ }
2297
+ | tLBRACK rbracket
2298
+ {
2299
+ (_, line), _ = val
2300
+
2301
+ result = s(:array_pat).line line
2302
+ }
2303
+ | tLBRACE
2304
+ {
2305
+ push_pktbl
2306
+ result = self.in_kwarg
2307
+ self.in_kwarg = false
2308
+ }
2309
+ p_kwargs rbrace
2310
+ {
2311
+ _, in_kwarg, kwargs, _ = val
2312
+
2313
+ pop_pktbl
2314
+ self.in_kwarg = in_kwarg
2315
+
2316
+ result = new_hash_pattern(nil, kwargs, kwargs.line)
2317
+ }
2318
+ | tLBRACE rbrace
2319
+ {
2320
+ (_, line), _ = val
2321
+
2322
+ tail = new_hash_pattern_tail nil, nil, line
2323
+ result = new_hash_pattern nil, tail, line
2324
+ }
2325
+ | tLPAREN { push_pktbl } p_expr tRPAREN
2326
+ {
2327
+ _, _, expr, _ = val
2328
+
2329
+ pop_pktbl
2330
+ result = expr
2331
+ }
2332
+
2333
+ p_args: p_expr
2334
+ {
2335
+ expr, = val
2336
+
2337
+ ary = s(:array_TAIL, expr).line expr.line
2338
+ result = new_array_pattern_tail(ary, nil, nil, nil).line expr.line
2339
+ }
2340
+ | p_args_head
2341
+ {
2342
+ head, = val
2343
+
2344
+ result = new_array_pattern_tail head, true, nil, nil
2345
+ }
2346
+ | p_args_head p_arg
2347
+ {
2348
+ head, tail = val
2349
+
2350
+ both = array_pat_concat head, tail
2351
+
2352
+ result = new_array_pattern_tail both, nil, nil, nil
2353
+ result.line head.line
2354
+ }
2355
+ | p_args_head tSTAR tIDENTIFIER
2356
+ {
2357
+ head, _, (id, _line) = val
2358
+
2359
+ result = new_array_pattern_tail head, true, id.to_sym, nil
2360
+ result.line head.line
2361
+ }
2362
+ | p_args_head tSTAR tIDENTIFIER tCOMMA p_args_post
2363
+ {
2364
+ head, _, (id, _line), _, post = val
2365
+
2366
+ result = new_array_pattern_tail head, true, id.to_sym, post
2367
+ result.line head.line
2368
+ }
2369
+ | p_args_head tSTAR
2370
+ {
2371
+ expr, _ = val
2372
+
2373
+ result = new_array_pattern_tail(expr, true, nil, nil).line expr.line
2374
+ }
2375
+ | p_args_head tSTAR tCOMMA p_args_post
2376
+ {
2377
+ head, _, _, post = val
2378
+
2379
+ result = new_array_pattern_tail(head, true, nil, post).line head.line
2380
+ }
2381
+ | p_args_tail
2382
+
2383
+ p_args_head: p_arg tCOMMA
2384
+ {
2385
+ arg, _ = val
2386
+ result = arg
2387
+ }
2388
+ | p_args_head p_arg tCOMMA
2389
+ {
2390
+ head, tail, _ = val
2391
+
2392
+ result = s(:PATTERN, *head.sexp_body, *tail.sexp_body)
2393
+ result.line head.line
2394
+ }
2395
+
2396
+ p_args_tail: p_rest
2397
+ {
2398
+ (id, line), = val
2399
+
2400
+ result = new_array_pattern_tail nil, true, id, nil
2401
+ result.line line
2402
+ }
2403
+ | p_rest tCOMMA p_args_post
2404
+ {
2405
+ (id, line), _, rhs = val
2406
+
2407
+ result = new_array_pattern_tail nil, true, id, rhs
2408
+ result.line line
2409
+ }
2410
+
2411
+ p_find: p_rest tCOMMA p_args_post tCOMMA p_rest
2412
+ {
2413
+ lhs, _, mid, _, rhs = val
2414
+
2415
+ result = new_find_pattern_tail lhs, mid, rhs
2416
+ }
2417
+
2418
+ p_rest: tSTAR tIDENTIFIER
2419
+ {
2420
+ _, (id, line) = val
2421
+
2422
+ result = [id.to_sym, line]
2423
+ }
2424
+ | tSTAR
2425
+ {
2426
+ (_id, line), = val
2427
+
2428
+ result = [nil, line]
2429
+ }
2430
+
2431
+ p_args_post: p_arg
2432
+ | p_args_post tCOMMA p_arg
2433
+ {
2434
+ lhs, _, rhs = val
2435
+
2436
+ result = array_pat_concat lhs, rhs
2437
+ }
2438
+
2439
+ p_arg: p_expr
2440
+ {
2441
+ expr, = val
2442
+ expr = s(:array_TAIL, expr).line expr.line unless
2443
+ expr.sexp_type == :array_TAIL
2444
+ result = expr
2445
+ }
2446
+
2447
+ p_kwargs: p_kwarg tCOMMA p_any_kwrest
2448
+ {
2449
+ kw_arg, _, rest = val
2450
+ # TODO? new_unique_key_hash(p, $1, &@$)
2451
+ result = new_hash_pattern_tail kw_arg, rest, kw_arg.line
2452
+ }
2453
+ | p_kwarg
2454
+ {
2455
+ kwarg, = val
2456
+ # TODO? new_unique_key_hash(p, $1, &@$)
2457
+ result = new_hash_pattern_tail kwarg, nil, kwarg.line
2458
+ }
2459
+ | p_kwarg tCOMMA
2460
+ {
2461
+ kwarg, _ = val
2462
+ # TODO? new_unique_key_hash(p, $1, &@$)
2463
+ result = new_hash_pattern_tail kwarg, nil, kwarg.line
2464
+ }
2465
+ | p_any_kwrest
2466
+ {
2467
+ rest, = val
2468
+
2469
+ result = new_hash_pattern_tail nil, rest, rest.line
2470
+ }
2471
+
2472
+ p_kwarg: p_kw # TODO? rb_ary_new_from_args(1, $1)
2473
+ | p_kwarg tCOMMA p_kw
2474
+ {
2475
+ kwarg, _, kw = val
2476
+ kwarg.concat kw.sexp_body
2477
+ result = kwarg
2478
+ }
2479
+
2480
+ p_kw: p_kw_label p_expr
2481
+ {
2482
+ # TODO: error_duplicate_pattern_key(p, get_id($1), &@1);
2483
+ lhs, rhs = val
2484
+
2485
+ result = s(:PAIR, lhs, rhs).line lhs.line
2486
+ }
2487
+ | p_kw_label
2488
+ {
2489
+ lhs, = val
2490
+
2491
+ # TODO: error_duplicate_pattern_variable(p, get_id($1), &@1);
2492
+
2493
+ # TODO: if ($1 && !is_local_id(get_id($1))) {
2494
+ # yyerror1(&@1, "key must be valid as local variables");
2495
+ # }
2496
+
2497
+ # $$ = list_append(p, NEW_LIST(NEW_LIT(ID2SYM($1), &@$), &@$),
2498
+ # assignable(p, $1, 0, &@$));
2499
+
2500
+ case lhs.sexp_type
2501
+ when :lit then
2502
+ assignable [lhs.value, lhs.line]
2503
+ else
2504
+ # TODO or done?
2505
+ debug 10
2506
+ end
2507
+
2508
+ # TODO PAIR -> LIST ?
2509
+ result = s(:PAIR, lhs, nil).line lhs.line
2510
+ }
2511
+
2512
+ p_kw_label: tLABEL
2513
+ {
2514
+ result = wrap :lit, val[0]
2515
+ }
2516
+ #if V > 30
2517
+ | tSTRING_BEG string_contents tLABEL_END
2518
+ {
2519
+ # you can't actually get here the way I lex labels
2520
+ debug 11
2521
+ }
2522
+ #endif
2523
+
2524
+ p_kwrest: kwrest_mark tIDENTIFIER
2525
+ {
2526
+ _, (id, line) = val
2527
+
2528
+ name = id.to_sym
2529
+ self.assignable [name, line]
2530
+ result = s(:kwrest, :"**#{name}").line line
2531
+ }
2532
+ | kwrest_mark
2533
+ {
2534
+ (_, line), = val
2535
+
2536
+ result = s(:kwrest, :"**").line line
2537
+ }
2538
+
2539
+ p_kwnorest: kwrest_mark kNIL
2540
+ {
2541
+ (_, line), _ = val
2542
+
2543
+ # TODO: or s(:norest)? s(:**nil)?
2544
+ result = s(:kwrest, :"**nil").line line
2545
+ }
2546
+
2547
+ p_any_kwrest: p_kwrest
2548
+ | p_kwnorest
2549
+
2550
+ p_value: p_primitive
2551
+ | p_primitive tDOT2 p_primitive
2552
+ {
2553
+ lhs, _, rhs = val
2554
+
2555
+ lhs = value_expr lhs
2556
+ rhs = value_expr rhs
2557
+
2558
+ result = s(:dot2, lhs, rhs).line lhs.line
2559
+ }
2560
+ | p_primitive tDOT3 p_primitive
2561
+ {
2562
+ lhs, _, rhs = val
2563
+
2564
+ lhs = value_expr lhs
2565
+ rhs = value_expr rhs
2566
+
2567
+ result = s(:dot3, lhs, rhs).line lhs.line
2568
+ }
2569
+ | p_primitive tDOT2
2570
+ {
2571
+ v1, _ = val
2572
+
2573
+ result = s(:dot2, v1, nil).line v1.line
2574
+ }
2575
+ | p_primitive tDOT3
2576
+ {
2577
+ v1, _ = val
2578
+
2579
+ result = s(:dot3, v1, nil).line v1.line
2580
+ }
2581
+ #if V == 30
2582
+ | p_variable
2583
+ #endif
2584
+ | p_var_ref
2585
+ #if V > 30
2586
+ | p_expr_ref
2587
+ #endif
2588
+ | p_const
2589
+ | tBDOT2 p_primitive
2590
+ {
2591
+ _, v1 = val
2592
+
2593
+ result = s(:dot2, nil, v1).line v1.line
2594
+ }
2595
+ | tBDOT3 p_primitive
2596
+ {
2597
+ _, v1 = val
2598
+
2599
+ result = s(:dot3, nil, v1).line v1.line
2600
+ }
2601
+
2602
+ p_primitive: literal
2603
+ | strings
2604
+ | xstring
2605
+ | regexp
2606
+ | words
2607
+ {
2608
+ result = ary_to_pat val[0]
2609
+ }
2610
+ | qwords
2611
+ {
2612
+ result = ary_to_pat val[0]
2613
+ }
2614
+ | symbols
2615
+ {
2616
+ result = ary_to_pat val[0]
2617
+ }
2618
+ | qsymbols
2619
+ {
2620
+ result = ary_to_pat val[0]
2621
+ }
2622
+ | keyword_variable
2623
+ {
2624
+ # TODO? if (!($$ = gettable(p, $1, &@$))) $$ = NEW_BEGIN(0, &@$);
2625
+ var, = val
2626
+
2627
+ result = var
2628
+ }
2629
+ | lambda
2630
+
2631
+ p_variable: tIDENTIFIER
2632
+ {
2633
+ # TODO: error_duplicate_pattern_variable(p, $1, &@1);
2634
+ # TODO: assignable(p, $1, 0, &@$);
2635
+ result = wrap :lasgn, val[0]
2636
+ }
2637
+
2638
+ p_var_ref: tCARET tIDENTIFIER
2639
+ {
2640
+ # TODO: check id against env for lvar or dvar
2641
+ result = wrap :lvar, val[1]
2642
+ }
2643
+ #if V > 30
2644
+ | tCARET nonlocal_var
2645
+ {
2646
+ _, var = val
2647
+ result = var
2648
+ }
2649
+ #endif
2650
+
2651
+ #if V > 30
2652
+ p_expr_ref: tCARET tLPAREN expr_value rparen
2653
+ {
2654
+ _, _, expr, _ = val
2655
+ result = expr # TODO? s(:begin, expr).line expr.line
2656
+ }
2657
+ #endif
2658
+
2659
+ p_const: tCOLON3 cname
2660
+ {
2661
+ result = wrap :colon3, val[1]
2662
+ }
2663
+ | p_const tCOLON2 cname
2664
+ {
2665
+ lhs, _, (id, _line) = val
2666
+
2667
+ l = lhs.line
2668
+ result = s(:const, s(:colon2, lhs, id.to_sym).line(l)).line l
2669
+ }
2670
+ | tCONSTANT
2671
+ {
2672
+ # TODO $$ = gettable(p, $1, &@$);
2673
+ result = wrap :const, val[0]
2674
+ }
2675
+ ######################################################################
2676
+
2677
+ opt_rescue: k_rescue exc_list exc_var then compstmt opt_rescue
2678
+ {
2679
+ (_, line), klasses, var, _, body, rest = val
2680
+
2681
+ klasses ||= s(:array)
2682
+ klasses << new_assign(var, s(:gvar, :"$!").line(var.line)) if var
2683
+ klasses.line line
2684
+
2685
+ result = new_resbody(klasses, body)
2686
+ result << rest if rest # UGH, rewritten above
2687
+ }
2688
+ |
2689
+ {
2690
+ result = nil
2691
+ }
2692
+
2693
+ exc_list: arg_value
2694
+ {
2695
+ arg, = val
2696
+ result = s(:array, arg).line arg.line
2697
+ }
2698
+ | mrhs
2699
+ | none
2700
+
2701
+ exc_var: tASSOC lhs
2702
+ {
2703
+ result = val[1]
2704
+ }
2705
+ | none
2706
+
2707
+ opt_ensure: k_ensure compstmt
2708
+ {
2709
+ (_, line), body = val
2710
+
2711
+ result = body || s(:nil).line(line)
2712
+ }
2713
+ | none
2714
+
2715
+ literal: numeric
2716
+ {
2717
+ (lit, line), = val
2718
+ result = s(:lit, lit).line line
2719
+ }
2720
+ | symbol
2721
+
2722
+ strings: string
2723
+ {
2724
+ str, = val
2725
+ str = s(:dstr, str.value) if str.sexp_type == :evstr
2726
+ result = str
2727
+ }
2728
+
2729
+ string: tCHAR
2730
+ {
2731
+ debug 12
2732
+ }
2733
+ | string1
2734
+ | string string1
2735
+ {
2736
+ result = self.literal_concat val[0], val[1]
2737
+ }
2738
+
2739
+ string1: tSTRING_BEG string_contents tSTRING_END
2740
+ {
2741
+ (_, line), str, (_, func) = val
2742
+
2743
+ str = dedent str if func =~ RubyLexer::STR_FUNC_DEDENT
2744
+
2745
+ result = str.line line
2746
+ }
2747
+ | tSTRING
2748
+ {
2749
+ result = new_string val
2750
+ }
2751
+
2752
+ xstring: tXSTRING_BEG xstring_contents tSTRING_END
2753
+ {
2754
+ result = new_xstring val
2755
+ # TODO: dedent?!?! SERIOUSLY?!?
2756
+ }
2757
+
2758
+ regexp: tREGEXP_BEG regexp_contents tREGEXP_END
2759
+ {
2760
+ result = new_regexp val
2761
+ }
2762
+
2763
+ words: tWORDS_BEG tSPACE tSTRING_END
2764
+ {
2765
+ (_, line), _, (_, line_max) = val
2766
+
2767
+ result = s(:array).line line
2768
+ result.line_max = line_max
2769
+ }
2770
+ | tWORDS_BEG word_list tSTRING_END
2771
+ {
2772
+ (_, line), list, (_, line_max) = val
2773
+
2774
+ result = list.line line
2775
+ result.line_max = line_max
2776
+ }
2777
+
2778
+ word_list: none
2779
+ {
2780
+ result = new_word_list
2781
+ }
2782
+ | word_list word tSPACE
2783
+ {
2784
+ result = val[0].dup << new_word_list_entry(val)
2785
+ }
2786
+
2787
+ word: string_content
2788
+ | word string_content
2789
+ {
2790
+ result = self.literal_concat val[0], val[1]
2791
+ }
2792
+
2793
+ symbols: tSYMBOLS_BEG tSPACE tSTRING_END
2794
+ {
2795
+ (_, line), _, (_, line_max) = val
2796
+
2797
+ result = s(:array).line line
2798
+ result.line_max = line_max
2799
+ }
2800
+ | tSYMBOLS_BEG symbol_list tSTRING_END
2801
+ {
2802
+ (_, line), list, (_, line_max), = val
2803
+
2804
+ result = list.line line
2805
+ result.line_max = line_max
2806
+ }
2807
+
2808
+ symbol_list: none
2809
+ {
2810
+ result = new_symbol_list
2811
+ }
2812
+ | symbol_list word tSPACE
2813
+ {
2814
+ list, * = val
2815
+ result = list.dup << new_symbol_list_entry(val)
2816
+ }
2817
+
2818
+ qwords: tQWORDS_BEG tSPACE tSTRING_END
2819
+ {
2820
+ (_, line), _, (_, line_max) = val
2821
+
2822
+ result = s(:array).line line
2823
+ result.line_max = line_max
2824
+ }
2825
+ | tQWORDS_BEG qword_list tSTRING_END
2826
+ {
2827
+ (_, line), list, (_, line_max) = val
2828
+
2829
+ result = list.line line
2830
+ result.line_max = line_max
2831
+ }
2832
+
2833
+ qsymbols: tQSYMBOLS_BEG tSPACE tSTRING_END
2834
+ {
2835
+ (_, line), _, (_, line_max) = val
2836
+
2837
+ result = s(:array).line line
2838
+ result.line_max = line_max
2839
+ }
2840
+ | tQSYMBOLS_BEG qsym_list tSTRING_END
2841
+ {
2842
+ (_, line), list, (_, line_max) = val
2843
+
2844
+ result = list.line line
2845
+ result.line_max = line_max
2846
+ }
2847
+
2848
+ qword_list: none
2849
+ {
2850
+ result = new_qword_list
2851
+ }
2852
+ | qword_list tSTRING_CONTENT tSPACE
2853
+ {
2854
+ result = val[0].dup << new_qword_list_entry(val)
2855
+ }
2856
+
2857
+ qsym_list: none
2858
+ {
2859
+ result = new_qsym_list
2860
+ }
2861
+ | qsym_list tSTRING_CONTENT tSPACE
2862
+ {
2863
+ result = val[0].dup << new_qsym_list_entry(val)
2864
+ }
2865
+
2866
+ string_contents: none
2867
+ {
2868
+ line = prev_value_to_lineno _values.last
2869
+ result = s(:str, +"").line line
2870
+ }
2871
+ | string_contents string_content
2872
+ {
2873
+ v1, v2 = val
2874
+ result = literal_concat v1, v2
2875
+ }
2876
+
2877
+ xstring_contents: none
2878
+ {
2879
+ result = nil
2880
+ }
2881
+ | xstring_contents string_content
2882
+ {
2883
+ v1, v2 = val
2884
+ result = literal_concat v1, v2
2885
+ }
2886
+
2887
+ regexp_contents: none
2888
+ {
2889
+ result = nil
2890
+ }
2891
+ | regexp_contents string_content
2892
+ {
2893
+ v1, v2 = val
2894
+ result = literal_concat v1, v2
2895
+ }
2896
+
2897
+ string_content: tSTRING_CONTENT
2898
+ {
2899
+ result = new_string val
2900
+ }
2901
+ | tSTRING_DVAR
2902
+ {
2903
+ result = lexer.lex_strterm
2904
+
2905
+ lexer.lex_strterm = nil
2906
+ lexer.lex_state = EXPR_BEG
2907
+ }
2908
+ string_dvar
2909
+ {
2910
+ _, strterm, str = val
2911
+ lexer.lex_strterm = strterm
2912
+ result = s(:evstr, str).line str.line
2913
+ }
2914
+ | tSTRING_DBEG
2915
+ {
2916
+ result = [lexer.lex_strterm,
2917
+ lexer.brace_nest,
2918
+ lexer.string_nest, # TODO: remove
2919
+ lexer.lex_state,
2920
+ lexer.lineno,
2921
+ ]
2922
+
2923
+ lexer.cmdarg.push false
2924
+ lexer.cond.push false
2925
+
2926
+ lexer.lex_strterm = nil
2927
+ lexer.brace_nest = 0
2928
+ lexer.string_nest = 0
2929
+
2930
+ lexer.lex_state = EXPR_BEG
2931
+ }
2932
+ compstmt
2933
+ tSTRING_DEND
2934
+ {
2935
+ _, memo, stmt, _ = val
2936
+
2937
+ lex_strterm, brace_nest, string_nest, oldlex_state, line = memo
2938
+ # TODO: heredoc_indent
2939
+
2940
+ lexer.lex_strterm = lex_strterm
2941
+ lexer.brace_nest = brace_nest
2942
+ lexer.string_nest = string_nest
2943
+
2944
+ lexer.cond.pop
2945
+ lexer.cmdarg.pop
2946
+
2947
+ lexer.lex_state = oldlex_state
2948
+
2949
+ case stmt
2950
+ when Sexp then
2951
+ case stmt.sexp_type
2952
+ when :str, :dstr, :evstr then
2953
+ result = stmt
2954
+ else
2955
+ result = s(:evstr, stmt).line line
2956
+ end
2957
+ when nil then
2958
+ result = s(:evstr).line line
2959
+ else
2960
+ debug 13
2961
+ raise "unknown string body: #{stmt.inspect}"
2962
+ end
2963
+ }
2964
+
2965
+ string_dvar: tGVAR
2966
+ {
2967
+ result = wrap :gvar, val[0]
2968
+ }
2969
+ | tIVAR
2970
+ {
2971
+ result = wrap :ivar, val[0]
2972
+ }
2973
+ | tCVAR
2974
+ {
2975
+ result = wrap :cvar, val[0]
2976
+ }
2977
+ | backref
2978
+
2979
+ symbol: ssym
2980
+ | dsym
2981
+
2982
+ ssym: tSYMBEG sym
2983
+ {
2984
+ lexer.lex_state = EXPR_END
2985
+ result = wrap :lit, val[1]
2986
+ }
2987
+ | tSYMBOL
2988
+ {
2989
+ lexer.lex_state = EXPR_END
2990
+ result = wrap :lit, val[0]
2991
+ }
2992
+
2993
+ sym: fname | tIVAR | tGVAR | tCVAR
2994
+
2995
+ dsym: tSYMBEG string_contents tSTRING_END
2996
+ {
2997
+ _, result, _ = val
2998
+
2999
+ lexer.lex_state = EXPR_END
3000
+
3001
+ result ||= s(:str, "").line lexer.lineno
3002
+
3003
+ case result.sexp_type
3004
+ when :dstr then
3005
+ result.sexp_type = :dsym
3006
+ when :str then
3007
+ result = s(:lit, result.last.to_sym).line result.line
3008
+ when :evstr then
3009
+ result = s(:dsym, "", result).line result.line
3010
+ else
3011
+ debug 14
3012
+ end
3013
+ }
3014
+
3015
+ numeric: simple_numeric
3016
+ | tUMINUS_NUM simple_numeric =tLOWEST
3017
+ {
3018
+ _, (num, line) = val
3019
+ result = [-num, line]
3020
+ }
3021
+
3022
+ simple_numeric: tINTEGER
3023
+ | tFLOAT
3024
+ | tRATIONAL
3025
+ | tIMAGINARY
3026
+
3027
+ #if V > 30
3028
+ nonlocal_var: tIVAR { result = wrap :ivar, val[0] }
3029
+ | tGVAR { result = wrap :gvar, val[0] }
3030
+ | tCVAR { result = wrap :cvar, val[0] }
3031
+ #endif
3032
+
3033
+ user_variable: tIDENTIFIER
3034
+ | tIVAR
3035
+ | tGVAR
3036
+ | tCONSTANT
3037
+ | tCVAR
3038
+
3039
+ keyword_variable: kNIL { result = s(:nil).line lexer.lineno }
3040
+ | kSELF { result = s(:self).line lexer.lineno }
3041
+ | kTRUE { result = s(:true).line lexer.lineno }
3042
+ | kFALSE { result = s(:false).line lexer.lineno }
3043
+ | k__FILE__ { result = s(:str, self.file).line lexer.lineno }
3044
+ | k__LINE__ { result = s(:lit, lexer.lineno).line lexer.lineno }
3045
+ | k__ENCODING__
3046
+ {
3047
+ l = lexer.lineno
3048
+ result =
3049
+ if defined? Encoding then
3050
+ s(:colon2, s(:const, :Encoding).line(l), :UTF_8).line l
3051
+ else
3052
+ s(:str, "Unsupported!").line l
3053
+ end
3054
+ }
3055
+
3056
+ var_ref: user_variable
3057
+ {
3058
+ raise "NO: #{val.inspect}" if Sexp === val.first
3059
+ (var, line), = val
3060
+ result = Sexp === var ? var : self.gettable(var)
3061
+
3062
+ result.line line
3063
+ }
3064
+ | keyword_variable
3065
+ {
3066
+ var = val[0]
3067
+ result = Sexp === var ? var : self.gettable(var)
3068
+ }
3069
+
3070
+ var_lhs: user_variable
3071
+ {
3072
+ result = self.assignable val[0]
3073
+ }
3074
+ | keyword_variable
3075
+ {
3076
+ result = self.assignable val[0]
3077
+ debug 15
3078
+ }
3079
+
3080
+ backref: tNTH_REF
3081
+ {
3082
+ (ref, line), = val
3083
+ result = s(:nth_ref, ref).line line
3084
+ }
3085
+ | tBACK_REF
3086
+ {
3087
+ (ref, line), = val
3088
+ result = s(:back_ref, ref).line line
3089
+ }
3090
+
3091
+ superclass: tLT
3092
+ {
3093
+ lexer.lex_state = EXPR_BEG
3094
+ lexer.command_start = true
3095
+ }
3096
+ expr_value term
3097
+ {
3098
+ result = val[2]
3099
+ }
3100
+ | none
3101
+ {
3102
+ result = nil
3103
+ }
3104
+
3105
+ f_opt_paren_args: f_paren_args
3106
+ | none
3107
+ {
3108
+ result = end_args val
3109
+ }
3110
+
3111
+ f_paren_args: tLPAREN2 f_args rparen
3112
+ {
3113
+ result = end_args val
3114
+ }
3115
+ #if V == 30
3116
+ | tLPAREN2 f_arg tCOMMA args_forward rparen
3117
+ {
3118
+ result = end_args val
3119
+ }
3120
+ | tLPAREN2 args_forward rparen
3121
+ {
3122
+ result = end_args val
3123
+ }
3124
+ #endif
3125
+
3126
+ f_arglist: f_paren_args
3127
+ | {
3128
+ result = self.in_kwarg
3129
+ self.in_kwarg = true
3130
+ self.lexer.lex_state |= EXPR_LABEL
3131
+ }
3132
+ f_args term
3133
+ {
3134
+ result = end_args val
3135
+ }
3136
+
3137
+ args_tail: f_kwarg tCOMMA f_kwrest opt_f_block_arg
3138
+ {
3139
+ result = args val
3140
+ }
3141
+ | f_kwarg opt_f_block_arg
3142
+ {
3143
+ result = args val
3144
+ }
3145
+ | f_any_kwrest opt_f_block_arg
3146
+ {
3147
+ result = args val
3148
+ }
3149
+ | f_block_arg
3150
+ #if V > 30
3151
+ | args_forward
3152
+ #endif
3153
+
3154
+ opt_args_tail: tCOMMA args_tail
3155
+ {
3156
+ result = val[1]
3157
+ }
3158
+ |
3159
+ {
3160
+ result = nil
3161
+ }
3162
+
3163
+ f_args: f_arg tCOMMA f_optarg tCOMMA f_rest_arg opt_args_tail
3164
+ {
3165
+ result = args val
3166
+ }
3167
+ | f_arg tCOMMA f_optarg tCOMMA f_rest_arg tCOMMA f_arg opt_args_tail
3168
+ {
3169
+ result = args val
3170
+ }
3171
+ | f_arg tCOMMA f_optarg opt_args_tail
3172
+ {
3173
+ result = args val
3174
+ }
3175
+ | f_arg tCOMMA f_optarg tCOMMA f_arg opt_args_tail
3176
+ {
3177
+ result = args val
3178
+ }
3179
+ | f_arg tCOMMA f_rest_arg opt_args_tail
3180
+ {
3181
+ result = args val
3182
+ }
3183
+ | f_arg tCOMMA f_rest_arg tCOMMA f_arg opt_args_tail
3184
+ {
3185
+ result = args val
3186
+ }
3187
+ | f_arg opt_args_tail
3188
+ {
3189
+ result = args val
3190
+ }
3191
+ | f_optarg tCOMMA f_rest_arg opt_args_tail
3192
+ {
3193
+ result = args val
3194
+ }
3195
+ | f_optarg tCOMMA f_rest_arg tCOMMA f_arg opt_args_tail
3196
+ {
3197
+ result = args val
3198
+ }
3199
+ | f_optarg opt_args_tail
3200
+ {
3201
+ result = args val
3202
+ }
3203
+ | f_optarg tCOMMA f_arg opt_args_tail
3204
+ {
3205
+ result = args val
3206
+ }
3207
+ | f_rest_arg opt_args_tail
3208
+ {
3209
+ result = args val
3210
+ }
3211
+ | f_rest_arg tCOMMA f_arg opt_args_tail
3212
+ {
3213
+ result = args val
3214
+ }
3215
+ | args_tail
3216
+ {
3217
+ result = args val
3218
+ }
3219
+ |
3220
+ {
3221
+ result = args val
3222
+ # result.line lexer.lineno
3223
+ }
3224
+
3225
+ args_forward: tBDOT3
3226
+ {
3227
+ result = s(:forward_args).line lexer.lineno
3228
+ }
3229
+
3230
+ f_bad_arg: tCONSTANT
3231
+ {
3232
+ yyerror "formal argument cannot be a constant"
3233
+ }
3234
+ | tIVAR
3235
+ {
3236
+ yyerror "formal argument cannot be an instance variable"
3237
+ }
3238
+ | tGVAR
3239
+ {
3240
+ yyerror "formal argument cannot be a global variable"
3241
+ }
3242
+ | tCVAR
3243
+ {
3244
+ yyerror "formal argument cannot be a class variable"
3245
+ }
3246
+
3247
+ f_norm_arg: f_bad_arg
3248
+ | tIDENTIFIER
3249
+ {
3250
+ (id, line), = val
3251
+ identifier = id.to_sym
3252
+ self.env[identifier] = :lvar
3253
+
3254
+ result = [identifier, line]
3255
+ }
3256
+
3257
+ f_arg_asgn: f_norm_arg
3258
+
3259
+ f_arg_item: f_arg_asgn
3260
+ | tLPAREN f_margs rparen
3261
+ {
3262
+ _, margs, _ = val
3263
+
3264
+ result = margs
3265
+ }
3266
+
3267
+ f_arg: f_arg_item
3268
+ {
3269
+ result = new_arg val
3270
+ }
3271
+ | f_arg tCOMMA f_arg_item
3272
+ {
3273
+ list, _, item = val
3274
+
3275
+ if list.sexp_type == :args then
3276
+ result = list
3277
+ else
3278
+ result = s(:args, list).line list.line
3279
+ end
3280
+
3281
+ if Sexp === item then
3282
+ line_max = item.line_max
3283
+ else
3284
+ item, line_max = item
3285
+ end
3286
+
3287
+ result << item
3288
+ result.line_max = line_max
3289
+ }
3290
+
3291
+ f_label: tLABEL
3292
+
3293
+ f_kw: f_label arg_value
3294
+ {
3295
+ # TODO: new_kw_arg
3296
+ (label, line), arg = val
3297
+
3298
+ identifier = label.to_sym
3299
+ self.env[identifier] = :lvar
3300
+
3301
+ kwarg = s(:kwarg, identifier, arg).line line
3302
+ result = s(:array, kwarg).line line
3303
+ }
3304
+ | f_label
3305
+ {
3306
+ (label, line), = val
3307
+
3308
+ id = label.to_sym
3309
+ self.env[id] = :lvar
3310
+
3311
+ result = s(:array, s(:kwarg, id).line(line)).line line
3312
+ }
3313
+
3314
+ f_block_kw: f_label primary_value
3315
+ {
3316
+ # TODO: new_kw_arg
3317
+ (label, line), expr = val
3318
+ id = label.to_sym
3319
+ self.env[id] = :lvar
3320
+
3321
+ result = s(:array, s(:kwarg, id, expr).line(line)).line line
3322
+ }
3323
+ | f_label
3324
+ {
3325
+ # TODO: new_kw_arg
3326
+ (label, line), = val
3327
+ id = label.to_sym
3328
+ self.env[id] = :lvar
3329
+
3330
+ result = s(:array, s(:kwarg, id).line(line)).line line
3331
+ }
3332
+
3333
+ f_block_kwarg: f_block_kw
3334
+ | f_block_kwarg tCOMMA f_block_kw
3335
+ {
3336
+ list, _, item = val
3337
+ result = list << item.last
3338
+ }
3339
+
3340
+ f_kwarg: f_kw
3341
+ | f_kwarg tCOMMA f_kw
3342
+ {
3343
+ result = args val
3344
+ }
3345
+
3346
+ kwrest_mark: tPOW
3347
+ | tDSTAR
3348
+
3349
+ f_no_kwarg: kwrest_mark kNIL
3350
+ {
3351
+ (_, line), _ = val
3352
+ result = [:"**nil", line]
3353
+ }
3354
+
3355
+ f_kwrest: kwrest_mark tIDENTIFIER
3356
+ {
3357
+ _, (id, line) = val
3358
+
3359
+ name = id.to_sym
3360
+ self.assignable [name, line]
3361
+ result = [:"**#{name}", line]
3362
+ }
3363
+ | kwrest_mark
3364
+ {
3365
+ id = :"**"
3366
+ self.env[id] = :lvar # TODO: needed?!?
3367
+ result = [id, lexer.lineno] # TODO: tPOW/tDSTAR include lineno
3368
+ }
3369
+
3370
+ f_opt: f_arg_asgn
3371
+ #if V > 30
3372
+ f_eq
3373
+ #else
3374
+ tEQL
3375
+ #endif
3376
+ arg_value
3377
+ {
3378
+ lhs, _, rhs = val
3379
+ result = self.assignable lhs, rhs
3380
+ # TODO: detect duplicate names
3381
+ # TODO? p->cur_arg = 0;
3382
+ # TODO? p->ctxt.in_argdef = 1;
3383
+ }
3384
+
3385
+ f_block_opt: f_arg_asgn
3386
+ #if V > 30
3387
+ f_eq
3388
+ #else
3389
+ tEQL
3390
+ #endif
3391
+ primary_value
3392
+ {
3393
+ lhs, _, rhs = val
3394
+ result = self.assignable lhs, rhs
3395
+ # TODO? p->cur_arg = 0;
3396
+ # TODO? p->ctxt.in_argdef = 1;
3397
+ }
3398
+
3399
+ f_block_optarg: f_block_opt
3400
+ {
3401
+ optblk, = val
3402
+ result = s(:block, optblk).line optblk.line
3403
+ }
3404
+ | f_block_optarg tCOMMA f_block_opt
3405
+ {
3406
+ optarg, _, optblk = val
3407
+ result = optarg
3408
+ result << optblk
3409
+ }
3410
+
3411
+ f_optarg: f_opt
3412
+ {
3413
+ opt, = val
3414
+ result = s(:block, opt).line opt.line
3415
+ }
3416
+ | f_optarg tCOMMA f_opt
3417
+ {
3418
+ result = self.block_append val[0], val[2]
3419
+ }
3420
+
3421
+ restarg_mark: tSTAR2 | tSTAR
3422
+
3423
+ f_rest_arg: restarg_mark tIDENTIFIER
3424
+ {
3425
+ # TODO: differs from parse.y - needs tests
3426
+ _, (id, line) = val
3427
+ name = id.to_sym
3428
+ self.assignable [name, line]
3429
+ result = [:"*#{name}", line]
3430
+ }
3431
+ | restarg_mark
3432
+ {
3433
+ name = :"*"
3434
+ self.env[name] = :lvar
3435
+ result = [name, lexer.lineno] # FIX: tSTAR to include lineno
3436
+ }
3437
+
3438
+ blkarg_mark: tAMPER2 | tAMPER
3439
+
3440
+ f_block_arg: blkarg_mark tIDENTIFIER
3441
+ {
3442
+ _, (id, line) = val
3443
+ identifier = id.to_sym
3444
+
3445
+ self.env[identifier] = :lvar
3446
+ result = ["&#{identifier}".to_sym, line]
3447
+ }
3448
+ | blkarg_mark
3449
+ {
3450
+ (_, line), = val
3451
+
3452
+ result = [:&, line]
3453
+ }
3454
+
3455
+ opt_f_block_arg: tCOMMA f_block_arg
3456
+ {
3457
+ _, arg = val
3458
+ result = arg
3459
+ }
3460
+ |
3461
+ {
3462
+ result = nil
3463
+ }
3464
+
3465
+ singleton: var_ref
3466
+ | tLPAREN2
3467
+ {
3468
+ lexer.lex_state = EXPR_BEG
3469
+ }
3470
+ expr rparen
3471
+ {
3472
+ result = val[2]
3473
+ yyerror "Can't define single method for literals." if
3474
+ result.sexp_type == :lit
3475
+ }
3476
+
3477
+ assoc_list: none
3478
+ {
3479
+ result = s(:array).line lexer.lineno
3480
+ }
3481
+ | assocs trailer
3482
+
3483
+ assocs: assoc
3484
+ | assocs tCOMMA assoc
3485
+ {
3486
+ list = val[0].dup
3487
+ more = val[2].sexp_body
3488
+ list.push(*more) unless more.empty?
3489
+ result = list
3490
+ result.sexp_type = :hash
3491
+ }
3492
+
3493
+ assoc: arg_value tASSOC arg_value
3494
+ {
3495
+ v1, _, v2 = val
3496
+ result = s(:array, v1, v2).line v1.line
3497
+ }
3498
+ | tLABEL arg_value
3499
+ {
3500
+ label, arg = val
3501
+
3502
+ lit = wrap :lit, label
3503
+ result = s(:array, lit, arg).line lit.line
3504
+ }
3505
+ | tLABEL
3506
+ {
3507
+ lit = wrap :lit, val[0]
3508
+ arg = nil
3509
+
3510
+ result = s(:array, lit, arg).line lit.line
3511
+ }
3512
+ | tSTRING_BEG string_contents tLABEL_END arg_value
3513
+ {
3514
+ (_, line), sym, _, value = val
3515
+
3516
+ sym.sexp_type = :dsym
3517
+
3518
+ result = s(:array, sym, value).line line
3519
+ }
3520
+ | tDSTAR arg_value
3521
+ {
3522
+ _, arg = val
3523
+ line = arg.line
3524
+ result = s(:array, s(:kwsplat, arg).line(line)).line line
3525
+ }
3526
+
3527
+ operation: tIDENTIFIER | tCONSTANT | tFID
3528
+ operation2: tIDENTIFIER | tCONSTANT | tFID | op
3529
+ operation3: tIDENTIFIER | tFID | op
3530
+ dot_or_colon: tDOT | tCOLON2
3531
+ call_op: tDOT
3532
+ | tLONELY # TODO: rename tANDDOT?
3533
+
3534
+ call_op2: call_op
3535
+ | tCOLON2
3536
+
3537
+ opt_terms: | terms
3538
+ opt_nl: | tNL
3539
+ rparen: opt_nl tRPAREN
3540
+ # TODO:
3541
+ # {
3542
+ # _, close = val
3543
+ # result = [close, lexer.lineno]
3544
+ # }
3545
+ rbracket: opt_nl tRBRACK
3546
+ {
3547
+ _, close = val
3548
+ result = [close, lexer.lineno]
3549
+ }
3550
+ rbrace: opt_nl tRCURLY
3551
+ {
3552
+ _, close = val
3553
+ result = [close, lexer.lineno]
3554
+ }
3555
+ trailer: | tNL | tCOMMA
3556
+
3557
+ term: tSEMI { yyerrok }
3558
+ | tNL
3559
+
3560
+ terms: term
3561
+ | terms tSEMI { yyerrok }
3562
+
3563
+ none: { result = nil; }
3564
+ end
3565
+
3566
+ ---- inner
3567
+
3568
+ require "ruby_lexer"
3569
+ require "ruby_parser_extras"
3570
+ include RubyLexer::State::Values
3571
+
3572
+ # :stopdoc:
3573
+
3574
+ # Local Variables: **
3575
+ # racc-token-length-max:14 **
3576
+ # End: **