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
```
b6554ad64e
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)
561914f99b
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.
6bba1c54e1
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.
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.
a651126458
(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.
8b1a07b2a8
(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
9fc14eb74b
code
(https://github.com/ruby/reline/pull/800)
* Remove invalid encoding string "\M-[char]" from test code, remove unused code/arg/options
* Omit unicode unnoralized input test in non-utf8 testcase
* Remove helper method and constant no longer used in testcode
* Change key binding test to use realistic bytes instead of invalid byte sequence
* Remove invalid byte sequence input from rendering test
yamatanooroti handles invalid byte sequence input "\M-[char]" and converts it to "\e[char]"
We don't need to use these invalid byte sequence and rely on the hack implemented in yamatanooroti
f09e7b154c
(https://github.com/ruby/rdoc/pull/1267)
RDoc::Parser::PrismRuby wrongly resolves superclass of `class Cipher < Cipher; end` that exist in openssl.
Superclass resolve should be done before adding class.
57a4615a92
cross-references
(https://github.com/ruby/rdoc/pull/1259)
This config will be handy when the project name is the same as a class or
module name, which is often the case for most of the projects.
ce77f51f63
(https://github.com/ruby/irb/pull/1057)
Local variable `grep` was always nil because the regular expression parsing options contained an unnecessary `\n`. `test_history_grep` did not detect this because it only asserted what was included in the output.
a282bbc0cf
(https://github.com/ruby/irb/pull/1055)
* Use the documentation site as the source of truth
1. Remove detailed content from README.md and point links to the documentation site.
2. Remove the content of EXTEND_IRB.md and point links to the documentation site.
* Use GitHub pages as Rubygems' documentation target
d2b73cb91e
(https://github.com/ruby/erb/pull/56)
* ERB#result: Dropped mention of deprecated safe_level since it is no longer documented.
* Fixed grammar for chicken fried steak :P
4efd3437ac