From db55ea657e1edcb5d7da3dd90e4dc6b7643bbfe0 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Mon, 19 Apr 2021 22:38:59 +0200 Subject: 8051 is awesome --- src/parser.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 src/parser.c (limited to 'src/parser.c') diff --git a/src/parser.c b/src/parser.c new file mode 100644 index 0000000..e4d0251 --- /dev/null +++ b/src/parser.c @@ -0,0 +1,24 @@ +#include +#include +#include +#include + +#define PEEK(hay, needle) (strcmp(hay, needle) == 0) + +u8 parse(char *buf, u32 size) +{ + u32 line = 0; + + for (u32 i = 0; i < size; i++) { + /* printf("'%c'\n", buf[i]); */ + if (buf[i] == '\0') + break; + + if (buf[i] == '\n') { + line++; + continue; + } + } + + return 1; +} -- cgit v1.2.3