Enough interpreter to do math on constant integers

This commit is contained in:
Nathan Braswell
2016-05-13 03:10:36 -04:00
parent 3fe72bc8e2
commit e63b7cf770
6 changed files with 160 additions and 9 deletions

View File

@@ -926,7 +926,10 @@ obj ast_transformation (Object) {
var second_param = null<ast_node>()
if (func_name == "." || func_name == "->") {
/*println("PRE VANILLA TRY FOR SECOND PARAM")*/
second_param = transform(node->children[2], get_ast_type(first_param)->type_def, searching_for, template_replacements)
var first_param_type = get_ast_type(first_param)
if (!first_param_type)
error(node, "Cannot get type from left side of access operation")
second_param = transform(node->children[2], first_param_type->type_def, searching_for, template_replacements)
// template member functions
// XXX add in template inst if it exists
if (!second_param) match (searching_for) {