Age | Commit message (Collapse) | Author |
|
https://github.com/ruby/prism/commit/bd9027f0ab
|
|
[Bug #21197]
https://github.com/ruby/prism/commit/22be955ce9
Notes:
Merged: https://github.com/ruby/ruby/pull/12999
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/12925
|
|
This can get triggered even if the list of statements only contains
a single statement. This is necessary to properly support compiling
```ruby
defined? (;a)
defined? (a;)
```
as "expression". Previously these were parsed as statements lists
with single statements in them.
https://github.com/ruby/prism/commit/b63b5d67a9
|
|
https://github.com/ruby/prism/commit/bde8ccc038
|
|
https://github.com/ruby/prism/commit/f734350499
|
|
Fixes [Bug #21165]
https://github.com/ruby/prism/commit/3f0acf7560
|
|
Fixes [Bug #21145]
https://github.com/ruby/prism/commit/be2d845639
|
|
Fixes [Bug #21137]
https://github.com/ruby/prism/commit/ca493e6797
|
|
Fixes [Bug #21117]
https://github.com/ruby/prism/commit/19d4bab5a0
|
|
When recovering from a depth error that occurs at the end of the
file, we need to break out of parsing statements.
Fixes [Bug #21114]
https://github.com/ruby/prism/commit/a32e268787
|
|
Expressions joined with `&&` are better asserted separately, so that
it is clear from the failure message which expression is false.
Also, `unsigned long` may not be enough for `ptrdiff_t`, e.g., Windows.
Saying that `ptrdiff_t` can be larger than `SIZE_MAX` means that
`PTRDIFF_MAX` is larger than `SIZE_MAX` and `ptrdiff_t` is sufficient
to represent `SIZE_MAX`, otherwise if `PTRDIFF_MAX` is smaller than
`SIZE_MAX`, `diff` will always be smaller than `SIZE_MAX` as well.
`diff` could be equal to `SIZE_MAX` only if `PTRDIFF_MAX` is equal to
`SIZE_MAX` and these assertions would pass, but I don't think there is
any platform where that is the case.
https://github.com/ruby/prism/commit/1fc6dfcada
|
|
Fixes [Bug #21048]
https://github.com/ruby/prism/commit/07202005cb
|
|
Fixes [Bug #21085]
https://github.com/ruby/prism/commit/ebb9c36a10
|
|
When parent scopes around an eval are forwarding parameters (like
*, **, &, or ...) we need to know that information when we are in
the parser. As such, we need to support passing that information
into the scopes option. In order to do this, unfortunately we need
a bunch of changes.
The scopes option was previously an array of array of strings.
These corresponded to the names of the locals in the parent scopes.
We still support this, but now additionally support passing in a
Prism::Scope instance at each index in the array. This Prism::Scope
class holds both the names of the locals as well as an array of
forwarding parameter names (symbols corresponding to the forwarding
parameters). There is convenience function on the Prism module that
creates a Prism::Scope object using Prism.scope.
In JavaScript, we now additionally support an object much the same
as the Ruby side. In Java, we now have a ParsingOptions.Scope class
that holds that information. In the dump APIs, these objects in all
3 languages will add an additional byte for the forwarding flags in
the middle of the scopes serialization.
All of this is in service of properly parsing the following code:
```ruby
def foo(*) = eval("bar(*)")
```
https://github.com/ruby/prism/commit/21abb6b7c4
|
|
`not foo` should be `!foo`
`not()` should be `!nil`
Fixes [Bug #21027]
https://github.com/ruby/prism/commit/871ed4b462
|
|
https://github.com/ruby/prism/commit/03797b84d3
|
|
inside array"
https://github.com/ruby/prism/commit/51e7c84124
|
|
https://github.com/ruby/prism/commit/b4b7a69ce7
|
|
`a => [-2**b]` should be SyntaxError
Fixes: https://github.com/ruby/prism/issues/3381
https://github.com/ruby/prism/commit/ae8e83b389
|
|
Prism shoudld throw a syntax error for endless methods when the method
name uses brackets. Previously it would not. This matches the behavior
of parse.y.
Fixes https://bugs.ruby-lang.org/issues/21010
https://github.com/ruby/prism/commit/43c16a89ef
|
|
https://github.com/ruby/prism/commit/3f2c34b53d
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/12487
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/12485
|
|
Notes:
Merged: https://github.com/ruby/ruby/pull/12477
|
|
Fixes [Bug #20986]
https://github.com/ruby/prism/commit/fd0c563e9e
|
|
https://github.com/ruby/prism/commit/544df5835f
Notes:
Merged: https://github.com/ruby/ruby/pull/12358
|
|
Partially: https://bugs.ruby-lang.org/issues/20785
https://github.com/ruby/prism/commit/71c9102d02
Notes:
Merged: https://github.com/ruby/ruby/pull/12358
|
|
https://github.com/ruby/prism/commit/4ce6bcf182
Notes:
Merged: https://github.com/ruby/ruby/pull/12358
|
|
Prism was already disallowing arguments after block args, but in
parse.y, any comma after a block arg is a syntax error. This moves the
error handling into `PM_TOKEN_UAMPERSAND` where we can check if the
current type is `PM_TOKEN_COMMA`then raise an error. I've also updated
the tests to include the examplesfrom ruby/prism#3112.
Fixes: ruby/prism#3112
https://github.com/ruby/prism/commit/754cf8eddc
Notes:
Merged: https://github.com/ruby/ruby/pull/12358
|
|
https://github.com/ruby/prism/commit/9686897290
Notes:
Merged: https://github.com/ruby/ruby/pull/12358
|
|
Actually close [Bug #20952]
Notes:
Merged: https://github.com/ruby/ruby/pull/12343
|
|
Fixes [Bug #20952]
Notes:
Merged: https://github.com/ruby/ruby/pull/12342
|
|
https://github.com/ruby/prism/commit/2f903d7865
|
|
%r regular expressions need to be decoded like strings. This commit
fixes %r decoding so it works like strings.
https://github.com/ruby/prism/commit/85bfd9c0cd
|
|
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/3291
https://github.com/ruby/prism/commit/d4fc441838
|
|
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]
https://github.com/ruby/prism/commit/e573ceaad6
Co-authored-by: John Hawthorn <[email protected]>
Co-authored-by: eileencodes <[email protected]>
Co-authored-by: Kevin Newton <[email protected]>
|
|
If we hit an EOF token, and the character before the EOF is a newline,
we should make EOF token start at the previous newline. That way any
errors reported will occur on that line.
For example "foo(\n" should report an error on line 1 even though the
EOF technically occurs on line 2.
[Bug #20918]
https://bugs.ruby-lang.org/issues/20918
https://github.com/ruby/prism/commit/60bc43de8e
|
|
Instead cast it inline to a double on Windows.
https://github.com/ruby/prism/commit/9064d872aa
|
|
required
Partially fixes: #3171
https://github.com/ruby/prism/commit/d0d9699c27
|
|
match required
Partially fixes: https://github.com/ruby/prism/issues/3171
https://github.com/ruby/prism/commit/5c33fa5a1a
|
|
Fixes: https://github.com/ruby/prism/issues/3109
https://github.com/ruby/prism/commit/9ed989c30d
|
|
This is not important because of the path of `assert(false)`, but just
in case.
Coverity Scan found this issue.
https://github.com/ruby/prism/commit/7335c62f9d
|
|
https://github.com/ruby/prism/commit/70c1cd480f
|
|
https://github.com/ruby/prism/commit/232a02acef
|
|
Introduce StringQuery to provide methods to access some metadata
about the Ruby lexer.
https://github.com/ruby/prism/commit/d3f55b67b9
|
|
https://github.com/ruby/prism/commit/2745c81d31
|
|
Fixes [Bug #20788]
https://github.com/ruby/prism/commit/27e91f21af
|
|
https://github.com/ruby/prism/commit/3a0b1c6110
|
|
https://github.com/ruby/prism/commit/dbd5c929d6
|