summaryrefslogtreecommitdiff
path: root/test/prism
AgeCommit message (Collapse)Author
2024-03-06[ruby/prism] Fix up return node for ripper translationKevin Newton
https://github.com/ruby/prism/commit/c00902af23
2024-03-06[ruby/prism] Implement special array literals for ripper translationKevin Newton
https://github.com/ruby/prism/commit/a5c3d634ef
2024-03-06[ruby/prism] Fix up lambda ripper translationKevin Newton
https://github.com/ruby/prism/commit/a3156e60cc
2024-03-06[ruby/prism] Implement singleton methods for ripper translationKevin Newton
https://github.com/ruby/prism/commit/b7cd5c8e74
2024-03-06[ruby/prism] Consolidate body node visiting in ripper translationKevin Newton
https://github.com/ruby/prism/commit/8feb073fe4
2024-03-06[ruby/prism] Fix up forwarding arguments for ripper translationKevin Newton
https://github.com/ruby/prism/commit/9dbad71aa3
2024-03-06[ruby/prism] Unary not for ripper translationKevin Newton
https://github.com/ruby/prism/commit/149d01f2c9
2024-03-06[ruby/prism] Implement fields for ripper translationKevin Newton
https://github.com/ruby/prism/commit/90f8b33fad
2024-03-06[ruby/prism] Revisit call nodes for ripper translationKevin Newton
https://github.com/ruby/prism/commit/372200f970
2024-03-06[ruby/prism] Fix implementation of [] and []= for ripper translationKevin Newton
https://github.com/ruby/prism/commit/d31cf63d45
2024-03-06[ruby/prism] Implement super for ripper translationKevin Newton
https://github.com/ruby/prism/commit/18dea6ce64
2024-03-06[ruby/prism] Implement other call nodes for ripper translationKevin Newton
https://github.com/ruby/prism/commit/a76744be47
2024-03-06[ruby/prism] Implement index nodes for ripper translationKevin Newton
https://github.com/ruby/prism/commit/3fd962f2d3
2024-03-06[ruby/prism] Implement hash patterns for ripper translationKevin Newton
https://github.com/ruby/prism/commit/6bd7ae2ed2
2024-03-06[ruby/prism] Implement multi target nodes for ripper translationKevin Newton
https://github.com/ruby/prism/commit/ceb5a5cf62
2024-03-06[ruby/prism] Implement lambdas for ripper translationKevin Newton
https://github.com/ruby/prism/commit/602d3d2ccb
2024-03-06[ruby/prism] Implement target nodes for ripper translationKevin Newton
https://github.com/ruby/prism/commit/c5c8299485
2024-03-06[ruby/prism] Implement for loop for ripper translationKevin Newton
https://github.com/ruby/prism/commit/2d635ce46b
2024-03-06[ruby/prism] Implement endless methods for ripper translationKevin Newton
https://github.com/ruby/prism/commit/6611820b7b
2024-03-06[ruby/prism] Implement find pattern for ripper translationKevin Newton
https://github.com/ruby/prism/commit/ef9dca2a4c
2024-03-06[ruby/prism] Implement case/in for ripper translationKevin Newton
https://github.com/ruby/prism/commit/7f5a09f40e
2024-03-06[ruby/prism] Add constant path ripper translationKevin Newton
https://github.com/ruby/prism/commit/5e47d8eb67
2024-03-06[ruby/prism] Implement def for ripper translationKevin Newton
https://github.com/ruby/prism/commit/a3c8c27c20
2024-03-06[ruby/prism] Implement if/unless for ripper translationKevin Newton
https://github.com/ruby/prism/commit/57c1dd4859
2024-03-06[ruby/prism] Implement regular expressions for ripper translationKevin Newton
https://github.com/ruby/prism/commit/788cf7c528
2024-03-06[ruby/prism] Start tracking failing fixtures in ripper translationKevin Newton
https://github.com/ruby/prism/commit/6285e31ccc
2024-03-06[ruby/prism] Reconsolidate ripper filesKevin Newton
https://github.com/ruby/prism/commit/7a277be5fb
2024-03-04[ruby/prism] Warnings for tokens at EOLKevin Newton
https://github.com/ruby/prism/commit/d0dbf01bef
2024-03-04[ruby/prism] Add then keyword loc to when nodesKevin Newton
https://github.com/ruby/prism/commit/e1e613df16
2024-03-04[ruby/prism] Fix up some minor parser incompatibilitiesKevin Newton
https://github.com/ruby/prism/commit/c6c771d1fa
2024-02-29[ruby/prism] Warn on integers in flip-flopsKevin Newton
https://github.com/ruby/prism/commit/500099e896
2024-02-29[ruby/prism] Command line options as a bitsetKevin Newton
https://github.com/ruby/prism/commit/369ffbd57e
2024-02-29[ruby/prism] Resync RBI and test it in CIKevin Newton
https://github.com/ruby/prism/commit/4ef4032774
2024-02-29[ruby/prism] Fix an incorrect parsing for `Prism::Translation::Parser`Koichi ITO
This PR fixes an incorrect parsing for `Prism::Translation::Parser` when one-line pattern mathing with Ruby 2.7 runtime. ## Expected Parsing should be done based on the specified Ruby parsing version, independent of the Ruby runtime version. When parsing for Ruby 3.3, it should return `:match_pattern_p` node: ```console $ ruby -rprism -rprism/translation/parser33 -ve 'p Prism::Translation::Parser33.parse("foo in bar")' ruby 3.0.6p216 (2023-03-30 revision https://github.com/ruby/prism/commit/23a532679b) [x86_64-darwin19] s(:match_pattern_p, s(:send, nil, :foo), s(:match_var, :bar)) ``` ## Actual When parsing with Ruby 2.7 runtime, `match_pattern` node is returned, even though it is expected to parse for Ruby 3.3: ```console $ ruby -rprism -rprism/translation/parser33 -ve 'p Prism::Translation::Parser33.parse("foo in bar")' ruby 2.7.8p225 (2023-03-30 revision https://github.com/ruby/prism/commit/1f4d455848) [x86_64-darwin19] s(:match_pattern, s(:send, nil, :foo), s(:match_var, :bar)) ``` The cause was the use of `RUBY_VERSION` for condition logic, which made it dependent on runtime Ruby version. `Prism::Translation::Parser` supports parsing for Ruby 3.3+. Therefore, the condition for parsing Ruby 2.7, which is not supported, is being removed. ## Background Found due to incompatibility with RuboCop's `Layout/SpaceAroundKeyword` and `Style/TernaryParentheses` cops. https://github.com/ruby/prism/commit/e752e251d2
2024-02-27[ruby/prism] Ensure symbol nodes not in interpolated symbolKevin Newton
https://github.com/ruby/prism/commit/e1a9a1d478
2024-02-27[ruby/prism] Support -p, -n, -a, and -l command line optionsKevin Newton
https://github.com/ruby/prism/commit/959eb506ca
2024-02-26[ruby/prism] Fix multi write with modifier rescueKevin Newton
https://github.com/ruby/prism/commit/8ea7a3270f
2024-02-23[ruby/prism] Convert pm_integer_t to stringsKevin Newton
https://github.com/ruby/prism/commit/fa9a30ad91
2024-02-23[ruby/prism] Factor in sign to integer comparisonKevin Newton
https://github.com/ruby/prism/commit/377666a5df
2024-02-23[ruby/prism] Duplicated when clausesKevin Newton
https://github.com/ruby/prism/commit/865b0d5fbe
2024-02-23[ruby/prism] Duplicated hash keysKevin Newton
https://github.com/ruby/prism/commit/3e10c46c14
2024-02-22[ruby/prism] Parse float valuesKevin Newton
https://github.com/ruby/prism/commit/9137226a52
2024-02-22[ruby/prism] Regenerate snapshots using integer valuesKevin Newton
2024-02-22[ruby/prism] Add an IntegerField for parsing integer valuesKevin Newton
https://github.com/ruby/prism/commit/120d8c0479
2024-02-22[ruby/prism] Parse numeric valuesKevin Newton
https://github.com/ruby/prism/commit/a6a552411c
2024-02-21[ruby/prism] Support ItParametersNodeKevin Newton
So that compilers know they need to add to add an anonymous variable to the local table. https://github.com/ruby/prism/commit/7f1aadd057
2024-02-21[ruby/prism] Translation::Parser should process warnings, not just errorsNoah Gibbs
https://github.com/ruby/prism/commit/ea7e400f85
2024-02-20Workaround for `Prism::ParseTest#test_filepath` for ↵yui-knk
"unparser/corpus/literal/def.txt" See the discussion on https://github.com/ruby/ruby/pull/9923
2024-02-20Skip `test_filepath` of "unparser/corpus/literal/def.txt"yui-knk
The previous commit changes Ripper lex state behavior of `tLABEL`. For example, Ripper lex state for the second `bar` was changed by the previous commit. ``` def foo(bar: bar()) end ``` Before the commit, Ripper didn’t add label `bar` id to `vtable` because `formal_argument` function for Ripper didn’t return id but returned `VALUE lhs`. Therefore Ripper didn’t `SET_LEX_STATE(EXPR_END|EXPR_LABEL)` for following `bar` in `parse_ident` because `lvar_defined` for following `bar` was not true. Currently Ripper does `SET_LEX_STATE(EXPR_END|EXPR_LABEL)` then the result of this test case is changed like below. ``` Prism::ParseTest#test_filepath_unparser/corpus/literal/def.txt [ruby/test/prism/parse_test.rb:280]: <[[80, 13], :on_ident, “bar”, END|LABEL]> expected but was <[[80, 13], :on_ident, “bar”, ARG]>. ``` Parser sets lex state to `END|LABEL` on master branch. Therefore previous commit makes Ripper’s behavior aligned with parser’s behavior. ``` $ ruby -v -y -e "def foo(bar: bar())" -e "end" ruby 3.4.0dev (2024-02-11T23:52:05Z master 697ade7bda) [arm64-darwin21] ... Reading a token parser_dispatch_scan_event:11210 (1: 12|1|7) lex_state: ARG|LABELED -> ARG at line 11113 lex_state: ARG -> END|LABEL at line 11128 parser_dispatch_scan_event:11877 (1: 13|3|4) Next token is token “local variable or method” (1.13-1.16: bar) Shifting token “local variable or method” (1.13-1.16: bar) ```
2024-02-18[ruby/prism] Account for encoding in regexp named capturesKevin Newton
https://github.com/ruby/prism/commit/17dc6b6281