Commit graph

132 commits

Author SHA1 Message Date
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.

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)

4c1391ea56
2023-11-21 02:38:07 +00:00
Kevin Newton
5b0256e3c4 [ruby/prism] Disallow defining a numbered parameter method
(https://github.com/ruby/prism/pull/1797)

c13165e6aa
2023-11-20 16:12:50 +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

519653aec2
2023-11-20 15:52:44 +00:00
Haldun Bayhantopcu
e5d6b4099e [ruby/prism] Do not allow trailing commas in calls without parenthesis
f1d56da58f
2023-11-17 15:48:57 +00:00
Kevin Newton
befad28f30
Resync prism delete bin/dot 2023-11-14 16:22:03 -05:00
TSUYUSATO Kitsune
93e9be2f69
[ruby/prism] Check value expressions on creating a node
d60948bac3
2023-11-14 16:22:03 -05:00
TSUYUSATO Kitsune
5048c4f461
[ruby/prism] Check value expressions on parsing arguments and assignments
They are corresponding to `arg_value` in `parse.y`.

a4a4834e0d
2023-11-14 16:22:03 -05:00
TSUYUSATO Kitsune
80e379bda1
[ruby/prism] Check value expressions on parsing arguments and assignments
They are corresponding to `arg_value` in `parse.y`.

a4a4834e0d
2023-11-14 16:22:02 -05:00
TSUYUSATO Kitsune
336d81a671 [ruby/prism] Check value expressions on creating a node
d60948bac3
2023-11-14 14:34:48 +00:00
TSUYUSATO Kitsune
499786de46 [ruby/prism] Check value expressions on parsing arguments and assignments
They are corresponding to `arg_value` in `parse.y`.

a4a4834e0d
2023-11-14 14:34:48 +00:00
TSUYUSATO Kitsune
3439f1e62e [ruby/prism] Add parse_value_expression
37fad74134
2023-11-14 14:34:47 +00:00
TSUYUSATO Kitsune
d5c3680a0c [ruby/prism] Add tests for error cases on #1791, #1807, and #1810
231e965124
2023-11-13 13:34:24 +00:00
Kevin Newton
85db7baccb [ruby/prism] Remove extra locals added by ...
b7850f2d30
2023-11-10 21:50:12 +00:00
Kevin Newton
52e127280b [ruby/prism] Disallow assigning to numbered parameters in regexp
ec419422f8
2023-11-01 17:40:16 +00:00
Jemma Issroff
e80ca70b9b [ruby/prism] Flip incorrect names of OptionalKeywordParameterNode and RequiredKeywordParameterNode
c31f61e898
2023-11-01 14:40:45 +00:00
Jemma Issroff
d0625099e0 [ruby/prism] Split KeywordParameterNode into Optional and Required
Prior to this commit, KeywordParameterNode included both optional
and required keywords. With this commit, it is split in two, with
`OptionalKeywordParameterNode`s no longer having a value field.

89084d9af4
2023-11-01 14:40:44 +00:00
Kevin Newton
533bd1d1fa [ruby/prism] Ensure no extra multi-target nodes are created for splats
e60240d54b
2023-10-26 14:59:00 -04:00
Jemma Issroff
7e4ee92de2 [ruby/prism] Add KeywordSplat flag to ArgumentsNode
Method calls with keyword splat args compile differently than
without since they merge the keyword arg hash with the keyword splat
hash. We know this information at parse time, so can set a flag
which the compiler can use.

e5f8a9a3cd
2023-10-26 18:47:50 +00:00
Kevin Newton
5d0604366e [ruby/prism] Add * and & to methods with ...
e8114a786a
2023-10-18 16:08:31 +00:00
Kevin Newton
11e946da2f [ruby/prism] Fix up PR failings
11255f636e
2023-10-13 15:31:30 -04:00
Haldun Bayhantopcu
4387af1b4a [ruby/prism] Fix parsing symbols in strings after labels
e16531650d
2023-10-12 16:01:40 +00:00
Haldun Bayhantopcu
7eccc13c1f [ruby/prism] Emit error when assigning to a numbered parameter
66248ac2f6
2023-10-06 14:10:28 +00:00
Haldun Bayhantopcu
8d8fe54355 [ruby/prism] Check for duplicate parameter names in destructured params
c3438aabea
2023-10-05 16:35:45 +00:00
Haldun Bayhantopcu
38cb92a00c [ruby/prism] Check for duplicate names in shadow args
e100c6b8ae
2023-10-05 15:12:05 +00:00
Haldun Bayhantopcu
fb9795cf7a [ruby/prism] Fix parsing shadow args in lambda blocks
53efaf252d
2023-10-05 11:25:32 +00:00
Benoit Daloze
87dad067e0 Sync with prism CallNode#name changes
* https://github.com/ruby/prism/pull/1533
2023-10-02 09:18:56 -04:00
Haldun Bayhantopcu
834560a923 [ruby/prism] Check whether the predicate is closed for conditionals
bf43006d0a
2023-09-28 13:32:02 +00:00
Haldun Bayhantopcu
7799fe90da [ruby/prism] Check for a semicolon or a newline after the inheritance operator
0326ba6775
2023-09-28 13:31:22 +00:00
Haldun Bayhantopcu
0084bac47a [ruby/prism] Fix assertion failure for fwd params after rest
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
Renamed from test/yarp/errors_test.rb (Browse further)