Original issue: https://github.com/ruby/rdoc/issues/1128
The problem is caused by the `# :stopdoc:` directive in `bundled_gems.rb`,
which's scope covers the redefinition of `LoadError`.
Since the goal of `# :stopdoc:` is to hide the documentation of `Gem::BUNDLED_GEMS`,
we can use `# :nodoc:` on it instead.
(https://github.com/ruby/irb/pull/1046)
* Load history when starting a direct debug session
When starting a debug session directly with RUBY_DEBUG_IRB_CONSOLE=1 and
`require 'debug'; debugger`, IRB's history wasn't loaded. This commit ensures
history is loaded in this case by calling `load_history` when configuring IRB
for the debugger.
Fixesruby/irb#975
* Update test/irb/test_history.rb
* Update lib/irb/debug.rb
---------
7f851b5353
Co-authored-by: Stan Lo <stan001212@gmail.com>
(https://github.com/ruby/reline/pull/793)
* Undo and redo should restore indentation
Undo and redo should not perform auto indentation. It should not change the indentation. Instead, it should restore previous indentation.
* Rename ivar undoing(undoing or redoing) to restoring
6355a6e0b2
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 https://github.com/ruby/prism/pull/3291d4fc441838
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 <tenderlove@ruby-lang.org>
Co-authored-by: Matthew Draper <matthew@trebex.net>
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.
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]
e573ceaad6
Co-authored-by: John Hawthorn <jhawthorn@github.com>
Co-authored-by: eileencodes <eileencodes@gmail.com>
Co-authored-by: Kevin Newton <kddnewton@gmail.com>