diff options
-rw-r--r-- | examples/hello.halk | 4 | ||||
-rw-r--r-- | src/lexer.c | 1 |
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); |