1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* transcode.c (ASIS): added for multi byte direct map.

* transcode.c (transcode_restartable0): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23294 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
naruse 2009-04-26 13:03:50 +00:00
parent 67798d11b8
commit 0881a39acd
3 changed files with 18 additions and 2 deletions

View file

@ -1,3 +1,9 @@
Sun Apr 26 21:59:43 2009 NARUSE, Yui <naruse@ruby-lang.org>
* transcode.c (ASIS): added for multi byte direct map.
* transcode.c (transcode_restartable0): ditto.
Sun Apr 26 20:33:12 2009 NARUSE, Yui <naruse@ruby-lang.org>
* tool/transcode-tb (ActionMap#generate_node):

View file

@ -505,6 +505,7 @@ 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) {
@ -539,8 +540,16 @@ transcode_restartable0(const unsigned char **in_pos, unsigned char **out_pos,
}
follow_info:
switch (next_info & 0x1F) {
case NOMAP: /* xxx: copy last byte only? */
SUSPEND_OBUF(3); *out_p++ = next_byte;
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++;
}
}
continue;
case 0x00: case 0x04: case 0x08: case 0x0C:
case 0x10: case 0x14: case 0x18: case 0x1C:

View file

@ -36,6 +36,7 @@
#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)