summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog14
-rw-r--r--enc/trans/utf8_mac.trans14
-rw-r--r--tool/transcode-tblgen.rb9
-rw-r--r--transcode.c14
-rw-r--r--transcode_data.h3
5 files changed, 32 insertions, 22 deletions
diff --git a/ChangeLog b/ChangeLog
index 8b445123e7..c432ff597c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+Tue May 5 07:22:37 2009 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * transcode.c: NOMAP is now multibyte direct map.
+
+ * transcode.c: remove ASIS.
+
+ * transcode_data.h: ditto.
+
+ * tool/transcode-tb (ActionMap#generate_info): remove :asis.
+
+ * tool/transcode-tb (ActionMap#generate_info): add :nomap0.
+
+ * enc/trans/utf8_mac.trans: replace :asis by :nomap0.
+
Sat May 2 22:53:02 2009 Akinori MUSHA <knu@iDaemons.org>
* lib/set.rb (SortedSet): Fix document. [Bug #1429]
diff --git a/enc/trans/utf8_mac.trans b/enc/trans/utf8_mac.trans
index b8c8f89889..5a12b59f03 100644
--- a/enc/trans/utf8_mac.trans
+++ b/enc/trans/utf8_mac.trans
@@ -6,13 +6,13 @@
transcode_tblgen("UTF-8", "UTF8-MAC",
MAC_DECOMPOSE_TBL + [
["{00-7F}", :nomap],
- ["{c2-df}{80-bf}", :asis],
- ["e0{a0-bf}{80-bf}", :asis],
- ["{e1-ec}{80-bf}{80-bf}", :asis],
- ["ed{80-9f}{80-bf}", :asis],
- ["{ee-ef}{80-bf}{80-bf}", :asis],
- ["f0{90-bf}{80-bf}{80-bf}", :asis],
- ["{f1-f3}{80-bf}{80-bf}{80-bf}", :asis],
+ ["{c2-df}{80-bf}", :nomap0],
+ ["e0{a0-bf}{80-bf}", :nomap0],
+ ["{e1-ec}{80-bf}{80-bf}", :nomap0],
+ ["ed{80-9f}{80-bf}", :nomap0],
+ ["{ee-ef}{80-bf}{80-bf}", :nomap0],
+ ["f0{90-bf}{80-bf}{80-bf}", :nomap0],
+ ["{f1-f3}{80-bf}{80-bf}{80-bf}", :nomap0],
])
map = {}
diff --git a/tool/transcode-tblgen.rb b/tool/transcode-tblgen.rb
index 83fc198da0..f7f05c41ef 100644
--- a/tool/transcode-tblgen.rb
+++ b/tool/transcode-tblgen.rb
@@ -238,9 +238,9 @@ class ActionMap
ss.each_firstbyte {|byte, rest|
h[byte] ||= {}
if h[byte][rest].nil?
- elsif action == :asis
+ elsif action == :nomap0
next
- elsif h[byte][rest] != :asis
+ elsif h[byte][rest] != :nomap0
raise "ambiguous %s or %s (%02X/%s)" % [h[byte][rest], action, byte, rest]
end
h[byte][rest] = action
@@ -317,10 +317,9 @@ class ActionMap
def generate_info(info)
case info
- when :nomap
+ when :nomap, :nomap0
+ # :nomap0 is low priority. it never collides.
"NOMAP"
- when :asis
- "ASIS"
when :undef
"UNDEF"
when :invalid
diff --git a/transcode.c b/transcode.c
index fba247a718..36b6d777ac 100644
--- a/transcode.c
+++ b/transcode.c
@@ -505,7 +505,6 @@ transcode_restartable0(const unsigned char **in_pos, unsigned char **out_pos,
case 30: goto resume_label30;
case 31: goto resume_label31;
case 32: goto resume_label32;
- case 33: goto resume_label33;
}
while (1) {
@@ -541,15 +540,14 @@ transcode_restartable0(const unsigned char **in_pos, unsigned char **out_pos,
follow_info:
switch (next_info & 0x1F) {
case NOMAP:
- SUSPEND_OBUF(3); *out_p++ = next_byte;
- continue;
- case ASIS:
{
- const unsigned char *p = inchar_start;
- while (p < in_p) {
- SUSPEND_OBUF(33); *out_p++ = (unsigned char)*p++;
+ const unsigned char *pend = in_p;
+ in_p = inchar_start;
+ while (in_p < pend) {
+ next_byte = (unsigned char)*in_p++;
+ SUSPEND_OBUF(3); *out_p++ = next_byte;
}
- }
+ }
continue;
case 0x00: case 0x04: case 0x08: case 0x0C:
case 0x10: case 0x14: case 0x18: case 0x1C:
diff --git a/transcode_data.h b/transcode_data.h
index 9a09e18652..8b320c39eb 100644
--- a/transcode_data.h
+++ b/transcode_data.h
@@ -22,7 +22,7 @@
#define PType (unsigned int)
-#define NOMAP (PType 0x01) /* single byte direct map */
+#define NOMAP (PType 0x01) /* direct map */
#define ONEbt (0x02) /* one byte payload */
#define TWObt (0x03) /* two bytes payload */
#define THREEbt (0x05) /* three bytes payload */
@@ -36,7 +36,6 @@
#define FUNso (PType 0x0F) /* function from start to output */
#define STR1 (PType 0x11) /* string 4 <= len <= 259 bytes: 1byte length + content */
#define GB4bt (PType 0x12) /* GB18030 four bytes payload */
-#define ASIS (PType 0x13) /* multi byte direct map */
#define STR1_LENGTH(byte_addr) (unsigned int)(*(byte_addr) + 4)
#define STR1_BYTEINDEX(w) ((w) >> 6)