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

Remove ruby compat hacks #259

Merged
merged 2 commits into from
Jan 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
14 changes: 1 addition & 13 deletions data/data_generator.jl
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,6 @@ end
exclusions = Set(read_composition_exclusions(r"# \(1\) Script Specifics.*?# Total code points:"s))
excl_version = Set(read_composition_exclusions(r"# \(2\) Post Composition Version precomposed characters.*?# Total code points:"s))

# FIXME: Replicate a bug in the ruby code
push!(exclusions, 0)
push!(excl_version, 0)

#-------------------------------------------------------------------------------
function read_case_folding(filename)
case_folding = Dict{UInt32,Vector{UInt32}}()
Expand Down Expand Up @@ -396,8 +392,7 @@ function char_table_properties!(sequences, char)
comp_exclusion = code in exclusions || code in excl_version,
ignorable = code in ignorable,
control_boundary = char.category in ("Zl", "Zp", "Cc", "Cf") &&
# FIXME: Ruby bug compat - should be `code in (0x200C, 0x200D)`
!(char.category in (0x200C, 0x200D)),
!(char.code in (0x200C, 0x200D)),
charwidth = derive_char_width(code, char.category),
boundclass = get_grapheme_boundclass(code),
indic_conjunct_break = get_indic_conjunct_break(code),
Expand All @@ -407,13 +402,6 @@ end
# Many character properties are duplicates. Deduplicate them, constructing a
# per-character array of indicies into the properties array
sequences = UTF16Sequences()

# FIXME: Hack to force ordering compat with Ruby code
for c in char_props
encode_sequence!(sequences, c.decomp_mapping)
encode_sequence!(sequences, get_case_folding(c.code))
end

char_table_props = [char_table_properties!(sequences, cp) for cp in char_props]

deduplicated_props = Origin(0)(Vector{eltype(char_table_props)}())
Expand Down
Loading
Loading