# add null version, as a struct
if is_nullable then
- var null_getter = "null_{as_notnull.friendly_extern_name}"
+ var null_getter = "null_{as_notnull.mangled_name}"
var null_getter_local = "{mmmodule.to_s}_{null_getter}"
v.header.add( "{name} {null_getter_local}();\n" )
end
end
+ fun mangled_name: String
+ do
+ var pi = local_class.primitive_info
+ if is_nullable then
+ return "nullable_{local_class.name.to_s}"
+ else
+ return local_class.name.to_s
+ end
+ end
+
# Return the expression to convert this type from its native version.
fun from_native( name : String ) : String
do
if is_about_nullable_only then
if is_not_null_to_nullable then # to null
# nullable_Object Object_as_nullable( Object o )
- return "{from.friendly_extern_name}_as_nullable"
+ return "{from.mangled_name}_as_nullable"
else if is_nullable_to_not_null then # from null
# Object Object_as_not_null( nullable_Object o )
- return "{to.friendly_extern_name}_as_not_null"
+ return "{to.mangled_name}_as_not_null"
else
abort
end
else # inter types
# String Object_as_String( Object o )
- return "{from.friendly_extern_name}_as_{to.friendly_extern_name}"
+ return "{from.mangled_name}_as_{to.mangled_name}"
end
end
else if is_nullable_to_not_null then # from null
# Object_is_null( nullable_Object o )
# is opposite from others
- return "{to.local_class}_is_null"
+ return "{to.mangled_name}_is_null"
else
abort
end
else # inter types
# Object_is_a_String( Object o )
- return "{from.friendly_extern_name}_is_a_{to.friendly_extern_name}"
+ return "{from.mangled_name}_is_a_{to.mangled_name}"
end
end