Actually implemented some sort of primitive hierarchy for the results of things like 1 + 2.0 as well as port test_functionMultipleTemplateTest.krak so we now have 5/71

This commit is contained in:
Nathan Braswell
2016-02-05 16:43:14 -05:00
parent 778e03a929
commit f941cb98dd
5 changed files with 40 additions and 3 deletions

View File

@@ -141,6 +141,15 @@ obj type (Object) {
}
return string("impossible type, indirection:") + indirection
}
fun rank(): int {
match (base) {
base_type::character() return 1
base_type::integer() return 2
base_type::floating() return 3
base_type::double_precision() return 4
}
return 0
}
fun clone_with_increased_indirection(): *type return clone_with_indirection(indirection+1);
fun clone_with_increased_indirection(more: int): *type return clone_with_indirection(indirection+more);
fun clone_with_decreased_indirection(): *type return clone_with_indirection(indirection-1);