aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorc+12023-05-13 15:16:16 -0400
committerc+12023-05-13 15:16:16 -0400
commit8f5856e86e50429d1b28039ba3d876af616a5279 (patch)
tree169f5cf15844bf6a4b148a9f0bfd341469f1baaa
parent4ef8aec33057b28ece6168347eb847373fa695b3 (diff)
_/|\_
-rw-r--r--examples/hello.halk4
-rw-r--r--src/lexer.c1
2 files changed, 3 insertions, 2 deletions
diff --git a/examples/hello.halk b/examples/hello.halk
index f6a7c9f..06a3d95 100644
--- a/examples/hello.halk
+++ b/examples/hello.halk
@@ -23,7 +23,7 @@ fn.sum_all,_ -> { [variadic functions are
};
fn.fibonacci,n -> {
- if.or.(=.n, 0), (=.n, 1) -> { [functions ending in '?' should be predicates]
+ if.or.(eq.n, 0), (eq.n, 1) -> { [functions ending in '?' should be predicates]
return.1;
};
return.sum.
@@ -32,6 +32,6 @@ fn.fibonacci,n -> {
};
fn.main -> { [where our code will begin executing]
- greeting.[comments can be placed *anywhere*]"world.";
+ greeting.[comments can be placed *anywhere*]'world.';
exit.0; [exit with code 0 for success]
};
diff --git a/src/lexer.c b/src/lexer.c
index 0cef0c9..557fd1f 100644
--- a/src/lexer.c
+++ b/src/lexer.c
@@ -119,6 +119,7 @@ token_t* lexer_get_next_token(lexer_t* lexer) {
lexer_get_c_as_string(lexer)
)
); break;
+ case '\0': return token_init(TOKEN_END, lexer_get_c_as_string(lexer)); break;
default:
fputs("Unrecognized token.", stderr);
exit(1);