*RENAMED THE TOSTRING SYMBOL TO TO_STRING!!!

This commit is contained in:
Wang Renxin 2017-11-08 15:48:20 +08:00
parent f010c1d94b
commit f966400979
12 changed files with 15 additions and 12 deletions

View File

@ -1,3 +1,6 @@
Nov. 8 2017
Renamed the TOSTRING symbol to TO_STRING
Nov. 7 2017
Fixed a bug with single-line nested IF statement

Binary file not shown.

View File

@ -322,7 +322,7 @@ MBCONST static const char* const _ERR_DESC[] = {
"Incomplete routine",
"Routine expected",
"Duplicate routine",
"To many routines",
"Too many routines",
"Invalid class",
"Incomplete class",
"Class expected",
@ -551,7 +551,7 @@ typedef struct _label_t {
#define _CLASS_HASH_FUNC "HASH"
#define _CLASS_COMPARE_FUNC "COMPARE"
#define _CLASS_TOSTRING_FUNC "TOSTRING"
#define _CLASS_TO_STRING_FUNC "TO_STRING"
#define _CLASS_OVERRIDE_FMT "_%s"
@ -8390,7 +8390,7 @@ static int _format_class_to_string(mb_interpreter_t* s, void** l, _class_t* inst
mb_assert(s && l && instance && out);
tsn = _search_identifier_in_class(s, instance, _CLASS_TOSTRING_FUNC, 0, 0);
tsn = _search_identifier_in_class(s, instance, _CLASS_TO_STRING_FUNC, 0, 0);
if(got_tostr) *got_tostr = false;
if(tsn) {
_object_t* tso = (_object_t*)tsn->data;

Binary file not shown.

Binary file not shown.

View File

@ -14,7 +14,7 @@ class entity
var dead_handler = nil
def tostring()
def to_string()
return "Entity [" + name + "]"
enddef

View File

@ -8,7 +8,7 @@ import "entity.bas"
class goal(entity)
var take_handler = nil
def tostring()
def to_string()
return "Goal [" + name + "]"
enddef

View File

@ -18,8 +18,8 @@ class map_node
var valid_dirs = dirs.none_dir
var entities = list()
def tostring()
s = pos.tostring()
def to_string()
s = pos.to_string()
return "Map Node " + s
enddef
@ -63,7 +63,7 @@ class map
var nodes = dict()
def tostring()
def to_string()
return "Map"
enddef

View File

@ -6,7 +6,7 @@
import "entity.bas"
class monster(entity)
def tostring()
def to_string()
return "Monster [" + name + "]"
enddef
endclass

View File

@ -8,7 +8,7 @@ import "entity.bas"
class npc(entity)
var talk_handler = nil
def tostring()
def to_string()
return "NPC [" + name + "]"
enddef

View File

@ -9,7 +9,7 @@ import "utils.bas"
class player(entity)
var pos = new(point)
def tostring()
def to_string()
return "Player [" + name + "]"
enddef
endclass

View File

@ -72,7 +72,7 @@ class point
var x = 0
var y = 0
def tostring()
def to_string()
return "[" + str(x) + ", " + str(y) + "]"
enddef
endclass