This commit is contained in:
cozis
2022-01-22 02:06:24 +01:00
parent 7f29b7c01a
commit 3df0cc0a7d
3 changed files with 37 additions and 7 deletions
+24
View File
@@ -103,11 +103,35 @@ static int parse_args(Options *opts, int argc, char **argv, Error *error)
return i;
}
#include "buildvalue.h"
int main(int argc, char **argv)
{
Error error;
Error_Init(&error);
{
Heap *heap = Heap_New(-1);
if(heap == NULL)
{
fprintf(stderr, "ERROR: Failed to create heap.\n");
return -1;
}
Object *o = buildValue(heap, &error, "${ return 3+1; }");
if(o == NULL)
{
fprintf(stderr, "ERROR: %s.\n", error.message);
return -1;
}
Object_Print(o, stdout);
Heap_Free(heap);
}
// Parse command line options.