| ... | ... | @@ -937,14 +937,17 @@ const Parser = struct { |
| 937 | 937 | /// If a parse error occurs, reports an error, but then finds the next statement |
| 938 | 938 | /// and returns that one instead. If a parse error occurs but there is no following |
| 939 | 939 | /// statement, returns 0. |
| 940 | | fn expectStatementRecoverable(p: *Parser) error{OutOfMemory}!Node.Index { |
| 940 | fn expectStatementRecoverable(p: *Parser) Error!Node.Index { |
| 941 | 941 | while (true) { |
| 942 | 942 | return p.expectStatement() catch |err| switch (err) { |
| 943 | 943 | error.OutOfMemory => return error.OutOfMemory, |
| 944 | 944 | error.ParseError => { |
| 945 | 945 | p.findNextStmt(); // Try to skip to the next statement. |
| 946 | | if (p.token_tags[p.tok_i] == .r_brace) return null_node; |
| 947 | | continue; |
| 946 | switch (p.token_tags[p.tok_i]) { |
| 947 | .r_brace => return null_node, |
| 948 | .eof => return error.ParseError, |
| 949 | else => continue, |
| 950 | } |
| 948 | 951 | }, |
| 949 | 952 | }; |
| 950 | 953 | } |