This simplifies how we handle multi-targets, and also fixes a bug we
had where for loops were always getting multi-targets, even when there
was only a single target.
31eb8b7ad5
This rarely used node holds information about the local variables
that need to get written in the case a regular expression is used on
the left-hand side of a =~ operator and it has named capture groups.
Note that we already "handled" these nodes by adding locals to the
AST, but we didn't actually expose this information, making it
difficult to compile.
The general idea behind this node is that it maintains the ability
for consumers to find all of the call nodes in the tree easily so
it's not flattening down. However, it should be okay because you
hopefully don't need any information in the call node to determine
what to compile because the locals list is on the top level.
e136e7f9a8
* Fix `io_buffer_get_string` default length computation.
When an offset bigger than the size is given, the resulting length will be
computed incorrectly. Raise an argument error in this case.
* Validate all arguments.
`Process::Status#&` and `Process::Status#>>` are provided only for
the backward compatibility with older Ruby than 1.8 where `$?` was
a `Fixnum`, and the knowledge about internals of system dependent
macros is necessary to use them. Modern programs and libraries
should not need these methods.
Always test only the scripts just under “lib", and just under
child directories which has not the same name script in the upper
level; instead of random sampling from whole libraries.
Previously, Kernel#lambda returned a non-lambda proc when given a
non-literal block and issued a warning under the `:deprecated` category.
With this change, Kernel#lambda will always return a lambda proc, if it
returns without raising.
Due to interactions with block passing optimizations, we previously had
two separate code paths for detecting whether Kernel#lambda got a
literal block. This change allows us to remove one path, the hack done
with rb_control_frame_t::block_code introduced in 85a337f for supporting
situations where Kernel#lambda returned a non-lambda proc.
[Feature #19777]
Co-authored-by: Takashi Kokubun <takashikkbn@gmail.com>
(X)StringNodes
(https://github.com/ruby/yarp/pull/1427)
Prior to this commit, heredocs were automatically InterpolatedNodes
regardless of whether there was actually interpolation. With this
commit, heredocs are only interpolate if there is actually
interpolation
e9f436128b
These are replacements for regular expressions when they are used
alone as the predicate of a conditional. That's because they are
significantly different from a regular expression because they are
not evaluated for truthyness, but instead evaluated as a match
against the last line read by an IO object.
0f1c7780e8
The flags integer is an implementation detail. We want people to
use the query methods to access the individual fields so we are
freed from having to maintain a specific order. As such, this
commit changes the Ruby API to mark all flags fields as private
attr_readers.
The only one that has a clear use case is returning the set of
options given to regular expressions, to mirror the Regexp#options
API. So, to support this use case, this commit introduces
RegularExpressionNode#options and InterpolatedRegularExpressionNode#options.
These APIs provide back the same integer so that they can be used
interchangeably.
4e6d5dd99f