mirror of
https://github.com/krgamestudios/Toy.git
synced 2026-04-15 14:54:07 +10:00
Added indexing to strings, tests still needed
This commit is contained in:
@@ -22,6 +22,7 @@ int test_sizeof_ast_64bit() {
|
||||
TEST_SIZEOF(Toy_AstBinary, 24);
|
||||
TEST_SIZEOF(Toy_AstCompare, 24);
|
||||
TEST_SIZEOF(Toy_AstGroup, 16);
|
||||
TEST_SIZEOF(Toy_AstCompound, 24);
|
||||
TEST_SIZEOF(Toy_AstPrint, 16);
|
||||
TEST_SIZEOF(Toy_AstVarDeclare, 24);
|
||||
TEST_SIZEOF(Toy_AstVarAssign, 24);
|
||||
@@ -54,6 +55,7 @@ int test_sizeof_ast_32bit() {
|
||||
TEST_SIZEOF(Toy_AstBinary, 16);
|
||||
TEST_SIZEOF(Toy_AstCompare, 16);
|
||||
TEST_SIZEOF(Toy_AstGroup, 8);
|
||||
TEST_SIZEOF(Toy_AstCompound, 16);
|
||||
TEST_SIZEOF(Toy_AstPrint, 8);
|
||||
TEST_SIZEOF(Toy_AstVarDeclare, 12);
|
||||
TEST_SIZEOF(Toy_AstVarAssign, 16);
|
||||
|
||||
@@ -13,6 +13,11 @@ print "Hello" .. "world!";
|
||||
//print with escaped characters
|
||||
print "\tHello\nworld";
|
||||
|
||||
//print from a leaf string
|
||||
print "Hello world"[0,5];
|
||||
|
||||
print ("hello" .. "world")[2,6];
|
||||
|
||||
//TODO: in the repl, -s to supress output, or -d to print debugging info
|
||||
|
||||
//TODO: the `assert` keyword will be useful for these
|
||||
|
||||
Reference in New Issue
Block a user