Closed rscwn closed 1 week ago
Having this issue too!
This function has been untouched for two and a half years. Even then, the code existed before that in different places and implementation is byte for byte identical since day 1.
I'm not sure I understand how ch == '\t'
is being replaced with ch == ' '
but it looks like some buggy software on your end is making this replacement. ch == ' '
is not even valid C or C++ anyhow.
It appears there was a change to the Lexer which made it so '\t' ( tabs ) are no longer handled in favor of 4 spaces, this creates issues with luau scripts that use tabs, leading to compiler errors like the following
:5: Expected identifier when parsing expression, got ' '
Or in my case crashes within my engine as I wasn't properly handling the compiler errors.
After some debugging I found the culprit for this is the function called isSpace located in Lexer.h:263
Here's the function from an older luau version for reference
And here it is in the current one
Fixing this is very simple, just revert to the older function.
Id also like to add, the change is useless, as in my research on the lexer, the 4 spaces are always handled by the first case (
ch == ' '
), just separately char by char, and thus the second case (ch == ' '
<- 4 spaces, just github wont properly show it. ) is never reached and cannot be.