do
var t = mmodule.char_type
- if value.ascii < 128 then
+ if value.code_point < 128 then
return new RuntimeVariable("'{value.to_s.escape_to_c}'", t, t)
else
- return new RuntimeVariable("{value.ascii}", t, t)
+ return new RuntimeVariable("{value.code_point}", t, t)
end
end
var native_mtype = mmodule.native_string_type
var nat = self.new_var(native_mtype)
self.add("{nat} = \"{string.escape_to_c}\";")
- var length = self.int_instance(string.bytelen)
- self.add("{res} = {self.send(self.get_property("to_s_with_length", native_mtype), [nat, length]).as(not null)};")
+ var bytelen = self.int_instance(string.bytelen)
+ var unilen = self.int_instance(string.length)
+ self.add("{res} = {self.send(self.get_property("to_s_full", native_mtype), [nat, bytelen, unilen]).as(not null)};")
self.add("{name} = {res};")
self.add("\}")
return res
else if pname == "to_b" then
v.ret(v.new_expr("(unsigned char){arguments[0]}", ret.as(not null)))
return true
- else if pname == "ascii" then
- v.ret(v.new_expr("(uint32_t){arguments[0]}", ret.as(not null)))
- return true
end
else if cname == "Char" then
if pname == "object_id" then
else if pname == "to_i" then
v.ret(v.new_expr("{arguments[0]}-'0'", ret.as(not null)))
return true
- else if pname == "ascii" then
- v.ret(v.new_expr("(long){arguments[0]}", ret.as(not null)))
- return true
end
else if cname == "Byte" then
if pname == "output" then
else if pname == "to_u32" then
v.ret(v.new_expr("(uint32_t){arguments[0]}", ret.as(not null)))
return true
- else if pname == "ascii" then
- v.ret(v.new_expr("{arguments[0]}", ret.as(not null)))
- return true
end
else if cname == "Bool" then
if pname == "output" then
else if pname == "to_f" then
v.ret(v.new_expr("(double){arguments[0]}", ret.as(not null)))
return true
- else if pname == "ascii" then
- v.ret(v.new_expr("{arguments[0]}", ret.as(not null)))
- return true
else if pname == "&" then
v.ret(v.new_expr("{arguments[0]} & {arguments[1]}", ret.as(not null)))
return true
else if pname == "unary ~" then
v.ret(v.new_expr("~{arguments[0]}", ret.as(not null)))
return true
- else if pname == "ascii" then
- v.ret(v.new_expr("{arguments[0]}", ret.as(not null)))
- return true
end
else if cname == "UInt16" then
if pname == "output" then
else if pname == "unary ~" then
v.ret(v.new_expr("~{arguments[0]}", ret.as(not null)))
return true
- else if pname == "ascii" then
- v.ret(v.new_expr("{arguments[0]}", ret.as(not null)))
- return true
end
else if cname == "Int32" then
if pname == "output" then
else if pname == "unary ~" then
v.ret(v.new_expr("~{arguments[0]}", ret.as(not null)))
return true
- else if pname == "ascii" then
- v.ret(v.new_expr("{arguments[0]}", ret.as(not null)))
- return true
end
else if cname == "UInt32" then
if pname == "output" then
else if pname == "unary ~" then
v.ret(v.new_expr("~{arguments[0]}", ret.as(not null)))
return true
- else if pname == "ascii" then
- v.ret(v.new_expr("{arguments[0]}", ret.as(not null)))
- return true
end
end
if pname == "exit" then