summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/fwdscript.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/fwdscript.c b/src/fwdscript.c
index 3ee7449..c524810 100644
--- a/src/fwdscript.c
+++ b/src/fwdscript.c
@@ -240,7 +240,8 @@ struct fwdtoken {
FWDTOKEN_OPEN,
FWDTOKEN_CLOSE,
FWDTOKEN_TO,
- FWDTOKEN_END
+ FWDTOKEN_END,
+ FWDTOKEN_EOL
} kind;
size_t line;
@@ -265,6 +266,17 @@ static int fwdscript_tokenize(struct fwdtokens *tokens, const char *buf)
break;
if (*tok == '\n') {
+ struct fwdtoken eol = {
+ .kind = FWDTOKEN_EOL,
+ .line = line,
+ .s = NULL
+ };
+
+ if (!fwdtokens_append(tokens, eol)) {
+ fprintf(stderr, "failed appending eol token\n");
+ return -1;
+ }
+
line += 1;
start = tok + 1;
continue;