``` diff --git a/scripts/UnicodePropertiesTemplate.java b/scripts/UnicodePropertiesTemplate.java index cd8a253..a7ff061 100644 --- a/scripts/UnicodePropertiesTemplate.java +++ b/scripts/UnicodePropertiesTemplate.java @@ -22,7 +22,7 @@ package org.jcodings.unicode; import org.jcodings.unicode.UnicodeEncoding.CodeRangeEntry; public class UnicodeProperties { - static final CodeRangeEntry[]CodeRangeTable = new CodeRangeEntry[] { + static enum CodeRangeEntry { %{extcrs} }; diff --git a/scripts/generate.rb b/scripts/generate.rb index 293b064..19de24c 100755 --- a/scripts/generate.rb +++ b/scripts/generate.rb @@ -191,7 +191,7 @@ def generate_coderange_list max_length = out.max_by{|name, table|name.length}.first.length.to_s open("#{SRC_DIR}/unicode/UnicodeProperties.java", "wb") do |f| f << - open("UnicodePropertiesTemplate.java", "rb").read.sub(/%\{max_length\}/, max_length).sub(/%\{extcrs\}/, out.map{|name, table| "#{INDENT * 2}" + "new CodeRangeEntry(\"#{name}\", \"CR_#{table}\")"}.join(",\n")) + open("UnicodePropertiesTemplate.java", "rb").read.sub(/%\{max_length\}/, max_length).sub(/%\{extcrs\}/, out.map{|name, table| "#{INDENT * 2}" + "#{name.upcase}(\"#{name}\", \"CR_#{table}\")"}.join(",\n")) end end