Age | Commit message (Collapse) | Author |
|
https://github.com/ruby/erb/commit/348777b5bf
|
|
Turns out, it was already almost correct. If you disregard \c and \M style escapes, only a single character is allowed to be escaped in a regex so most tests passed already.
There was also a mistake where the wrong value was constructed for the ast, this is now fixed.
One test fails because of this, but I'm fairly sure it is because of a parser bug. For `/\“/`, the backslash is supposed to be removed because it is a multibyte character. But tbh,
I don't entirely understand all the rules.
Fixes more than half of the remaining ast differences for rubocop tests
|
|
When parent scopes around an eval are forwarding parameters (like
*, **, &, or ...) we need to know that information when we are in
the parser. As such, we need to support passing that information
into the scopes option. In order to do this, unfortunately we need
a bunch of changes.
The scopes option was previously an array of array of strings.
These corresponded to the names of the locals in the parent scopes.
We still support this, but now additionally support passing in a
Prism::Scope instance at each index in the array. This Prism::Scope
class holds both the names of the locals as well as an array of
forwarding parameter names (symbols corresponding to the forwarding
parameters). There is convenience function on the Prism module that
creates a Prism::Scope object using Prism.scope.
In JavaScript, we now additionally support an object much the same
as the Ruby side. In Java, we now have a ParsingOptions.Scope class
that holds that information. In the dump APIs, these objects in all
3 languages will add an additional byte for the forwarding flags in
the middle of the scopes serialization.
All of this is in service of properly parsing the following code:
```ruby
def foo(*) = eval("bar(*)")
```
https://github.com/ruby/prism/commit/21abb6b7c4
|
|
https://github.com/ruby/prism/commit/7a93a307ac
|
|
https://github.com/ruby/prism/commit/8ab2532f09
|
|
To make it so that you can pass `freeze: true` to Prism parse
methods and get back a deeply-frozen AST that is Ractor-
shareable.
https://github.com/ruby/prism/commit/8e6a93b2d2
|
|
Describe two features that were missing from the documentation:
- yields configuration part if a block is given.
- "depend" file will be included.
Notes:
Merged: https://github.com/ruby/ruby/pull/12571
|
|
We switched to nronn because ronn-ng felt abandoned, but it seems
it has activity again, so switch back.
Notes:
Merged: https://github.com/ruby/ruby/pull/12568
|
|
lockfile unless necessary
Even if they don't match the current Ruby version, they could still work
in other rubies. So it's better to keep them.
https://github.com/rubygems/rubygems/commit/9a3e583b0c
Notes:
Merged: https://github.com/ruby/ruby/pull/12568
|
|
Just for consistency, since all the other methods in this class that
receive an array of dependencies use `deps`.
https://github.com/rubygems/rubygems/commit/eca1341950
Notes:
Merged: https://github.com/ruby/ruby/pull/12568
|
|
https://github.com/rubygems/rubygems/commit/a76fd6d3bf
Notes:
Merged: https://github.com/ruby/ruby/pull/12568
|
|
https://github.com/rubygems/rubygems/commit/8727d44024
Notes:
Merged: https://github.com/ruby/ruby/pull/12568
|
|
directory on ruby 3.4
https://github.com/rubygems/rubygems/commit/027cdc750a
Notes:
Merged: https://github.com/ruby/ruby/pull/12568
|
|
https://github.com/rubygems/rubygems/commit/3ca7ef214c
Notes:
Merged: https://github.com/ruby/ruby/pull/12568
|
|
It falsely considered it to be a single backtick command
https://github.com/ruby/prism/commit/dd762be590
|
|
```rb
<<~F
foo
#{}
bar
F
```
has zero common whitespace.
https://github.com/ruby/prism/commit/1f3c222a06
|
|
Tests worked around this but the incompatibility is not hard to fix.
This fixes 17 token incompatibilies in tests here that were previously passing
https://github.com/ruby/prism/commit/101962526d
|
|
https://github.com/ruby/prism/commit/8d9d429155
|
|
multiline bytes
A rather silly issue with a rather simple fix.
The ranges already use the offset cache, this effectivly double-encoded them.
https://github.com/ruby/prism/commit/66b65634c0
|
|
In https://github.com/ruby/prism/pull/3393 I made a mistake.
When there is no previous token, it wraps around to -1. Oops
Additionally, if a comment has no newline then the offset should be kept as is
https://github.com/ruby/prism/commit/3c266f1de4
|
|
(https://github.com/ruby/irb/pull/1064)
This makes them easier to find and matches the convention of the codebase.
https://github.com/ruby/irb/commit/ce8fa6857c
|
|
(https://github.com/ruby/irb/pull/1051)
`pp` 0.6.0+ includes https://github.com/ruby/pp/pull/26 to handle BasicObject,
so we can drop the workaround.
https://github.com/ruby/irb/commit/08908d43c7
|
|
Skipping detecting the encoding is almost always right, just for binary it should actually happen.
A symbol containing escapes that are invalid
in utf-8 would fail to parse since symbols must be valid in the script encoding.
Additionally, the parser gem would raise an exception somewhere during string handling
https://github.com/ruby/prism/commit/fa0154d9e4
|
|
There appear to be a bunch of rules, changing behaviour for
inline comments, multiple comments after another, etc.
This seems to line up with reality pretty closely, token differences for RuboCop tests go from 1129 to 619 which seems pretty impressive
https://github.com/ruby/prism/commit/2e1b92670c
|
|
`not foo` should be `!foo`
`not()` should be `!nil`
Fixes [Bug #21027]
https://github.com/ruby/prism/commit/871ed4b462
|
|
strings and word arrays
These are not line continuations. They either should be taken literally,
or allow the word array to contain the following whitespace (newlines in this case)
Before:
```
0...1: tSTRING_BEG => "'"
1...12: tSTRING_CONTENT => "foobar\\\n"
12...16: tSTRING_CONTENT => "baz\n"
16...17: tSTRING_END => "'"
17...18: tNL => nil
```
After:
```
0...1: tSTRING_BEG => "'"
1...6: tSTRING_CONTENT => "foo\\\n"
6...12: tSTRING_CONTENT => "bar\\\n"
12...16: tSTRING_CONTENT => "baz\n"
16...17: tSTRING_END => "'"
17...18: tNL => nil
```
https://github.com/ruby/prism/commit/b6554ad64e
|
|
This leaves `\c` and `\M` escaping but I don't understand how these should even work yet. Maybe later.
https://github.com/ruby/prism/commit/13db3e8cb9
|
|
translator
This is a followup to #3373, where the implementation
was extracted
https://github.com/ruby/prism/commit/2637007929
|
|
translator
Much of this logic should be shared between interpolated symbols and regexps.
It's also incorrect when the node contains a literal `\\n` (same as for plain string nodes at the moment)
https://github.com/ruby/prism/commit/561914f99b
|
|
In that specific case, no string node is emitted
https://github.com/ruby/prism/commit/1166db13dd
|
|
Turns out, the vast majority of work was already done with handling the same for heredocs
I'm confident this should also apply to actual string nodes (there's even a todo for it) but
no tests change if I apply it there too, so I can't say for sure if the logic would be correct.
The individual test files are a bit too large, maybe something else would break that currently passes.
Leaving it for later to look more closely into that.
https://github.com/ruby/prism/commit/6bba1c54e1
|
|
blocks/lambda
Blocks and lambdas inherit anonymous arguments from the method they are a part of.
They themselves don't allow to introduce new anonymous arguments.
While you can write this:
```rb
def foo(*)
bar { |**| }
end
```
referecing the new parameter inside of the block will always be a syntax error.
https://github.com/ruby/prism/commit/2cbd27e134
|
|
The offset cache contains an entry for each byte so it can't be accessed via the string length.
Adds tests for all variants except for this:
```
"fo
o" "ba
’"
```
For some reason, this still has the wrong offset.
https://github.com/ruby/prism/commit/a651126458
|
|
https://github.com/ruby/prism/commit/a679ee0e5c
|
|
https://github.com/ruby/prism/commit/6b6aa05bfb
|
|
(https://github.com/ruby/irb/pull/1062)
Although not documented, `IRB.conf[:SAVE_HISTORY]` used to accept boolean,
which now causes `NoMethodError` when used.
This commit changes the behavior to accept boolean values and
adds tests for the behavior.
https://github.com/ruby/irb/commit/8b1a07b2a8
|
|
an IRB issue
(https://github.com/ruby/irb/pull/1061)
https://github.com/ruby/irb/commit/4d74d39261
|
|
(https://github.com/ruby/irb/pull/1059)
* Gracefully handle incorrect command aliases
Even if the aliased target is a helper method or does not exist, IRB
should not crash.
This commit warns users in such cases and treat the input as normal expression.
* Streamline command parsing and introduce warnings for incorrect command aliases
https://github.com/ruby/irb/commit/9fc14eb74b
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/12537
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/12537
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/12537
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/12537
|
|
There are 3 possible locations:
- $HOME/.gem/credentials
- $XDG_DATA_HOME/gem/credentials
- $HOME/.local/share/gem/credentials
https://github.com/rubygems/rubygems/commit/c51756b96e
|
|
RDoc::RDoc#parse_files
(https://github.com/ruby/rdoc/pull/1274)
Commit https://github.com/ruby/rdoc/commit/6cf6e1647b97, which went to v6.5.0, changed `RDoc::Options#parse`
to not call `#finish` in it. While the commit adjusted other call sites,
it missed `lib/rdoc/rubygems_hook.rb`.
`RDoc::Options#finish` prepares the include paths for `:include:`
directives. This has to be done before starting to parse sources.
I think this should fix https://github.com/ruby/net-http/issues/193 +
https://github.com/ruby/net-http/pull/194.
https://github.com/ruby/rdoc/commit/d62da8ca09
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/12531
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/12529
|
|
(https://github.com/ruby/reline/pull/803)
https://github.com/ruby/reline/commit/24e6128676
|
|
(https://github.com/ruby/rdoc/pull/1270)
This PR fixes https://github.com/ruby/rdoc/pull/1269.
## Expected Behavior
`gem server` command is successful.
```console
$ gem server
Server started at http://[::]:8808
Server started at http://0.0.0.0:8808
```
http://127.0.0.1:8808/ works.
## Actual Behavior
`gem server` command doesn't work because `Gem::RDoc.load_rdoc` raises
`NoMethodError`.
```console
$ gem server
ERROR: While executing gem ... (NoMethodError)
undefined method 'load_rdoc' for class RDoc::RubygemsHook
Gem::RDoc.load_rdoc
^^^^^^^^^^
/Users/mterada/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/rubygems-server-0.3.0/lib/rubygems/server.rb:437:in 'Gem::Server#initialize'
/Users/mterada/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/rubygems-server-0.3.0/lib/rubygems/server.rb:426:in 'Class#new'
/Users/mterada/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/rubygems-server-0.3.0/lib/rubygems/server.rb:426:in 'Gem::Server.run'
/Users/mterada/.rbenv/versions/3.4.1/lib/ruby/gems/3.4.0/gems/rubygems-server-0.3.0/lib/rubygems/commands/server_command.rb:83:in 'Gem::Commands::ServerCommand#execute'
/Users/mterada/.rbenv/versions/3.4.1/lib/ruby/3.4.0/rubygems/command.rb:326:in 'Gem::Command#invoke_with_build_args'
/Users/mterada/.rbenv/versions/3.4.1/lib/ruby/3.4.0/rubygems/command_manager.rb:253:in 'Gem::CommandManager#invoke_command'
/Users/mterada/.rbenv/versions/3.4.1/lib/ruby/3.4.0/rubygems/command_manager.rb:194:in 'Gem::CommandManager#process_args'
/Users/mterada/.rbenv/versions/3.4.1/lib/ruby/3.4.0/rubygems/command_manager.rb:152:in 'Gem::CommandManager#run'
/Users/mterada/.rbenv/versions/3.4.1/lib/ruby/3.4.0/rubygems/gem_runner.rb:57:in 'Gem::GemRunner#run'
/Users/mterada/.rbenv/versions/3.4.1/bin/gem:12:in '<main>'
```
## Versions
```console
$ rdoc -v
6.10.0
```
---------
https://github.com/ruby/rdoc/commit/b6a82244a2
Co-authored-by: Sutou Kouhei <[email protected]>
|
|
(https://github.com/ruby/reline/pull/802)
* Enter newline if cursor position is middle of input
* Add ed_force_submit to allow input confirmation on non-final lines
https://github.com/ruby/reline/commit/8ef534e904
|
|
https://github.com/rubygems/rubygems/commit/42aaaff15c
|