236 symbol_c *get_datatype_info_c::get_id(symbol_c *datatype) { |
236 symbol_c *get_datatype_info_c::get_id(symbol_c *datatype) { |
237 return get_datatype_id_c::get_id(datatype); |
237 return get_datatype_id_c::get_id(datatype); |
238 } |
238 } |
239 |
239 |
240 |
240 |
241 /* Returns true if both datatypes are identicial. |
241 /* Returns true if both datatypes are equivalent (not necessarily equal!). |
242 * WARING: When handling REF_TO datatypes, it may return 'true' even though |
242 * WARNING: May return true even though the datatypes are not the same/identicial!!! |
243 * the datatypes are not identicial. This occurs when at least one of the |
243 * This occurs when at least one of the datatypes is of a generic |
244 * datatypes if a ref_to_any_c, which os equivalent to a (void *), and the |
244 * datatype (or a REF_TO a generic datatype). |
245 * other datatype is any REF_TO datatype (including a ref_to_any_c). |
245 * (Generic dataypes: ANY, ANY_INT, ANY_NUM, ...) |
|
246 * NOTE: Currently only the ANY generic datatype is implemented! |
|
247 * NOTE: Currently stage1_2 only allows the use of the ANY keyword when in conjuntion with |
|
248 * the REF_TO keyword (i.e. REF_TO ANY), so when handling non REF_TO datatypes, |
|
249 * this function will currently only return true if the dataypes are identicial. |
246 */ |
250 */ |
247 bool get_datatype_info_c::is_type_equal(symbol_c *first_type, symbol_c *second_type) { |
251 bool get_datatype_info_c::is_type_equal(symbol_c *first_type, symbol_c *second_type) { |
248 if (!is_type_valid( first_type)) {return false;} |
252 if (!is_type_valid( first_type)) {return false;} |
249 if (!is_type_valid(second_type)) {return false;} |
253 if (!is_type_valid(second_type)) {return false;} |
250 |
254 |