aboutsummaryrefslogtreecommitdiff
path: root/src/parser.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/parser.c')
-rw-r--r--src/parser.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/parser.c b/src/parser.c
index c692794..87690c8 100644
--- a/src/parser.c
+++ b/src/parser.c
@@ -11,12 +11,19 @@
#define BUFSIZE 1024
+
static void skip_spaces(Parser *parser) {
while (isspace(Parser_peek(parser))) {
Parser_getchar(parser);
}
}
+bool Parser_is_end(Parser *parser) {
+ skip_spaces(parser);
+ if (Parser_peek(parser) == EOF) return true;
+ return false;
+}
+
ParseResult ParseOk(SExpRef ref) {
return (ParseResult){ .val = ref, .errmsg = NULL };
}