Commit graph

14 commits

Author SHA1 Message Date
Kevin Newton
af7bf9e0d8 [ruby/prism] Provide options for reducing size
592128de4d
2024-03-20 17:32:03 -04:00
Kevin Newton
34bad6d69f [ruby/prism] Triple-check prism encodings
ab7f261354
2024-02-26 18:29:00 +00:00
Kevin Newton
2fa051f627 [ruby/prism] Validate multibyte characters in strings
Check that multibyte characters are valid using pm_strpbrk. We need
to add a couple of codepaths to ensure all encodings are covered.

Importantly this doesn't check regular expressions, because
apparently you're allowed to have invalid multibyte characters
inside regular expression comment groups/extended mode.

2857d3e1b5
2024-02-14 01:01:37 +00:00
Kevin Newton
dc5191d695 [ruby/prism] Fix KOI-8 char width check
06d3747c5b
2024-02-13 21:12:10 +00:00
Alan Wu
770b5499a5 [ruby/prism] Amend assert in pm_utf_8_codepoint(), n=0 is fine
This assert used to trip in the included test:
```
./miniruby --parser=prism -e ' "%W"\u" '
```

8c0f84db4f
2024-02-01 22:04:46 +00:00
Benoit Daloze
9fdfdf4fca [ruby/prism] Always return the character width for char_is_identifier_start() and char_is_identifier_utf8()
* This is also faster than calling pm_encoding_utf_8_alpha_char/pm_encoding_utf_8_alnum_char
  as those compute the character width and do extra checks.

4cb276ac4c
2024-01-31 21:29:16 +00:00
Kevin Newton
242dc537f9 [ruby/prism] Exclude encodings that are dynamic
6749146c0e
2024-01-11 19:14:25 +00:00
Kevin Newton
82072254a0 [ruby/prism] Update documentation for encodings
18e6df0d4f
2023-12-06 19:26:35 +00:00
Kevin Newton
82f18baa21 [ruby/prism] Provide flags for changing encodings
e838eaff6f
2023-12-06 14:23:38 -05:00
Kevin Newton
99a147ff4f [ruby/prism] Document remaining encodings
b9510aed40
2023-11-30 21:37:56 -05:00
Kevin Newton
0c277f2b76 [ruby/prism] Group encodings into a single array
f4b7beadc9
2023-11-30 21:37:56 -05:00
Kevin Newton
6b234c1acf [ruby/prism] Do not expose encodings that do not need to be exposed
c52c7f37ea
2023-11-30 21:37:56 -05:00
Kevin Newton
997083188b [ruby/prism] Remove public ASCII functions that can now be static
9461384b0c
2023-11-30 21:37:56 -05:00
Kevin Newton
abb1fe2868 [PRISM] Consolidate prism encoding files 2023-11-30 21:37:56 -05:00
Renamed from prism/enc/pm_tables.c (Browse further)