| @@ -1,37 +1,47 @@ | | | @@ -1,37 +1,47 @@ |
1 | /* $NetBSD: msg_249.c,v 1.4 2021/07/08 18:02:22 rillig Exp $ */ | | 1 | /* $NetBSD: msg_249.c,v 1.5 2021/07/08 20:11:15 rillig Exp $ */ |
2 | # 3 "msg_249.c" | | 2 | # 3 "msg_249.c" |
3 | | | 3 | |
4 | // Test for message: syntax error '%s' [249] | | 4 | // Test for message: syntax error '%s' [249] |
5 | | | 5 | |
6 | /* | | 6 | /* |
7 | * Cover the grammar rule 'top_level_declaration: error T_SEMI'. | | 7 | * Cover the grammar rule 'top_level_declaration: error T_SEMI'. |
8 | */ | | 8 | */ |
9 | /* expect+1: syntax error '"' [249] */ | | 9 | /* expect+1: syntax error '"' [249] */ |
10 | "syntax error in top_level_declaration"; | | 10 | "syntax error in top_level_declaration"; |
11 | | | 11 | |
12 | /* XXX: This is necessary to recover the yacc parser. */ | | 12 | /* XXX: This is necessary to recover the yacc parser. */ |
13 | int recover_from_semi; | | 13 | int recover_from_semi; |
14 | | | 14 | |
15 | /* | | 15 | /* |
16 | * Cover the grammar rule 'top_level_declaration: error T_RBRACE'. | | 16 | * Cover the grammar rule 'top_level_declaration: error T_RBRACE'. |
17 | */ | | 17 | */ |
18 | /* expect+1: syntax error '"' [249] */ | | 18 | /* expect+1: syntax error '"' [249] */ |
19 | "syntax error in top_level_declaration"} | | 19 | "syntax error in top_level_declaration"} |
20 | | | 20 | |
21 | /* XXX: This is necessary to recover the yacc parser. */ | | 21 | /* XXX: This is necessary to recover the yacc parser. */ |
22 | int recover_from_rbrace; | | 22 | int recover_from_rbrace; |
23 | | | 23 | |
24 | /* | | 24 | /* |
25 | * Before func.c 1.110 from 2021-06-19, lint ran into this: | | 25 | * Before func.c 1.110 from 2021-06-19, lint ran into this: |
26 | * assertion "cstmt->c_kind == kind" failed in end_control_statement | | 26 | * assertion "cstmt->c_kind == kind" failed in end_control_statement |
27 | */ | | 27 | */ |
28 | void | | 28 | void |
29 | function(void) | | 29 | function(void) |
30 | { | | 30 | { |
31 | if (0) | | 31 | if (0) |
32 | ; | | 32 | ; |
33 | ); /* expect: syntax error ')' */ | | 33 | ); /* expect: syntax error ')' */ |
34 | } | | 34 | } |
35 | | | 35 | |
| | | 36 | /* XXX: It is unexpected that this error is not detected. */ |
| | | 37 | "This syntax error is not detected."; |
| | | 38 | |
36 | /* XXX: This is necessary to recover the yacc parser. */ | | 39 | /* XXX: This is necessary to recover the yacc parser. */ |
37 | int recover_from_rparen; | | 40 | double recover_from_rparen; |
| | | 41 | |
| | | 42 | /* Ensure that the declaration after the syntax error is processed. */ |
| | | 43 | double * |
| | | 44 | access_declaration_after_syntax_error(void) |
| | | 45 | { |
| | | 46 | return &recover_from_rparen; |
| | | 47 | } |