You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
376 B
C

#include <parser.h>
#include <stdio.h>
void test(stack_t *stack)
{
printf("%s\n", stack[0]);
}
int main(int argc, char *argv[])
{
interpreter interp;
interpreter_init(&interp);
interpreter_define_value(&interp, "answer", 42);
interpreter_define_cfunc(&interp, "test", test);
if (argc == 2) {
printf("%d\n", interpreter_doline(&interp, argv[1]));
}
return 0;
}