Closed dc-mak closed 2 weeks ago
This link won't work for most but placing here anyways: https://github.com/GaloisInc/VERSE-Toolchain/issues/106
Continuing the conversation here -- I carefully did not ask that \e
work, just that the error message on a lexer error was better. It sounds like the error message on most lexer errors is better and there's just something about this specific one that avoids the error handling. In that case, well, it's not critical.
@dc-mak the issue comes from the lack of wildcard pattern in s_char_sequence
. The following patch will give the invalid symbol
error:
diff --git a/parsers/c/c_lexer.mll b/parsers/c/c_lexer.mll
index a96016473..5e866dd04 100644
--- a/parsers/c/c_lexer.mll
+++ b/parsers/c/c_lexer.mll
@@ -350,6 +350,8 @@ rule s_char_sequence = parse
x :: xs }
| '"'
{ [] }
+ | _
+ { raise (Error Errors.Cparser_invalid_symbol) }
and magic flags start_of_comment = parse
(* End of the magic comment *)
Though maybe we want a dedicated "invalid string litteral" error?
I swear I tried that. I will add a dedicated invalid string literal error.
I did try it. I just didn't do make install
and make install_cn
🤦
I'm aware that
\e
is not an ISO C character, the issue is that Cerberus is not displaying "illegal character" or a proper error, instead crashing confusingly.This has surprisingly difficult to debug - I tried a few things with no luck