| Age | Commit message (Collapse) | Author |
|
We should bundle released version of Prism for Ruby 3.3.0
|
|
https://github.com/ruby/prism/commit/62cc50e41b
|
|
|
|
https://github.com/ruby/prism/commit/e5f37d1407
|
|
https://github.com/ruby/prism/commit/5642a57f39
|
|
https://github.com/ruby/prism/commit/e838eaff6f
|
|
https://github.com/ruby/prism/commit/115b6a2fc6
|
|
A lot of tools use Ripper/RubyVM::AbstractSyntaxTree to determine
if a source is valid. These tools both create an AST instead of
providing an API that will return a boolean only.
This new API only creates the C structs, but doesn't bother
reifying them into Ruby/the serialization API. Instead it only
returns true/false, which is significantly more efficient.
https://github.com/ruby/prism/commit/7014740118
|
|
Previously numbered parameters were a field on blocks and lambdas
that indicated the maximum number of numbered parameters in either
the block or lambda, respectively. However they also had a
parameters field that would always be nil in these cases.
This changes it so that we introduce a NumberedParametersNode that
goes in place of parameters, which has a single uint8_t maximum
field on it. That field contains the maximum numbered parameter in
either the block or lambda.
As a part of the PR, I'm introducing a new UInt8Field type that
can be used on nodes, which is just to make it a little more
explicit what the maximum values can be (the maximum is actually 9,
since it only goes up to _9). Plus we can do a couple of nice
things in serialization like just read a single byte.
https://github.com/ruby/prism/commit/2d87303903
|
|
|
|
Ruby allows for 0 or negative line start, this is often used
with `eval` calls to get a correct offset when prefixing a snippet.
e.g.
```ruby
caller = caller_locations(1, 1).first
class_eval <<~RUBY, caller.path, caller.line - 2
# frozen_string_literal: true
def some_method
#{caller_provided_code_snippet}
end
RUBY
```
https://github.com/ruby/prism/commit/0d14ed1452
|
|
Line numbers may be negative, so we need to introduce signed varint,
so renaming unsigned ones first avoid confusion.
https://github.com/ruby/prism/commit/90d862361e
|
|
https://github.com/ruby/prism/commit/42b60b6e95
|
|
https://github.com/ruby/prism/commit/4d689fe1df
|
|
template
(https://github.com/ruby/prism/pull/1905)
https://github.com/ruby/prism/commit/6f7cbc1ca9
|
|
https://github.com/ruby/prism/commit/1398879d79
|
|
(https://github.com/ruby/prism/pull/1809)
https://github.com/ruby/prism/commit/d493ccd093
|
|
(https://github.com/ruby/prism/pull/1787)
https://github.com/ruby/prism/commit/5acc38a2f3
|
|
https://github.com/ruby/prism/commit/4cec275fff
|
|
https://github.com/ruby/prism/commit/0c762ee68a
|
|
https://github.com/ruby/prism/commit/3e4b4fb947
|
|
https://github.com/ruby/prism/commit/ea00a1b3c6
|
|
No encodings are guaranteed in C compilers, and other than UTF-8
encodings may be assumed in some platforms, e.g., CP932 on Windows
Japanese edition, and may result in compilation errors.
|
|
|
|
https://github.com/ruby/prism/commit/0d0d039f8e
|
|
https://github.com/ruby/prism/commit/61a306cd5c
|
|
We were previously holding a type field on Comment to tell what
kind of comment it was. Instead, let's just use actual classes for
this.
https://github.com/ruby/prism/commit/e76830ca6e
|
|
https://github.com/ruby/prism/commit/4f3a3e3ec1
|
|
https://github.com/ruby/prism/commit/13fa262669
|
|
https://github.com/ruby/prism/commit/33cc75a4b7
|
|
https://github.com/ruby/prism/commit/5a2252e3ac
|
|
https://github.com/ruby/prism/commit/f0aa8ad93b
|
|
https://github.com/ruby/prism/commit/99e81619de
|
|
It's possible for us to parse a constant that is invalid in the
current encoding. To fix this, we wrap the intern function in an
rb_protect to ensure we always put a valid symbol into the AST.
https://github.com/ruby/prism/commit/e78398554d
|
|
https://github.com/ruby/prism/commit/77d4056766
|
|
https://github.com/ruby/prism/commit/e327449db6
|
|
https://github.com/ruby/prism/commit/84e22c5581
|
|
https://github.com/ruby/prism/commit/9c648ce615
|
|
https://github.com/ruby/prism/commit/69323d3df4
|
|
https://github.com/ruby/prism/commit/857f72e1f4
|
|
https://github.com/ruby/prism/commit/e2e29bef2d
|
|
https://github.com/ruby/prism/commit/2b6e661bbc
|
|
https://github.com/ruby/prism/commit/ca9a660f52
|
|
https://github.com/ruby/prism/commit/085da4feb9
|
|
https://github.com/ruby/prism/commit/3abd09c803
|
|
https://github.com/ruby/prism/commit/8062849d0d
|
|
https://github.com/ruby/prism/commit/6e5556dbdf
|
|
|
|
The existing comment generation was hard to read and was making a lot of string manipulation. However, ERB files are already designed to do string manipulation, so we can use that instead.
So, instead of doing a split and a map, I opted to use the `#each_line` method to iterate over the lines of the file.
Also, in order to add an optional space padding at the beginning of the line, I opted to pad it with a space and to then right trim it. This makes sure that no space is left behind if the line is empty, but a space is added if the line is not empty.
https://github.com/ruby/prism/commit/5736711e70
|
|
https://github.com/ruby/prism/commit/5b72f84480
|