Commit graph

337 commits

Author SHA1 Message Date
Kevin Newton
3bc41f4f0b [ruby/prism] Add macGreek encoding
c36d3fc647
2023-11-16 18:00:08 +00:00
Kevin Newton
4b2915f0b9 [ruby/prism] Add macRomania encoding
bb73801cf4
2023-11-16 17:39:40 +00:00
Kevin Newton
6c2defdfaa [ruby/prism] Support for the macIceland encoding
f433d1b51b
2023-11-16 17:39:39 +00:00
Kevin Newton
b753e16945 [ruby/prism] IBM862 encoding
151698bf86
2023-11-16 17:39:38 +00:00
Kevin Newton
7dba4f424d [ruby/prism] IBM861 encoding
6d2b59384a
2023-11-16 17:39:37 +00:00
Kevin Newton
91af9e8d93 [ruby/prism] IBM860 encoding
aa6163d77a
2023-11-16 17:39:37 +00:00
Kevin Newton
a7df025c3f [ruby/prism] IBM857 encoding
8c9b580f84
2023-11-16 17:39:36 +00:00
Kevin Newton
076d0957b9 [ruby/prism] IBM855 encoding
9354ad1848
2023-11-16 17:39:36 +00:00
Kevin Newton
b0a188655d [ruby/prism] IBM852 encoding
45251fcbf1
2023-11-16 17:39:35 +00:00
Kevin Newton
f93e4ac18e [ruby/prism] Split up encoding comparisons based on first letter
80fac1e4a9
2023-11-16 17:39:34 +00:00
Kevin Newton
ef748f353b [ruby/prism] IBM775 encoding
65175641b1
2023-11-16 17:39:34 +00:00
Kevin Newton
ae3c346746 [ruby/prism] IBM-737 encoding
af1a665939
2023-11-16 17:39:33 +00:00
Kevin Newton
8c44d69b9f [ruby/prism] IBM720 encoding
fc1f6ea3af
2023-11-16 17:39:33 +00:00
Kevin Newton
ba937eee0b [ruby/prism] IBM437 encoding
d60329eeb5
2023-11-16 17:39:32 +00:00
Kevin Newton
f60b974393 [ruby/prism] Add cp855 encoding
8069d143f5
2023-11-16 17:39:32 +00:00
Kevin Newton
5d7e6842b5 [ruby/prism] Add cp852 encoding
ebe83490bf
2023-11-16 17:39:31 +00:00
Kevin Newton
63c490dc4e [ruby/prism] Add remaining windows encodings
e77b549a59
2023-11-16 17:39:30 +00:00
Kevin Newton
ca789e7232 [ruby/prism] Add windows-1250 encoding
a362535ca4
2023-11-16 17:39:30 +00:00
Kevin Newton
aebc6e8b8d [ruby/prism] Fix parsing other encodings bytes >= 0x80
c787d2e076
2023-11-16 17:39:29 +00:00
Maple Ong
ae56db590f [ruby/prism] Hook up encoding file to prism
93ec917dfe
2023-11-16 17:13:16 +00:00
Haldun Bayhantopcu
e3f464522c [ruby/prism] Fix calls with splat without parenthesis
d81a77e0e3
2023-11-16 15:13:08 +00:00
Kevin Newton
d2e7a70ee6 [ruby/prism] Track the then keyword for conditionals
fef0019a25
2023-11-15 23:08:11 +00:00
Kevin Newton
db8803d583 [ruby/prism] More consistent lex modes with %q
014f714ed1
2023-11-14 21:19:12 +00: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
52a0f1d14b [ruby/prism] Add "Unexpected void value expression" error
88b7b8e1fc
2023-11-14 14:34:47 +00:00
Mike Dalessio
26d11383e5 [ruby/prism] fix: float suffix at end of file
Found by fuzzing.

d77d4fe2b7
2023-11-14 14:25:41 +00:00
Mike Dalessio
d6d1a1839a [ruby/prism] fix: nested heredoc dedentation use-after-free
Because the lex mode may be freed when popped, we need to store off
this value for dedentation.

