summaryrefslogtreecommitdiff
path: root/test/prism
AgeCommit message (Collapse)Author
2024-01-25[PRISM] Fix VM_CALL_ARGS_SPLAT_MUT failuresKevin Newton
2024-01-25[ruby/prism] Fix Ruby head buildKevin Newton
https://github.com/ruby/prism/commit/149e2ff7f6
2024-01-24Do not use ruby2_keywords for ... argument forwardingJeremy Evans
This allows ... argument forwarding to benefit from Allocationless Anonymous Splat Forwarding, allowing the `f` call below to not allocate an array or a hash. ```ruby a = [1] kw = {b: 2} def c(a, b:) end def f(...) c(...) end f(*a, **kw) ``` This temporarily skips prism locals tests until prism is changed to use * and ** for ..., instead of using ruby2_keywords. Ignore failures in rbs bundled gems tests, since they fail due to this change.
2024-01-24[ruby/prism] Add missing snapshot for the new fileMax Prokopiev
https://github.com/ruby/prism/commit/459a9f544e
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-24[ruby/prism] Add an implicit node for the target of a hash patternKevin Newton
This simplifies compiling it, since you can now compile the value as if it were always there. https://github.com/ruby/prism/commit/bcfc74aacb
2024-01-22[ruby/prism] Reference prism after requireKevin Newton
https://github.com/ruby/prism/commit/0a8ff431df
2024-01-22[ruby/prism] Return 1-indexed line numbersKevin Newton
https://github.com/ruby/prism/commit/ad17f58729
2024-01-22[ruby/prism] Unescape method name for unary methods.Matt Valentine-House
https://github.com/ruby/prism/commit/4386a4c0da
2024-01-19[ruby/prism] Handle stovetop start in constant path fullnameAdam Hess
https://github.com/ruby/prism/commit/3a216e63fe
2024-01-17[ruby/prism] Test version: 3.3.0Takashi Kokubun
https://github.com/ruby/prism/commit/94ecb366c4
2024-01-17[ruby/prism] Fix => ^itTakashi Kokubun
https://github.com/ruby/prism/commit/24a2872b4e
2024-01-17[ruby/prism] Parse `it` default parameterTakashi Kokubun
https://github.com/ruby/prism/commit/a0c5361b9f
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-11[ruby/prism] Exclude encodings that are dynamicKevin Newton
https://github.com/ruby/prism/commit/6749146c0e
2024-01-10[ruby/prism] Unary symbols that cannot be binary should drop @Kevin Newton
https://github.com/ruby/prism/commit/d139af033f
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-08[ruby/prism] Handle parsing a line break in a receiver of a methodKevin Newton
https://github.com/ruby/prism/commit/4d5f43ecbc
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
2024-01-03[ruby/prism] Fix rational when parsing non decimal integerKevin Newton
https://github.com/ruby/prism/commit/75d4331f7f
2024-01-03[ruby/prism] Better error recovery for content after unterminated heredocKevin Newton
https://github.com/ruby/prism/commit/c2d325a886
2024-01-02[ruby/prism] Ignore visibility flagKevin Newton
https://github.com/ruby/prism/commit/55b049ddac
2024-01-02[ruby/prism] Fix to check multiple block arguments for forwarding argTSUYUSATO Kitsune
Fix https://github.com/ruby/prism/pull/2111 https://github.com/ruby/prism/commit/21ca243d0a
2024-01-02[ruby/prism] IndexTargetNode should always have ATTRIBUTE_WRITEKevin Newton
Because this is a user-facing change, we also need to deal with the fact that CRuby 3.3.0 was just released. In order to support workflows that want to parse exactly as CRuby parses in a specific version, this PR introduces a new option to the options struct that is "version". This allows you to specify that you want "3.3.0" parsing. I'm not sure if this is the correct solution. Another solution is to just fork and keep around the old branch for security patches. Or we could keep around a copy of the source files within this repository as another directory and only update when necessary. There are a lot of potential solutions here. Because this change is so small and the check for it is so minimal, I've decided to go with this enum. If this ends up entirely cluttering the codebase with version checks, we'll come up with another solution. But for now this works, so we're going to go in this direction for a bit until we determine it's no longer working. https://github.com/ruby/prism/commit/d8c7e6bd10
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] String literal hash keys should be frozeneileencodes
String literal hash keys can't be mutated by the user so we should mark them as frozen. We were seeing instructions for hashes with string literal keys using two `putstring` instructions when it should be a `putobject` and `putstring`. Code example: ```ruby { "a" => "b" } ``` Instructions before: ``` "********* Ruby *************" == disasm: #<ISeq:<compiled>@<compiled>:1 (1,0)-(2,14)> 0000 putobject "a" ( 2)[Li] 0002 putstring "b" 0004 newhash 2 0006 leave "********* PRISM *************" == disasm: #<ISeq:<compiled>@<compiled>:1 (1,0)-(1,14)> 0000 putstring "a" ( 1)[Li] 0002 putstring "b" 0004 newhash 2 0006 leave ``` Instructions after: ``` "********* Ruby *************" == disasm: #<ISeq:<compiled>@<compiled>:1 (1,0)-(2,14)> 0000 putobject "a" ( 2)[Li] 0002 putstring "b" 0004 newhash 2 0006 leave "********* PRISM *************" == disasm: #<ISeq:<compiled>@<compiled>:1 (1,0)-(1,14)> 0000 putobject "a" ( 1)[Li] 0002 putstring "b" 0004 newhash 2 0006 leave ``` https://github.com/ruby/prism/commit/b14ae55385
2023-12-15[ruby/prism] Finish keyword hash node flag refactor by renaming flagUfuk Kayserilioglu
https://github.com/ruby/prism/commit/7f812389f8
2023-12-15[ruby/prism] Fix eval parsing depthKevin Newton
https://github.com/ruby/prism/commit/89bf7a4948
2023-12-15[ruby/prism] Invalid pinned locals in pattern matchingKevin Newton
https://github.com/ruby/prism/commit/3a67b37a56
2023-12-15[ruby/prism] Add an error for `in` keyword in argumentsTSUYUSATO Kitsune
Fix https://github.com/ruby/prism/pull/2026 https://github.com/ruby/prism/commit/c4b41cd477
2023-12-14[ruby/prism] Fix parse result for nesting pattern matchingKevin Newton
https://github.com/ruby/prism/commit/ee6fc9ee87
2023-12-14[ruby/prism] Fix the implementation of the flag on keyword hash nodesUfuk Kayserilioglu
The previous implementation was incorrect since it was just checking for all keys in assoc nodes to be static literals but the actual check is that all keys in assoc nodes must be symbol nodes. This commit fixes that implementation, and, also, aliases the flag to `PM_KEYWORD_HASH_NODE_FLAGS_SYMBOL_KEYS` so that ruby/ruby can start using the new flag name. I intend to later change the real flag name to `PM_KEYWORD_HASH_NODE_FLAGS_SYMBOL_KEYS` and remove the alias. https://github.com/ruby/prism/commit/f5099c79ce
2023-12-14[ruby/prism] Make equality operators non-associativeTSUYUSATO Kitsune
Fix https://github.com/ruby/prism/pull/2073 https://github.com/ruby/prism/commit/0f747d9240
2023-12-14[ruby/prism] Fix hash pattern restKevin Newton
https://github.com/ruby/prism/commit/43c4232cfc
2023-12-12[ruby/prism] Flag for attribute write on callsKevin Newton
https://github.com/ruby/prism/commit/465731969c
2023-12-12[ruby/prism] Update tests and snapshotsUfuk Kayserilioglu
https://github.com/ruby/prism/commit/0663e2bcfa
2023-12-11[ruby/prism] Regexp terminator escapesKevin Newton
https://github.com/ruby/prism/commit/42a48a2ba9
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] Split up CallNode in target positionKevin Newton
In this commit we're splitting up the call nodes that were in target positions (that is, for loop indices, rescue error captures, and multi assign targets). Previously, we would simply leave the call nodes in place. This had the benefit of keeping the AST relatively simple, but had the downside of not being very explicit. If a static analysis tool wanted to only look at call nodes, it could easily be confused because the method would have 1 fewer argument than it would actually be called with. This also brings some consistency to the AST. All of the nodes in a target position are now *TargetNode nodes. These should all be treated the same, and the call nodes can now be treated the same. Finally, there is benefit to memory. Because being in a target position ensures we don't have some fields, we can strip down the number of fields on these nodes. So this commit introduces two new nodes: CallTargetNode and IndexTargetNode. For CallTargetNode we get to drop the opening_loc, closing_loc, arguments, and block. Those can never be present. We also get to mark their fields as non-null, so they will always be seen as present. The IndexTargetNode keeps around most of its fields but gets to drop both the name (because it will always be []=) and the message_loc (which was always super confusing because it included the arguments by virtue of being inside the []). Overall, this adds complexity to the AST at the expense of memory savings and explicitness. I believe this tradeoff is worth it in this case, especially because these are very much not common nodes in the first place. https://github.com/ruby/prism/commit/3ef71cdb45
2023-12-11[ruby/prism] Fix parsing unterminated empty string `"`TSUYUSATO Kitsune
Fix https://github.com/ruby/prism/pull/2034 https://github.com/ruby/prism/commit/8280e577fa
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-10[ruby/prism] fix: escape newlineAlex Koval
https://github.com/ruby/prism/commit/a28b427dcc
2023-12-08[ruby/prism] Add necessary encoding flags for symbols and regexKevin Newton
This doesn't actually fix the encodings for symbols and regex, unfortunately. But I wanted to get this change in because it is the last AST change we're going to make before 3.3 is released. So, if consumers want, they can start to check these flags to determine the encoding, even though it will be wrong. Then once we actually set them correctly, everything should work. https://github.com/ruby/prism/commit/9b35f7e891
2023-12-08[ruby/prism] More closely match CRuby error messagesKevin Newton
https://github.com/ruby/prism/commit/1ed07a0c6d
2023-12-07[ruby/prism] Update ordering of integer base flagsKevin Newton
https://github.com/ruby/prism/commit/d711950d5f
2023-12-07[ruby/prism] Remove warnings check from parse_success? methodKevin Newton
https://github.com/ruby/prism/commit/e30a241fb3