projects
/
onyx.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7f3294f
)
added: error message for unclosed character literal
author
Brendan Hansen
<brendan.f.hansen@gmail.com>
Wed, 8 Mar 2023 14:02:04 +0000
(08:02 -0600)
committer
Brendan Hansen
<brendan.f.hansen@gmail.com>
Wed, 8 Mar 2023 14:02:04 +0000
(08:02 -0600)
compiler/src/lex.c
patch
|
blob
|
history
diff --git
a/compiler/src/lex.c
b/compiler/src/lex.c
index 3e4a91c758e5ba5391b48fad2227ea553856ac1a..7bf9aa1fec322f129057816ee83e5745f2b54a8b 100644
(file)
--- a/
compiler/src/lex.c
+++ b/
compiler/src/lex.c
@@
-255,9
+255,11
@@
whitespace_skipped:
while (!(*tokenizer->curr == ch && slash_count == 0)) {
len++;
- // if (*tokenizer->curr == '\n') {
- // onyx_report_error(tk.pos, "String literal not terminated by end of line.");
- // }
+ if (*tokenizer->curr == '\n' && ch == '\'') {
+ tk.pos.length = (u16) len;
+ onyx_report_error(tk.pos, Error_Critical, "Character literal not terminated by end of line.");
+ break;
+ }
if (*tokenizer->curr == '\\') {
slash_count += 1;