| Age | Commit message (Collapse) | Author |
|
https://github.com/ruby/prism/commit/864b06f90e
|
|
https://github.com/ruby/prism/commit/ef512ca914
|
|
https://github.com/ruby/prism/commit/6e69a81737
|
|
Fix https://github.com/ruby/prism/pull/1974
https://github.com/ruby/prism/commit/453d403593
|
|
https://github.com/ruby/prism/commit/e838eaff6f
|
|
The locals_body_index gives the index in the locals array where
the locals from the body start. This allows compilers to easily
index past the parameters in the locals array.
https://github.com/ruby/prism/commit/5d4627b890
|
|
https://github.com/ruby/prism/commit/5f0ea09785
|
|
It's possible to write the following and have it be valid Ruby:
```
defined?("foo"
)
```
But Prism wasn't taking the new line into account. This adds an
`accept1` for a `PM_TOKEN_NEWLINE` to account for this. I've also
updated the fixtures and snapshots to test this.
https://github.com/ruby/prism/commit/b87f8eedc6
|
|
https://github.com/ruby/prism/commit/e91f8dbb99
|
|
https://github.com/ruby/prism/commit/d5453f168e
|
|
Fix https://github.com/ruby/prism/pull/1468
Fix https://github.com/ruby/prism/pull/1575
To decide command-style method calls are allowed, this introduce a new
parameter `accepts_command_call` to `parse_expression` and some
functions.
Although one think this can be solved by operator precedence, it is
hard or impossible, because the precedence of command-style calls is skewed
(e.g. `! bar 1 ` is accepted, but `foo = ! bar 1` is rejected.)
One of the most complex examples is that:
(1) even though `foo = bar = baz 1` and `foo, bar = baz 1` is accepted,
(2) `foo, bar = baz = fuzz 1` is rejected.
To implement this behavior, this introduces a new binding power
`PM_BINDING_POWER_MULTI_ASSIGNMENT` and uses it for distinguish which single
assignments or multi assignments at their RHS.
https://github.com/ruby/prism/commit/d4dd49ca81
|
|
https://github.com/ruby/prism/commit/5f70b32b02
|
|
Fix https://github.com/ruby/prism/pull/1978
https://github.com/ruby/prism/commit/194c997d0a
|
|
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
|
|
https://github.com/ruby/prism/commit/aa8c702271
|
|
https://github.com/ruby/prism/commit/e148e8fe6a
|
|
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
|
|
https://github.com/ruby/prism/commit/f4c80c67dc
|
|
The problem was deeper than just looking back a single token.
You can push the heredoc_end token way back into the list.
We need to save the last location of a heredoc end to see if
it's the last token in the file.
Fixes https://github.com/ruby/prism/pull/1954
https://github.com/ruby/prism/commit/91dfd4eecd
|
|
Fix https://github.com/ruby/prism/pull/1946
This fixes to set an error position for unterminated strings to the
opening delimiters. Previously, the error position was set to the end
of the delimiter.
The same fix applies to other string-like literals.
Additionally, this fixes https://github.com/ruby/prism/pull/1946; that is, it adds the last part of the
string even though the string literal does not terminate.
https://github.com/ruby/prism/commit/c1240baafd
|
|
|
|
https://github.com/ruby/prism/commit/97b296a0f7
|
|
https://github.com/ruby/prism/commit/b9510aed40
|
|
https://github.com/ruby/prism/commit/2d5b9c2b3c
|
|
https://github.com/ruby/prism/commit/edfb54f039
|
|
https://github.com/ruby/prism/commit/ca3ab7ec89
|
|
https://github.com/ruby/prism/commit/4c06b6c42e
|
|
|
|
https://github.com/ruby/prism/commit/ba5218385a
|
|
https://github.com/ruby/prism/commit/d040337ce9
|
|
|
|
|
|
https://github.com/ruby/prism/commit/709fb6e09f
|
|
Fixes https://github.com/ruby/prism/pull/1874
https://github.com/ruby/prism/commit/304dd78dd2
|
|
MacJapanese (also aliased as MacJapan) is a modified Shift_JIS
encoding, but is implemented identically in Ruby
https://github.com/ruby/prism/commit/9e0a097699
|
|
https://github.com/ruby/prism/commit/9c2d1cf4ba
|
|
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
|
|
Fix https://github.com/ruby/prism/pull/1936
https://github.com/ruby/prism/commit/232e77a003
|
|
Fundamentally, `foo { |bar,| }` is different from `foo { |bar, *| }`
because of arity checks. This PR introduces a new node to handle
that, `ImplicitRestNode`, which goes in the `rest` slot of parameter
nodes instead of `RestParameterNode` instances.
This is also used in a couple of other places, namely:
* pattern matching: `foo in [bar,]`
* multi target: `for foo, in bar do end`
* multi write: `foo, = bar`
Now the only splat nodes with a `NULL` value are when you're
forwarding, as in: `def foo(*) = bar(*)`.
https://github.com/ruby/prism/commit/dba2a3b652
|
|
We are aware at parse time how many numbered parameters we have
on a BlockNode or LambdaNode, but prior to this commit, did not
store that information anywhere in its own right.
The numbered parameters were stored as locals, but this does not
distinguish them from other locals that have been set, for example
in `a { b = 1; _1 }` there is nothing on the AST that distinguishes
b from _1.
Consumers such as the compiler need to know information about how
many numbered parameters exist to set up their own tables around
parameters. Since we have this information at parse time, we should
compute it here, instead of deferring the work later on.
https://github.com/ruby/prism/commit/bf4a1e124d
|
|
https://github.com/ruby/prism/commit/1e6ecbaf04
|
|
It is for supporting `def foo(bar = (def baz(bar) = bar; 1)) = 2` case.
https://github.com/ruby/prism/commit/c789a833c5
|
|
https://github.com/ruby/prism/commit/896915de24
|
|
Fix https://github.com/ruby/prism/pull/1637
https://github.com/ruby/prism/commit/0172d69cba
|
|
Fix https://github.com/ruby/prism/pull/1924
https://github.com/ruby/prism/commit/7cde900065
|
|
https://github.com/ruby/prism/commit/42b60b6e95
|
|
I don't prefer this style, but it appears that a plurality of syntax
error messages between with un-capitalized messages in CRuby, so
we'll go with that for consistency, for now.
https://github.com/ruby/prism/commit/b02df68954
|
|
Fix https://github.com/ruby/prism/pull/1920
https://github.com/ruby/prism/commit/ee8e03bac7
|
|
Fix https://github.com/ruby/prism/pull/1925
Fix https://github.com/ruby/prism/pull/1927
Previously pm_call_node_index_p does not check about a block argument
correctly and is not used in parse_write to check an index call node.
This commit fixes these problems.
https://github.com/ruby/prism/commit/92bab044ff
|
|
Fix https://github.com/ruby/prism/pull/1821
https://github.com/ruby/prism/commit/7d023a26b4
|