Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] master from ruby:master #456

Merged
merged 10 commits into from
Dec 12, 2024
Merged

[pull] master from ruby:master #456

merged 10 commits into from
Dec 12, 2024

Conversation

pull[bot]
Copy link

@pull pull bot commented Dec 12, 2024

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.1)

Can you help keep this open source service alive? 💖 Please sponsor : )

XrXr and others added 10 commits December 11, 2024 17:44
```
warning: fields `blue_begin` and `blue_end` are never read
```
parse.y treats CRLF as a LF and basically "normalizes" them before
parsing.  That means a string like `%\nfoo\r\n` is actually treated as
`%\nfoo\n` for the purposes of parsing.  This happens on both the
opening side of the percent string as well as on the closing side.  So
for example `%\r\nfoo\n` must be treated as `%\nfoo\n`.

To handle this in Prism, when we start a % string, we check if it starts
with `\r\n`, and then consider the terminator to actually be `\n`.  Then
we check if there are `\r\n` as we lex the string and treat those as
`\n`, but only in the case the start was a `\n`.

Fixes: #3230

[Bug #20938]

ruby/prism@e573ceaad6

Co-authored-by: John Hawthorn <[email protected]>
Co-authored-by: eileencodes <[email protected]>
Co-authored-by: Kevin Newton <[email protected]>
Any memory allocated with xmalloc needs to be matched with xfree rather
than plain free.

Ruby unfortunately redefines strdup to be ruby_strdup, which uses
xmalloc so needs to be xfreed. Previously these were mismatched.

This commit changes the copy to be an explicit ruby_strdup (to avoid
confusion) and the free to be xfree.
Prism will later free this string via free rather than xfree, so we need
to use malloc rather than xmalloc.

Co-authored-by: Aaron Patterson <[email protected]>
Co-authored-by: Matthew Draper <[email protected]>
Raise an exception when the same numbered param is used inside a child
block.  For example, the following code should be a syntax error:

```ruby
-> { _1 + -> { _1 } }
```

Fixes ruby/prism#3291

ruby/prism@d4fc441838
%r regular expressions need to be decoded like strings.  This commit
fixes %r decoding so it works like strings.

ruby/prism@85bfd9c0cd
Previously compilation failed with -DMALLOC_ALLOCATED_SIZE=1

Co-authored-by: Matthew Draper <[email protected]>
@pull pull bot added the ⤵️ pull label Dec 12, 2024
@pull pull bot merged commit 29caae9 into wapm-packages:master Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants