Add Type_Info type and add *_type objects at time of type registration.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
print(1.is_const());
|
||||
print(1.is_reference());
|
||||
print(1.is_pointer());
|
||||
print(1.is_null());
|
||||
print(1.is_undef());
|
||||
print(1.is_var_const());
|
||||
print(1.is_var_reference());
|
||||
print(1.is_var_pointer());
|
||||
print(1.is_var_null());
|
||||
print(1.is_var_undef());
|
||||
var i;
|
||||
print(i.is_undef());
|
||||
print(i.is_var_undef());
|
||||
|
@@ -1,4 +1,4 @@
|
||||
var i;
|
||||
print(i.is_undef());
|
||||
print(i.is_var_undef());
|
||||
i = 5;
|
||||
print(i.is_undef());
|
||||
print(i.is_var_undef());
|
||||
|
10
unittests/type_info.chai
Normal file
10
unittests/type_info.chai
Normal file
@@ -0,0 +1,10 @@
|
||||
print(string_type.name());
|
||||
print(string_type.is_type_const());
|
||||
print(string_type.is_type_reference());
|
||||
print(string_type.is_type_void());
|
||||
print(string_type.is_type_undef());
|
||||
print(string_type.is_type_pointer());
|
||||
print("string".get_type_info().name());
|
||||
print(string_type.bare_equal("string".get_type_info()));
|
||||
|
||||
print("bob".is_type(string_type));
|
9
unittests/type_info.txt
Normal file
9
unittests/type_info.txt
Normal file
@@ -0,0 +1,9 @@
|
||||
string
|
||||
false
|
||||
false
|
||||
false
|
||||
false
|
||||
false
|
||||
string
|
||||
true
|
||||
true
|
Reference in New Issue
Block a user