mirror of
https://github.com/krgamestudios/Toy.git
synced 2026-04-15 14:54:07 +10:00
Tweaked some APIs, hid some functions I don't want in the API
This commit is contained in:
@@ -39,7 +39,7 @@ int main() {
|
||||
Toy_writeCompiler(&compiler, node);
|
||||
|
||||
//collate
|
||||
int size = 0;
|
||||
size_t size = 0;
|
||||
unsigned char* bytecode = Toy_collateCompiler(&compiler, &size);
|
||||
|
||||
//cleanup
|
||||
@@ -78,7 +78,7 @@ int main() {
|
||||
}
|
||||
|
||||
//collate
|
||||
int size = 0;
|
||||
size_t size = 0;
|
||||
unsigned char* bytecode = Toy_collateCompiler(&compiler, &size);
|
||||
|
||||
//cleanup
|
||||
|
||||
@@ -87,7 +87,7 @@ int main() {
|
||||
Toy_writeCompiler(&compiler, node);
|
||||
|
||||
//collate
|
||||
int size = 0;
|
||||
size_t size = 0;
|
||||
const unsigned char* bytecode = Toy_collateCompiler(&compiler, &size);
|
||||
|
||||
//NOTE: suppress print output for testing
|
||||
|
||||
@@ -15,10 +15,10 @@ int main() {
|
||||
Toy_initLexer(&lexer, source);
|
||||
|
||||
//get each token
|
||||
Toy_Token print = Toy_scanLexer(&lexer);
|
||||
Toy_Token null = Toy_scanLexer(&lexer);
|
||||
Toy_Token semi = Toy_scanLexer(&lexer);
|
||||
Toy_Token eof = Toy_scanLexer(&lexer);
|
||||
Toy_Token print = Toy_private_scanLexer(&lexer);
|
||||
Toy_Token null = Toy_private_scanLexer(&lexer);
|
||||
Toy_Token semi = Toy_private_scanLexer(&lexer);
|
||||
Toy_Token eof = Toy_private_scanLexer(&lexer);
|
||||
|
||||
//test each token is correct
|
||||
if (strncmp(print.lexeme, "print", print.length)) {
|
||||
|
||||
@@ -50,7 +50,7 @@ const unsigned char* compileStringCustom(const char* source, size_t* size) {
|
||||
}
|
||||
|
||||
//get the bytecode dump
|
||||
const unsigned char* tb = Toy_collateCompiler(&compiler, (int*)(size));
|
||||
const unsigned char* tb = Toy_collateCompiler(&compiler, size);
|
||||
|
||||
//cleanup
|
||||
Toy_freeCompiler(&compiler);
|
||||
|
||||
Reference in New Issue
Block a user