summaryrefslogtreecommitdiff
path: root/test/prism/fixtures
AgeCommit message (Collapse)Author
2024-01-24[ruby/prism] Extract snippet into its own file and skip in TruffleRubyMax Prokopiev
https://github.com/ruby/prism/commit/12649ee74c
2024-01-24[ruby/prism] Force encoding during deserialization of constantsMax Prokopiev
otherwise we get failing tests if we have non-ascii characters in fixtures/**/*.txt https://github.com/ruby/prism/commit/9323243569
2024-01-17[ruby/prism] Fix prism brace association for constant-like method/local callsAdam Hess
https://github.com/ruby/prism/commit/8ca24f263e
2024-01-16[ruby/prism] Correct the "ambiguous first argument" conditionTSUYUSATO Kitsune
Fix https://github.com/ruby/prism/pull/2182 This change reflects this line: https://github.com/ruby/ruby/blob/6283ae8d369bd2f8a022bb69bc5b742c58529dec/parse.y#L11124. https://github.com/ruby/prism/commit/a52588ff37
2024-01-10[ruby/prism] Add a "repeated flag" to parameter nodesAaron Patterson
It's possible to repeat parameters in method definitions like so: ```ruby def foo(_a, _a) end ``` The compiler needs to know to adjust the local table size to account for these duplicate names. We'll use the repeated parameter flag to account for the extra stack space required https://github.com/ruby/prism/commit/b443cb1f60 Co-Authored-By: Kevin Newton <kddnewton@gmail.com> Co-Authored-By: Jemma Issroff <jemmaissroff@gmail.com>
2024-01-09[ruby/prism] Fix assertion on spanning heredocsKevin Newton
https://github.com/ruby/prism/commit/e190308845
2024-01-03[ruby/prism] Fix parsing pinned local variable pattern for numbered parameterTSUYUSATO Kitsune
Fix https://github.com/ruby/prism/pull/2094 The part of `parse_variable_call` for variables was split into a new function `parse_variable` and used it. https://github.com/ruby/prism/commit/4c5fd1a746
2023-12-25Revert "Revert all of commits after Prism 0.19.0 release"Hiroshi SHIBATA
This reverts commit d242e8416e99eaee4465e2681210ae8b7ecd6d34.
2023-12-16Revert all of commits after Prism 0.19.0 releaseHiroshi SHIBATA
We should bundle released version of Prism for Ruby 3.3.0
2023-12-15[ruby/prism] Invalid pinned locals in pattern matchingKevin Newton
https://github.com/ruby/prism/commit/3a67b37a56
2023-12-14[ruby/prism] Fix parse result for nesting pattern matchingKevin Newton
https://github.com/ruby/prism/commit/ee6fc9ee87
2023-12-11[ruby/prism] Handle a non-interpolated dsym spanning a heredocKevin Newton
https://github.com/ruby/prism/commit/b23136ebfd
2023-12-11[ruby/prism] Fix to parse a (endless-)range with binary operatorsTSUYUSATO Kitsune
Fix https://github.com/ruby/prism/pull/2022 Fix https://github.com/ruby/prism/pull/2030 https://github.com/ruby/prism/commit/b78d8b6525
2023-12-05[ruby/prism] Fix defined with new lineeileencodes
It's possible to write the following and have it be valid Ruby: ``` defined?("foo" ) ``` But Prism wasn't taking the new line into account. This adds an `accept1` for a `PM_TOKEN_NEWLINE` to account for this. I've also updated the fixtures and snapshots to test this. https://github.com/ruby/prism/commit/b87f8eedc6
2023-12-05[ruby/prism] Add test casesTSUYUSATO Kitsune
https://github.com/ruby/prism/commit/e91f8dbb99
2023-12-05[ruby/prism] Fix some corner casesTSUYUSATO Kitsune
https://github.com/ruby/prism/commit/d5453f168e
2023-12-05[ruby/prism] Fix to parse command-style method calls more correctlyTSUYUSATO Kitsune
Fix https://github.com/ruby/prism/pull/1468 Fix https://github.com/ruby/prism/pull/1575 To decide command-style method calls are allowed, this introduce a new parameter `accepts_command_call` to `parse_expression` and some functions. Although one think this can be solved by operator precedence, it is hard or impossible, because the precedence of command-style calls is skewed (e.g. `! bar 1 ` is accepted, but `foo = ! bar 1` is rejected.) One of the most complex examples is that: (1) even though `foo = bar = baz 1` and `foo, bar = baz 1` is accepted, (2) `foo, bar = baz = fuzz 1` is rejected. To implement this behavior, this introduces a new binding power `PM_BINDING_POWER_MULTI_ASSIGNMENT` and uses it for distinguish which single assignments or multi assignments at their RHS. https://github.com/ruby/prism/commit/d4dd49ca81
2023-12-01[ruby/prism] Fix parsing heredoc endsHaldun Bayhantopcu
https://github.com/ruby/prism/commit/aa8c702271
2023-12-01[ruby/prism] Fix comments after HEREDOCs again.Martin Emde
The problem was deeper than just looking back a single token. You can push the heredoc_end token way back into the list. We need to save the last location of a heredoc end to see if it's the last token in the file. Fixes https://github.com/ruby/prism/pull/1954 https://github.com/ruby/prism/commit/91dfd4eecd
2023-11-30[ruby/prism] Fix lex_compat for `<<HEREDOC # comment` at EOFMartin Emde
Fixes https://github.com/ruby/prism/pull/1874 https://github.com/ruby/prism/commit/304dd78dd2
2023-11-29[ruby/prism] Reject class/module defs in method params/rescue/ensure/elseTSUYUSATO Kitsune
Fix https://github.com/ruby/prism/pull/1936 https://github.com/ruby/prism/commit/232e77a003
2023-11-28[ruby/prism] Reset `current_param_name` around closed scopesTSUYUSATO Kitsune
It is for supporting `def foo(bar = (def baz(bar) = bar; 1)) = 2` case. https://github.com/ruby/prism/commit/c789a833c5
2023-11-28[ruby/prism] Fix to parse `*` as forwarding in `foo[*]` caseTSUYUSATO Kitsune
Fix https://github.com/ruby/prism/pull/1924 https://github.com/ruby/prism/commit/7cde900065
2023-11-27[ruby/prism] Fix and reuse pm_call_node_index_pTSUYUSATO Kitsune
Fix https://github.com/ruby/prism/pull/1925 Fix https://github.com/ruby/prism/pull/1927 Previously pm_call_node_index_p does not check about a block argument correctly and is not used in parse_write to check an index call node. This commit fixes these problems. https://github.com/ruby/prism/commit/92bab044ff
2023-11-23[ruby/prism] Fix LocalVariableTargetNode depth in patternsTSUYUSATO Kitsune
Fix https://github.com/ruby/prism/pull/1821 https://github.com/ruby/prism/commit/7d023a26b4
2023-11-22[ruby/prism] Fix associativity of binary range with begin-less rangeTSUYUSATO Kitsune
Fix https://github.com/ruby/prism/pull/1828 https://github.com/ruby/prism/commit/22c0640e48
2023-11-22[ruby/prism] Allow `&` forwarding in a method having `...` parameterTSUYUSATO Kitsune
Fix https://github.com/ruby/prism/pull/1839 https://github.com/ruby/prism/commit/5784ab749f
2023-11-21[ruby/prism] Fix lex_state_beg_pHaldun Bayhantopcu
(https://github.com/ruby/prism/pull/1591) https://github.com/ruby/prism/commit/46b8576dd0
2023-11-20[ruby/prism] Replace match write locals with match write targetsKevin Newton
https://github.com/ruby/prism/commit/eec1862967
2023-11-19[ruby/prism] Don't add an invalid identifier capture to localsHiroya Fujinami
(https://github.com/ruby/prism/pull/1836) * Don't add an invalid identifier capture to locals Fix https://github.com/ruby/prism/pull/1815 * Delay creating a MatchWriteNode https://github.com/ruby/prism/pull/1836#discussion_r1393716600 https://github.com/ruby/prism/commit/635f595a36
2023-11-16[ruby/prism] Fix calls with splat without parenthesisHaldun Bayhantopcu
https://github.com/ruby/prism/commit/d81a77e0e3
2023-11-16[ruby/prism] Add test cases for `in` in `case` conditionTSUYUSATO Kitsune
Fix https://github.com/ruby/prism/pull/1515 It is also fixed by #1807, so this adds only test cases. https://github.com/ruby/prism/commit/a0092f075e
2023-11-14[ruby/prism] fix: nested heredoc dedentation use-after-freeMike Dalessio
Because the lex mode may be freed when popped, we need to store off this value for dedentation. https://github.com/ruby/prism/commit/64007322f5 Co-authored-by: Kevin Newton <kddnewton@gmail.com>
2023-11-12[ruby/prism] Reject invalid rational literals like `1e1r` on lexingTSUYUSATO Kitsune
Fix https://github.com/ruby/prism/pull/1586 https://github.com/ruby/prism/commit/b3bde866f2
2023-11-11[ruby/prism] Introduce non-associativility to `in` and `=>`TSUYUSATO Kitsune
Fix https://github.com/ruby/prism/pull/1596 Fix https://github.com/ruby/prism/pull/1771 Close https://github.com/ruby/prism/pull/1773 https://github.com/ruby/prism/commit/a3413e5605
2023-11-09[ruby/prism] Reset do_loop_stack around a body of a endless method definitionTSUYUSATO Kitsune
Fix https://github.com/ruby/prism/pull/1772 https://github.com/ruby/prism/commit/cdf58e845e
2023-11-01[ruby/prism] Forward parameters into arraysKevin Newton
https://github.com/ruby/prism/commit/2a11bfee76
2023-10-27[ruby/prism] Use MatchWriteNode on split InterpolatedRENKevin Newton
https://github.com/ruby/prism/commit/ee54244800
2023-10-26[ruby/prism] Ensure no extra multi-target nodes are createdKevin Newton
https://github.com/ruby/prism/commit/ec31fd827f
2023-10-18[ruby/prism] Fix lex compat when dedent should be 0Kevin Newton
https://github.com/ruby/prism/commit/41c0e0e06e
2023-10-18[ruby/prism] Use the unescaped regexp to scan for capture groupsKevin Newton
https://github.com/ruby/prism/commit/555551e8f2
2023-10-18[ruby/prism] Index{Operator,And,Or}WriteNodeKevin Newton
Right now, our Call{Operator,And,Or}WriteNode nodes represent two different concepts: ```ruby foo.bar += 1 foo[bar] += 1 ``` These two statements are different in what they can support. The former can never have arguments (or an opening_loc or closing_loc). The former can also never have a block. Also, the former is a variable method name. The latter is always going to be []/[]=, it can have any number of arguments including blocks (`foo[&bar] ||= 1`), and will always have an opening_loc and closing_loc. Furthermore, these statements end of having to take different paths through the various compilers because with the latter you have to consider the arguments and the block, whereas the former can perform some additional peephole optimizations since there are fewer values on the stack. For these reasons, I'm introducing Index{Operator,And,Or}WriteNode. These nodes never have a read_name or write_name on them because they are always []/[]=. They also support blocks, which the previous write nodes didn't. As a benefit of introducing these nodes, I've removed the opening_loc, closing_loc, and arguments from the older write nodes because they will always be null. For the serialized format, both of these nodes end up being smaller, and for in-memory we're storing fewer things in general, so we have savings all around. I don't love that we are introducing another node that is a call node since we generally want consumers to only have to handle a single call, but these nodes are so specific that they would have to be handled separately anyway since in fact call 2 methods. https://github.com/ruby/prism/commit/70155db9cd
2023-10-17[ruby/prism] Fix up super with a blockargKevin Newton
https://github.com/ruby/prism/commit/0ea19ed823
2023-09-27Sync to prism rename commitsKevin Newton
2023-09-27Rename YARP filepaths to prism filepathsKevin Newton