aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
blob: 4e368f52e5791b22856d9d3edf5d58df627ed282 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <lyn/lyn.h>
#include <lyn/debug.h>

int main(int argc, char *argv[])
{
	if (argc != 2) {
		error("wrong number of arguments (should be just one for a file)");
		return -1;
	}

	struct lyn lyn = lyn_create();
	if (lyn_init(&lyn)) {
		lyn_destroy(&lyn);
		return -1;
	}

	int ret = lyn_eval_file(&lyn, argv[1]);
	lyn_destroy(&lyn);
	return ret;
}