Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix complex transi compact #547

Open
wants to merge 21 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
3bc41f4
[ruby/prism] Add macGreek encoding
kddnewton Nov 16, 2023
498b086
Skip test_ForwardingArgumentsNode
mame Nov 17, 2023
94c9f16
Refactor rb_obj_evacuate_ivs_to_hash_table
byroot Nov 16, 2023
940f2e7
size_pool_idx_for_size: Include debugging info in error message
byroot Nov 17, 2023
4a26a65
[ruby/prism] Add macTurkish
haldun Nov 16, 2023
9ba49c6
mingw.yml - remove encoding, run tests in cmd shell
MSP-Greg Nov 16, 2023
c2f2090
[ruby/prism] Do not test locale encoding on windows
kddnewton Nov 17, 2023
db4303f
[ruby/prism] Never test locale encoding
kddnewton Nov 17, 2023
e5d6b40
[ruby/prism] Do not allow trailing commas in calls without parenthesis
haldun Nov 13, 2023
85dcfef
[ruby/prism] Add macUkraine
haldun Nov 17, 2023
0a081a3
[ruby/prism] Add macRoman
haldun Nov 17, 2023
50b7b92
[ruby/prism] Add macThai
haldun Nov 17, 2023
229f6e5
[ruby/prism] Update spacing in encoding_test.rb
kddnewton Nov 17, 2023
585fdfe
[ruby/prism] add Windows-874 encoding
pcai Nov 17, 2023
cbdac2f
[ruby/prism] Silence clang analyzer warnings for the memory leaks
haldun Nov 17, 2023
7c99e43
[ruby/prism] Ensure serialized file is little endian
kddnewton Nov 13, 2023
3dd77bc
Fix corruption when out of shape during ivar remove
peterzhu2118 Nov 17, 2023
ef72970
Fix File.directory? doc hidding File::Stat#directory? doc
robotdana Nov 17, 2023
24fe22a
Fix ordering for auto compaction in get_overloaded_cme()
XrXr Nov 17, 2023
f479e62
[ruby/prism] Revert "Ensure serialized file is little endian"
kddnewton Nov 18, 2023
97fb07d
Pin object ivars while they are being copied in a hash
byroot Nov 16, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[ruby/prism] Add macRoman
  • Loading branch information
haldun authored and matzbot committed Nov 17, 2023
commit 0a081a33eb036101e7e61cf61e6390481cfe73c3
1 change: 1 addition & 0 deletions prism/enc/pm_encoding.h
Original file line number Diff line number Diff line change
@@ -192,6 +192,7 @@ extern pm_encoding_t pm_encoding_iso_8859_16;
extern pm_encoding_t pm_encoding_koi8_r;
extern pm_encoding_t pm_encoding_mac_greek;
extern pm_encoding_t pm_encoding_mac_iceland;
extern pm_encoding_t pm_encoding_mac_roman;
extern pm_encoding_t pm_encoding_mac_romania;
extern pm_encoding_t pm_encoding_mac_turkish;
extern pm_encoding_t pm_encoding_mac_ukraine;
35 changes: 35 additions & 0 deletions prism/enc/pm_tables.c
Original file line number Diff line number Diff line change
@@ -768,6 +768,30 @@ static uint8_t pm_encoding_mac_iceland_table[256] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // Fx
};

/**
* Each element of the following table contains a bitfield that indicates a
* piece of information about the corresponding macRoman character.
*/
static uint8_t pm_encoding_mac_roman_table[256] = {
// 0 1 2 3 4 5 6 7 8 9 A B C D E F
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0x
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 1x
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 2x
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, // 3x
0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, // 4x
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 0, 0, // 5x
0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, // 6x
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, // 7x
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 8x
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 9x
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // Ax
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // Bx
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // Cx
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // Dx
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // Ex
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // Fx
};

/**
* Each element of the following table contains a bitfield that indicates a
* piece of information about the corresponding macRomania character.
@@ -1152,6 +1176,7 @@ PRISM_ENCODING_TABLE(iso_8859_16)
PRISM_ENCODING_TABLE(koi8_r)
PRISM_ENCODING_TABLE(mac_greek)
PRISM_ENCODING_TABLE(mac_iceland)
PRISM_ENCODING_TABLE(mac_roman)
PRISM_ENCODING_TABLE(mac_romania)
PRISM_ENCODING_TABLE(mac_turkish)
PRISM_ENCODING_TABLE(mac_ukraine)
@@ -1497,6 +1522,16 @@ pm_encoding_t pm_encoding_mac_iceland = {
.multibyte = false
};

/** macRoman */
pm_encoding_t pm_encoding_mac_roman = {
.name = "macRoman",
.char_width = pm_encoding_single_char_width,
.alnum_char = pm_encoding_mac_roman_alnum_char,
.alpha_char = pm_encoding_mac_roman_alpha_char,
.isupper_char = pm_encoding_mac_roman_isupper_char,
.multibyte = false
};

/** macRomania */
pm_encoding_t pm_encoding_mac_romania = {
.name = "macRomania",
1 change: 1 addition & 0 deletions prism/prism.c
Original file line number Diff line number Diff line change
@@ -6137,6 +6137,7 @@ parser_lex_magic_comment_encoding_value(pm_parser_t *parser, const uint8_t *star
case 'M': case 'm':
ENCODING1("macGreek", pm_encoding_mac_greek);
ENCODING1("macIceland", pm_encoding_mac_iceland);
ENCODING1("macRoman", pm_encoding_mac_roman);
ENCODING1("macRomania", pm_encoding_mac_romania);
ENCODING1("macTurkish", pm_encoding_mac_turkish);
ENCODING1("macUkraine", pm_encoding_mac_ukraine);
1 change: 1 addition & 0 deletions test/prism/encoding_test.rb
Original file line number Diff line number Diff line change
@@ -40,6 +40,7 @@ class EncodingTest < TestCase
Encoding::KOI8_R => 0x00...0x100,
Encoding::MACGREEK => 0x00...0x100,
Encoding::MACICELAND => 0x00...0x100,
Encoding::MACROMAN => 0x00...0x100,
Encoding::MACROMANIA => 0x00...0x100,
Encoding::MACTURKISH => 0x00...0x100,
Encoding::Windows_1250 => 0x00...0x100,