Attribute readers and writers can be marked as `:nodoc` to keep them
undocumented:
```ruby
attr_reader :name # :nodoc:
```
For aliases this behaviour should be the same:
```ruby
alias_method :old :new # :nodoc:
```
30f14e8271
* add bin/prism ripper to compare Ripper output
* block arg handling is quirky, do it per-call-site
* block required params
* boolean values
* various assign-operator support
* breaks, early fragile begin/rescue/end
* more fixtures being checked
31732cb720
[Bug #20245]
We sometimes pass in a fake string to sym_check_asciionly. This can crash
if sym_check_asciionly raises because it creates a CFP with the fake
string as the receiver which will crash if GC tries to mark the CFP.
For example, the following script crashes:
GC.stress = true
Object.const_defined?("\xC3")
(https://github.com/ruby/irb/pull/864)
* Remove useless ivar
* Simplify tracer test setup
* Treat tracer like a normal development dependency
* Only require ext/tracer when value is truthy
* Make tracer integration skip IRB traces
a97a4129a7
This PR implements proper file parsing error handling. Previously
`file_options` would call `pm_string_mapped_init` which would print an
error from `perror`. However this wouldn't raise a proper Ruby error so
it was just a string output. I've done the following:
- Raise an error from `rb_syserr_fail` with the filepath in
`file_options`.
- No longer return `Qnil` if `file_options` returns false (because now
it will raise)
- Update `file_options` to return `static void` instead of `static
bool`.
- Update `file_options` and `profile_file` to check the type so when
passing `nil` we see a `TypeError`.
- Delete `perror` from `pm_string_mapped_init`
- Update `FFI` backend to raise appropriate errors when calling
`pm_string_mapped_init`.
- Add tests for `dump_file`, `lex_file`, `parse_file`,
`parse_file_comments`, `parse_lex_file`, and `parse_file_success?`
when a file doesn't exist and for `nil`.
- Updates the `bin/parse` script to no longer raise it's own
`ArgumentError` now that we raise a proper error.
Fixes: ruby/prism#2207b2f7494ff5
(https://github.com/ruby/irb/pull/857)
The new tests are skipped when ruby below 3.1, as it was a default gem on it, and in a version we do not support.
This also move definition of `use_tracer` to module Context instead of monkey patch.
08834fbd5f
Previously, the local index of numbered parameters were assigned to
names of regular locals, making it hard to read both of them. Use proper
`_[1-9]` numbered parameters. This fixes `test_shapes.rb`.
Also, properly mark the iseq as having lead parameters.
(https://github.com/ruby/irb/pull/852)
* Add a warning for when the history path doesn't exist
* warn when the directory does not exist
* added test for when the history_file does not exist
* Update lib/irb/history.rb
---------
9e6fa67212
Co-authored-by: Stan Lo <stan001212@gmail.com>
to avoid accidentally mutating the original's state when doing:
```ruby
spec2 = spec.dup
spec2.required_rubygems_version.concat([">= 3.3.22"])
```
see https://github.com/rake-compiler/rake-compiler/pull/236 for a
real-world use case that would be made simpler with this behavior.
c1d52389f0
to avoid accidentally mutating the original's state when doing:
```ruby
req2 = req.dup
req2.concat([">= 3.3.22"])
```
see https://github.com/rake-compiler/rake-compiler/pull/236 for a
real-world use case that would be made simpler with this behavior.
8e0c03144e
We're not using this anymore, and it doesn't make a lot of sense
outside the context of a compiler anyway, and in anyway it's wrong
when you have local variables written in default values.
5edbd9c25b