1
0
mirror of https://github.com/golang/go synced 2024-11-12 08:40:21 -07:00

better recovery after syntax error

SVN=126003
This commit is contained in:
Ken Thompson 2008-07-03 18:05:20 -07:00
parent 81b325db1b
commit 1efa6a0544

View File

@ -148,6 +148,14 @@ xdcl:
{ {
$$ = N; $$ = N;
} }
| error '}'
{
$$ = N;
}
| error ';'
{
$$ = N;
}
common_dcl: common_dcl:
Acommon_dcl Acommon_dcl
@ -1194,6 +1202,14 @@ Astmt:
{ {
$$ = N; $$ = N;
} }
| error ';'
{
$$ = N;
}
| error '}'
{
$$ = N;
}
/* /*
* need semi in front NO * need semi in front NO
@ -1262,10 +1278,6 @@ Bstmt_list_r:
stmt_list_r: stmt_list_r:
Astmt_list_r Astmt_list_r
| Bstmt_list_r | Bstmt_list_r
| error ';'
{
$$ = N;
}
expr_list_r: expr_list_r:
expr expr