Skip to content

Commit

Permalink
scan: Treat carriage-return as whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelforney committed Mar 25, 2024
1 parent 05231ae commit cc68417
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -281,8 +281,9 @@ scankind(struct scanner *s, struct location *loc)
switch (s->chr) {
case ' ':
case '\t':
case '\f':
case '\v':
case '\f':
case '\r':
s->sawspace = true;
nextchar(s);
goto again;
Expand Down
3 changes: 3 additions & 0 deletions test/crnl.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
int main(void) {
return 0;
}
6 changes: 6 additions & 0 deletions test/crnl.qbe
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export
function w $main() {
@start.1
@body.2
ret 0
}

0 comments on commit cc68417

Please sign in to comment.