Граф коммитов

32 Коммитов

Автор SHA1 Сообщение Дата
Kevin Newton e08c128417 [ruby/prism] Error messages closer to CRuby
https://github.com/ruby/prism/commit/19ffa0b980
2024-02-12 18:01:45 +00:00
Kevin Newton f5b368df0c [ruby/prism] Better invalid token messages
https://github.com/ruby/prism/commit/8c9bed2a4d
2024-02-06 18:10:50 +00:00
Kevin Newton 07611acb0c [ruby/prism] Add another error type for raising argument errors
https://github.com/ruby/prism/commit/f3030cb2b2
2024-02-05 19:24:57 +00:00
Haldun Bayhantopcu 67c5690a6d [ruby/prism] Check literals for receiver
https://github.com/ruby/prism/commit/56441b08e7
2024-02-01 16:48:09 +00:00
Kevin Newton ba06a8259a [ruby/prism] Better error messages for unexpected tokens in prefix
https://github.com/ruby/prism/commit/a35b8e45ee
2024-01-30 16:10:08 +00:00
Kevin Newton e337c9478a [ruby/prism] Error follow-up
Split up the diagnostic levels so that error and warning levels
aren't mixed. Also fix up deconstruct_keys implementation.

https://github.com/ruby/prism/commit/bd3eeb308d

Co-authored-by: Benoit Daloze <eregontp@gmail.com>
2024-01-27 18:46:16 +00:00
Benoit Daloze de135bc247 [ruby/prism] Add level to warnings and errors to categorize them
* Fixes https://github.com/ruby/prism/issues/2082

https://github.com/ruby/prism/commit/7a74576357
2024-01-26 21:34:34 +00:00
Takashi Kokubun 603f2ca730 [ruby/prism] Parse `it` default parameter
https://github.com/ruby/prism/commit/a0c5361b9f
2024-01-17 17:47:33 +00:00
TSUYUSATO Kitsune 0ee625ceae [ruby/prism] Fix to check multiple block arguments for forwarding arg
Fix https://github.com/ruby/prism/pull/2111

https://github.com/ruby/prism/commit/21ca243d0a
2024-01-02 19:08:15 +00:00
Hiroshi SHIBATA fa251d60aa Revert "Revert all of commits after Prism 0.19.0 release"
This reverts commit d242e8416e.
2023-12-25 21:12:49 +09:00
Hiroshi SHIBATA d242e8416e
Revert all of commits after Prism 0.19.0 release
We should bundle released version of Prism for Ruby 3.3.0
2023-12-16 11:08:51 +08:00
Kevin Newton fe9b42f024 [ruby/prism] Invalid pinned locals in pattern matching
https://github.com/ruby/prism/commit/3a67b37a56
2023-12-15 15:03:49 +00:00
TSUYUSATO Kitsune 16830a4783 [ruby/prism] Add an error for `in` keyword in arguments
Fix https://github.com/ruby/prism/pull/2026

https://github.com/ruby/prism/commit/c4b41cd477
2023-12-15 13:25:54 +00:00
Kevin Newton b7e89d4b17 [ruby/prism] Fix hash pattern rest
https://github.com/ruby/prism/commit/43c4232cfc
2023-12-14 02:43:32 +00:00
Haldun Bayhantopcu ce094e8556 [ruby/prism] Emit error for constant assignments in defs
https://github.com/ruby/prism/commit/864b06f90e
2023-12-06 22:15:16 +00:00
Kevin Newton 82f18baa21 [ruby/prism] Provide flags for changing encodings
https://github.com/ruby/prism/commit/e838eaff6f
2023-12-06 14:23:38 -05:00
Lily Lyons 1227b6d912 [ruby/prism] Refactor pm_diagnostic_t and pm_comment_t to use pm_location_t
https://github.com/ruby/prism/commit/115b6a2fc6
2023-12-04 14:33:44 +00:00
TSUYUSATO Kitsune b5796d7b11 [ruby/prism] Check circular references in default values of params
Fix https://github.com/ruby/prism/pull/1637

https://github.com/ruby/prism/commit/0172d69cba
2023-11-28 17:27:09 +00:00
TSUYUSATO Kitsune 76f9abced7 [ruby/prism] Reject statements at non-statement posisions
Fix https://github.com/ruby/prism/pull/1547