64007322f5

Co-authored-by: Kevin Newton <kddnewton@gmail.com>
2023-11-14 14:11:55 +00:00
Mike Dalessio
e020eb26f0 [ruby/prism] fix: Handle zero-length block parameters in invalid Ruby
Found by fuzzing.

4cd6c8cf98
2023-11-14 05:25:46 +00:00
TSUYUSATO Kitsune
2fb1d37439 [ruby/prism] Reject invalid rational literals like 1e1r on lexing
Fix https://github.com/ruby/prism/pull/1586

b3bde866f2
2023-11-12 02:34:02 +00:00
TSUYUSATO Kitsune
cd91e8e73a [ruby/prism] Introduce non-associativility to in and =>
Fix https://github.com/ruby/prism/pull/1596
Fix https://github.com/ruby/prism/pull/1771
Close https://github.com/ruby/prism/pull/1773

a3413e5605
2023-11-11 20:37:28 +00:00
Kevin Newton
85db7baccb [ruby/prism] Remove extra locals added by ...
b7850f2d30
2023-11-10 21:50:12 +00:00
Kevin Newton
98e5ea9431 [ruby/prism] Disallow forwarding in blocks
2bbd35943c
2023-11-10 21:50:11 +00:00
TSUYUSATO Kitsune
fae44d6524 [ruby/prism] Reset do_loop_stack around a body of a endless method definition
Fix https://github.com/ruby/prism/pull/1772

cdf58e845e
2023-11-09 08:37:20 +00:00
Kevin Newton
8587d9a8bf
[ruby/prism] Wire up options through the Java parser
13fa262669
2023-11-03 10:13:50 -04:00
Kevin Newton
d7d3243364
[ruby/prism] Properly support the start line option
33cc75a4b7
2023-11-03 10:13:50 -04:00
Kevin Newton
95d3f2eaec
[ruby/prism] Properly support the suppress_warnings option
84229529d7
2023-11-03 10:13:49 -04:00
Kevin Newton
85af40c1d7
[ruby/prism] Properly support the encoding option
4b538af20f
2023-11-03 10:13:49 -04:00
Kevin Newton
6496591194
[ruby/prism] Rename serialization APIs for consistency
5a2252e3ac
2023-11-03 10:13:49 -04:00
Kevin Newton
05f5c545d2
[ruby/prism] Wire up options through the FFI API
f0aa8ad93b
2023-11-03 10:13:49 -04:00
Kevin Newton
2a0f2b7763
[ruby/prism] Create an options struct for passing all of the possible options
99e81619de
2023-11-03 10:13:49 -04:00
Kevin Newton
ee7bf4643d [ruby/prism] Handle invalid constants in the constant pool
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.

e78398554d
2023-11-02 22:14:08 +00:00
Kevin Newton
52e127280b [ruby/prism] Disallow assigning to numbered parameters in regexp
ec419422f8
2023-11-01 17:40:16 +00:00
Kevin Newton
690f3bbf5d [ruby/prism] Last remaining missing C comments
e327449db6
2023-11-01 13:10:29 -04:00
Kevin Newton
e745af2f0e [ruby/prism] Comment format for prism.c
83f737ce17
2023-11-01 13:10:29 -04:00
Kevin Newton
17923cc876 [ruby/prism] Even more C file documentation
9c648ce615
2023-11-01 13:10:29 -04:00
Kevin Newton
171788c703 [ruby/prism] Remove unnecessary PM_EMPTY_ARGUMENTS
271f3bf628
2023-11-01 13:10:29 -04:00
Kevin Newton
b12c795bdc [ruby/prism] Remove unnecessary PM_EMPTY_NODE_LIST
857f72e1f4
2023-11-01 13:10:29 -04:00
Kevin Newton
e8a72b516f [ruby/prism] Documentation for more C functions
88336e7d9f
2023-11-01 13:10:29 -04:00