Improve error reporting for unexpected non-newline

This commit is contained in:
Sanne Wouda 2021-01-05 21:46:51 +00:00
parent 49fbe8942f
commit 63bb59404d
3 changed files with 17 additions and 7 deletions

View File

@ -311,7 +311,17 @@ void preprocess()
{
macro_directive();
if (macro_token)
require('\n' == macro_token->s[0], "newline expected at end of macro directive\n");
{
if ('\n' != macro_token->s[0])
{
line_error_token(macro_token);
file_print("newline expected at end of macro directive\n", stderr);
file_print("found: '", stderr);
file_print(macro_token->s, stderr);
file_print("'\n", stderr);
exit(EXIT_FAILURE);
}
}
}
else if ('\n' == macro_token->s[0])
{

View File

@ -169,8 +169,8 @@ a2a83f42119e646b389b98647cf6cf2aa9597185997c9453db746178c8c4c0bf test/results/t
698853b79efb30865a663c4863c050639eb21c7400008f7840830503928973d4 test/results/test0106-knight-native-binary
45c2ba61dc209d7ffa39de9ff0f0a7f8f3ea4d7e38598c72f982fcaf9a05c84a test/results/test0106-knight-posix-binary
944580ff4aae38aafac139faf6eed5bfe4ff68b01a7a3adfa346de8803101182 test/results/test0106-x86-binary
05da67e8b98c17fe19028b926f8f4a56fd162b6de54711cb2ae260632c129f0c test/results/test1000-aarch64-binary
211f04faefb5dd1f162e519641bed7e055f9147a0e3ef37ec86b84d4e1847664 test/results/test1000-amd64-binary
c38946118ad95309cd628f0e1b108507556f1c733b2ccb95a8235f9e99b18788 test/results/test1000-armv7l-binary
6417efad2ab83ea297e319b2ee4d9ba78bae0e6c18eed78115f4a8ae93eb1419 test/results/test1000-knight-posix-binary
0565d906bf7f962df0bb3b7c5020fb8f4f47aad0654279f8937c08815445e9f0 test/results/test1000-x86-binary
0f0f720afa507a5af54ede8dc6058d8bb43d96b66b67d799374a4e9edc3e0a95 test/results/test1000-aarch64-binary
ac9e489a722bd962a47b8c170af4c3cd48c3fc5e1242865fb5a3f499f0651a45 test/results/test1000-amd64-binary
91946f5ad9efb22fb7ff106bfe74908b844f10716bf3c5fcfcb6f136146486d6 test/results/test1000-armv7l-binary
9f2764138869574ab2ccb688cb2b296fc6878d609a2079bf779440a18af966b9 test/results/test1000-knight-posix-binary
685f353b97f09bd723d035960c882e8ba793c88641716a8a4f2132bdad2f6f05 test/results/test1000-x86-binary

View File

@ -1 +1 @@
3e0fb1cf49b0f2a14f4f0dbd213d5b8c5a46d4372a409924fa4996d84bd5d3f8 test/test1000/proof
730281bc277d68d0afc81644fea430660e4dd35762ed482bdbb0c9c733cb4baa test/test1000/proof