Closed Mesabloo closed 4 years ago
At the moment, the lexer allows the following:
' '
which is definetely an error. This is because of how character lexing is handled in the compiler (see https://github.com/nihil-lang/nsc/blob/6b7304210ceb0d583304a860c2dc303bb40e7aa4/lib/nsc-parser/src/Language/NStar/Syntax/Lexer.hs#L157) where MP.anySingle accepts any character. We instead want to reject any end of line character (\n or \r). We could really use MP.satisfy (not . isNewline) instead, this should be a quick fix.
MP.anySingle
\n
\r
MP.satisfy (not . isNewline)
The test https://github.com/nihil-lang/nsc/blob/develop/test/error_lx_eolChar.nst should pass when it is fixed.
Fixed by 033c7d714bd1100d7acdf959ddd3401d7e340482 on branch develop.
At the moment, the lexer allows the following:
which is definetely an error. This is because of how character lexing is handled in the compiler (see https://github.com/nihil-lang/nsc/blob/6b7304210ceb0d583304a860c2dc303bb40e7aa4/lib/nsc-parser/src/Language/NStar/Syntax/Lexer.hs#L157) where
MP.anySingle
accepts any character. We instead want to reject any end of line character (\n
or\r
). We could really useMP.satisfy (not . isNewline)
instead, this should be a quick fix.The test https://github.com/nihil-lang/nsc/blob/develop/test/error_lx_eolChar.nst should pass when it is fixed.