https://github.com/ruby/prism/commit/cdb643aeab
2023-11-22 14:53:27 +00:00
Haldun Bayhantopcu 8966d06b96 [ruby/prism] Warning for ENDs in methods
(https://github.com/ruby/prism/pull/1899)

https://github.com/ruby/prism/commit/1b41c2d56c
2023-11-21 16:36:12 +00:00
Kevin Newton 5299b4a362 [ruby/prism] Build the ability to format errors
(https://github.com/ruby/prism/pull/1796)

Previously, we only supported error messages that were constant
strings. This works for the most part, but there are some times
where we want to include some part of the source in the error
message to make it better.

For example, instead of "Token is reserved" it's better to write
"_1 is reserved".

To do this, we now support allocating error messages at runtime
that are built around format strings.

https://github.com/ruby/prism/commit/7e6aa17deb
2023-11-21 02:43:18 +00:00
Kevin Newton 9fa524dd41 [ruby/prism] Split up CaseNode and CaseMatchNode
(https://github.com/ruby/prism/pull/1801)

https://github.com/ruby/prism/commit/4c1391ea56
2023-11-21 02:38:07 +00:00
Hiroya Fujinami caa9ae7804 [ruby/prism] Fix parsing `...` in arguments
(https://github.com/ruby/prism/pull/1882)

* Fix parsing `...` in arguments

Fix https://github.com/ruby/prism/pull/1830
Fix https://github.com/ruby/prism/pull/1831

* Rename the constant name to PM_ERR_ARGUMENT_FORWARDING_UNBOUND

https://github.com/ruby/prism/pull/1882#discussion_r1398461156

https://github.com/ruby/prism/commit/519653aec2
2023-11-20 15:52:44 +00:00
TSUYUSATO Kitsune 52a0f1d14b [ruby/prism] Add "Unexpected void value expression" error
https://github.com/ruby/prism/commit/88b7b8e1fc
2023-11-14 14:34:47 +00:00
Kevin Newton 690f3bbf5d [ruby/prism] Last remaining missing C comments
https://github.com/ruby/prism/commit/e327449db6
2023-11-01 13:10:29 -04:00
Kevin Newton 1de05631b5 [ruby/prism] Documentation for diagnostics and regexp
https://github.com/ruby/prism/commit/16e0579044
2023-11-01 13:10:29 -04:00
Kevin Newton 7c8d939680 [ruby/prism] Start better documenting C API
https://github.com/ruby/prism/commit/2b6e661bbc
2023-11-01 13:10:29 -04:00
Kevin Newton 2a6f7cd925 [ruby/prism] Index{Operator,And,Or}WriteNode
Right now, our Call{Operator,And,Or}WriteNode nodes represent two
different concepts:

```ruby
foo.bar += 1
foo[bar] += 1
```

These two statements are different in what they can support. The
former can never have arguments (or an opening_loc or closing_loc).
The former can also never have a block. Also, the former is a
variable method name.

The latter is always going to be []/[]=, it can have any number of
arguments including blocks (`foo[&bar] ||= 1`), and will always
have an opening_loc and closing_loc.

Furthermore, these statements end of having to take different paths
through the various compilers because with the latter you have to
consider the arguments and the block, whereas the former can
perform some additional peephole optimizations since there are
fewer values on the stack.

For these reasons, I'm introducing Index{Operator,And,Or}WriteNode.
These nodes never have a read_name or write_name on them because
they are always []/[]=. They also support blocks, which the previous
write nodes didn't. As a benefit of introducing these nodes, I've
removed the opening_loc, closing_loc, and arguments from the older
write nodes because they will always be null.

For the serialized format, both of these nodes end up being
smaller, and for in-memory we're storing fewer things in general,
so we have savings all around.

I don't love that we are introducing another node that is a call
node since we generally want consumers to only have to handle a
single call, but these nodes are so specific that they would have
to be handled separately anyway since in fact call 2 methods.

https://github.com/ruby/prism/commit/70155db9cd
2023-10-18 14:23:26 +00:00
Haldun Bayhantopcu 7799fe90da [ruby/prism] Check for a semicolon or a newline after the inheritance operator
https://github.com/ruby/prism/commit/0326ba6775
2023-09-28 13:31:22 +00:00
Haldun Bayhantopcu 0084bac47a [ruby/prism] Fix assertion failure for fwd params after rest
https://github.com/ruby/prism/commit/f86bff6dd7
2023-09-28 13:24:57 +00:00
Kevin Newton 4f73a7c2f7 Sync to prism rename commits 2023-09-27 13:57:38 -04:00
Kevin Newton 8ab56869a6 Rename YARP filepaths to prism filepaths 2023-09-27 13:57:38 -04:00