diff --git a/HISTORY b/HISTORY index a6d6b36..caf352d 100755 --- a/HISTORY +++ b/HISTORY @@ -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 diff --git a/MY-BASIC Quick Reference.pdf b/MY-BASIC Quick Reference.pdf index 4f52f03..9df0fda 100644 Binary files a/MY-BASIC Quick Reference.pdf and b/MY-BASIC Quick Reference.pdf differ diff --git a/core/my_basic.c b/core/my_basic.c index 7383eb3..bf619a2 100755 --- a/core/my_basic.c +++ b/core/my_basic.c @@ -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; diff --git a/output/my_basic.exe b/output/my_basic.exe index eb5f1d8..232ac76 100755 Binary files a/output/my_basic.exe and b/output/my_basic.exe differ diff --git a/output/my_basic_mac b/output/my_basic_mac index 036f64e..39f4b79 100755 Binary files a/output/my_basic_mac and b/output/my_basic_mac differ diff --git a/sample/yard/entity.bas b/sample/yard/entity.bas index 9cb5129..59587c2 100644 --- a/sample/yard/entity.bas +++ b/sample/yard/entity.bas @@ -14,7 +14,7 @@ class entity var dead_handler = nil - def tostring() + def to_string() return "Entity [" + name + "]" enddef diff --git a/sample/yard/goal.bas b/sample/yard/goal.bas index 59049c4..d973055 100644 --- a/sample/yard/goal.bas +++ b/sample/yard/goal.bas @@ -8,7 +8,7 @@ import "entity.bas" class goal(entity) var take_handler = nil - def tostring() + def to_string() return "Goal [" + name + "]" enddef diff --git a/sample/yard/map.bas b/sample/yard/map.bas index fdecea2..5999303 100644 --- a/sample/yard/map.bas +++ b/sample/yard/map.bas @@ -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 diff --git a/sample/yard/monster.bas b/sample/yard/monster.bas index 1d560ba..3335208 100644 --- a/sample/yard/monster.bas +++ b/sample/yard/monster.bas @@ -6,7 +6,7 @@ import "entity.bas" class monster(entity) - def tostring() + def to_string() return "Monster [" + name + "]" enddef endclass diff --git a/sample/yard/npc.bas b/sample/yard/npc.bas index 0f48c42..5950ddb 100644 --- a/sample/yard/npc.bas +++ b/sample/yard/npc.bas @@ -8,7 +8,7 @@ import "entity.bas" class npc(entity) var talk_handler = nil - def tostring() + def to_string() return "NPC [" + name + "]" enddef diff --git a/sample/yard/player.bas b/sample/yard/player.bas index 9c3e2f3..23f54e1 100644 --- a/sample/yard/player.bas +++ b/sample/yard/player.bas @@ -9,7 +9,7 @@ import "utils.bas" class player(entity) var pos = new(point) - def tostring() + def to_string() return "Player [" + name + "]" enddef endclass diff --git a/sample/yard/utils.bas b/sample/yard/utils.bas index e408f7c..fd2a0a7 100644 --- a/sample/yard/utils.bas +++ b/sample/yard/utils.bas @@ -72,7 +72,7 @@ class point var x = 0 var y = 0 - def tostring() + def to_string() return "[" + str(x) + ", " + str(y) + "]" enddef endclass