Closed erkyrath closed 1 year ago
The compiler silently treats a null byte as end-of-file, which I grudgingly admit is a bug -- it should complain about an illegal control character.
So I guess the answer is that get_next_char()
should return EOF (-1) on end-of-file.
Actually I changed my mind about that. See PR.
Compiling this file:
...leads to a compiler hang. The lexer is looping forever, adding nulls (or something) to the token buffer.
In the old days this would result in a
MAX_QTEXT_SIZE
memory limit error, but we got rid of those, whoops...If you change the quote to a single quote, you instead get:
This implies that it's still getting into a loop but hitting a dict word length limit. (Hard-coded to 64 for some reason -- should that be
MAX_DICT_WORD_SIZE
? Something, anyway.)Looks like a long-standing confusion about whether
get_next_char()
(the two functions of that name) return 0 orEOF
on end-of-file.