8000 [pull] master from whitequark:master by pull[bot] · Pull Request #2 · majacQ/parser · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[pull] master from whitequark:master #2

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

Open
wants to merge 1,179 commits into
base: 2.0
Choose a base branch
from
Open

Conversation

pull[bot]
Copy link
@pull pull bot commented May 2, 2021

See Commits and Changes for more details.


Created by pull[bot]

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

@pull pull bot added the ⤵️ pull label May 2, 2021
@atomist atomist bot added auto-branch-delete:on-close Delete branch when pull request gets closed auto-merge-method:merge Auto-merge with merge commit auto-merge:on-bpr-success Auto-merge on passed branch protection rule labels May 2, 2021
@pull pull bot added merge-conflict Resolve conflicts manually and removed auto-branch-delete:on-close Delete branch when pull request gets closed auto-merge-method:merge Auto-merge with merge commit auto-merge:on-bpr-success Auto-merge on passed branch protection rule labels Jul 8, 2021
koic and others added 22 commits July 16, 2021 11:35
…l variables (#813)

Closes #812.

This commit tracks upstream commit ruby/ruby@fa87f72.
Firstly, this fixes an issue with non-interpolating squiggly heredocs, where line continuation characters should be ignored. Two things were broken:

- The line continuation backslash would be removed, as well as the subsequent carriage return
- The subsequent line would not be dedented.

For example, the following source:

```ruby
<<~'END'
  foo \
  bar
END
```

Would be parsed as follows:

```
(dstr
  (str "foo ")
  (str "  bar\n"))
```

With the change, the result is:

```
(dstr
  (str "foo \\\n")
  (str "bar\n"))
```

This also fixes an issue with interpolating squiggly heredocs, where an escaped backslash followed by a newline would be interpreted as a line continuation. This is issue #789.

In that case, the following source:

```ruby
<<~END
  foo \\
  bar
END
```

Would (again) be parsed as follows:

```
(dstr
  (str "foo ")
  (str "  bar\n"))
```

With the change, the result is:

```
(dstr
  (str "foo \\\n")
  (str "bar\n"))
```
This fixes an issue where beginless ranges at the start of a line would be interpreted as continuing an expression starting on the previous line. Unlike leading dots for method calls, `..` and `...` at the start of a line do not continue an expression from the previous line.
Co-authored-by: Jean Boussier <jean.boussier@gmail.com>
iliabylich and others added 30 commits February 5, 2025 08:38
…constants (#1064)

A constant always start in uppercase but a local will not always
start with lowercase. `_foo` and `💎` are both valid local variables.
It's a bit awkward: rubocop and rubocop-ast use this list to generate visitors and node type predicates.
Since they both use this, it doesn't make much sense to add this handling in rubocop I think.

On the other hand, adding this to prism doesn't really work since the parser
there is lazily loaded, and by rubocop as well since users may just use older ruby versions.
Prism itself has no dependecy on parser to eagerly add to this list.

I think adding this to parser is ok, and is also the simplest solution to the problem.
The list can (and does) contain entries that are parser-version specific, this just
extends that policy a bit farther than it used to be.
Follow-up to rubocop/rubocop-ast#365 (comment)

"implicit `it` parameter" doesn't seem to be a commonly used term. Use "`it` block parameter" instead.
These Rubies have been released.

- https://www.ruby-lang.org/en/news/2025/03/26/ruby-3-2-8-released/
- https://www.ruby-lang.org/en/news/2025/03/26/ruby-3-1-7-released/

## Ruby 3.2 branch

Bump 3.2 branch from 3.2.7 to 3.2.8

ruby/ruby@v3_2_7...v3_2_8

There seems to be no change to syntax.

## Ruby 3.1 branch

Bump 3.1 branch from 3.1.6 to 3.1.7

ruby/ruby@v3_1_6...v3_1_7

There seems to be no change to syntax.
The following is how different versions behave:
```
# Valid only in 2.7
case 0; in _1; end
1.then { 1 in _1 }

# Valid in no versions
case 0; in ^_1; end

# Valid an all versions
1.then { 1 in ^_1 }
```

`@builder.accessible` makes the numparam visible to the environment,
so it must be called first
* Supress warnings during regexp creation

User input can contain arbitrary regexes.
Something like `Parser::CurrentRuby.parse("/[\177\01\1778]/")` shows a warning:
> character class has duplicated range: /[\x7f\x01\x7f8]/

* Don't emit warnings when parsing floats

`Parser::CurrentRuby.parse("9.99
8000
99e999")`
> Float 9.9999e999 out of range
…t block (#1049)

Upstream commit ruby/ruby@a850cd1 is specific to 3.3,
previous versions already did not allow this.
See https://bugs.ruby-lang.org/issues/20392 for a bit more info.

But since the super node has has a different shape, it behaved unexpectedly in earlier ruby versions already.

It allowed forwarding with zero and one arguments and failed for more. Now correctly rejects it as invalid syntax, except in Ruby 3.3, that fix has not been backported.
…nts (#1051)

Starting from Ruby 2.4, these are a syntax error.
I don't see an easy way of representing such strings.
Right now the parser actually crashses (in all versions) so I'd say it's an improvement.
Compatible with Ruby up to 3.3. But compatibility with Ruby 3.4 is not yet available.
* * YARD docs for Parser::CurrentRuby

* Document the transtion for users seeking Ruby 3.4 support
* Allow IDE tools like Solargraph to understand the invocation and
  results from Parser::Current.parse() to provide auto-completion and
  type checking

* * Add type info for Parser::Base#version
Ruby 3.3.8 has been released:
https://www.ruby-lang.org/en/news/2025/04/09/ruby-3-3-8-released/

Bump 3.3 branch from 3.3.7 to 3.3.8

ruby/ruby@v3_3_7...v3_3_8

There seems to be no change to syntax.
The compatible version for Ruby 3.3.8 is Parser 3.3.8.x.
Parser 3.3.7.5 was mistakenly relea
83B6
sed and has been yanked, then re-released as 3.3.8.0.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⤵️ pull merge-conflict Resolve conflicts manually
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0