summaryrefslogtreecommitdiff
path: root/tool
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-09-07 09:13:16 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-09-07 09:13:16 +0000
commitc0bec2fae1d6adf77c853457942217e89ea85bcf (patch)
tree2af692a42271c5d32cfa8bc09b9b1fbea6a0b172 /tool
parent6bf5c34cf20002491423ca69dc3b0d037afaaefd (diff)
* transcode_data.h (STR1): defined for a string up to 255 bytes.
(STR1_BYTEINDEX): defined. (makeSTR1): defined. * tool/transcode-tblgen.rb: generate STR1. * transcode.c (transcode_restartable0): interpret STR1. * enc/trans/escape.trans (fun_so_escape_xml_chref): removed. STR1 is used instead. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19214 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'tool')
-rw-r--r--tool/transcode-tblgen.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/tool/transcode-tblgen.rb b/tool/transcode-tblgen.rb
index 6f98f10ea35..95031c43a01 100644
--- a/tool/transcode-tblgen.rb
+++ b/tool/transcode-tblgen.rb
@@ -301,6 +301,14 @@ class ActionMap
"o3(0x#$1,0x#$2,0x#$3)"
when /\A(f[0-7])([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])\z/i
"o4(0x#$1,0x#$2,0x#$3,0x#$4)"
+ when /\A([0-9a-f][0-9a-f]){0,255}\z/i
+ bytes = info
+ len = info.length/2
+ size = @bytes_code.length
+ @bytes_code.insert_at_last(1 + len,
+ "\#define str1_#{size} makeSTR1(#{size})\n" +
+ " #{len}," + info.gsub(/../, ' 0x\&,') + "\n")
+ "str1_#{size}"
when /\A\/\*BYTE_LOOKUP\*\// # pointer to BYTE_LOOKUP structure
$'.to_s
else
@@ -414,7 +422,11 @@ End
end
def gennode(bytes_code, words_code, name_hint=nil, valid_encoding=nil)
+ @bytes_code = bytes_code
+ @words_code = words_code
name = generate_node(bytes_code, words_code, name_hint, valid_encoding)
+ @bytes_code = nil
+ @words_code = nil
return name
end
end