We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bc46af9 commit ed5a025Copy full SHA for ed5a025
src/syntux/parser.rs
@@ -125,18 +125,12 @@ impl<'a> Parser<'a> {
125
}
126
}));
127
match result {
128
- Ok(Some(m)) => {
129
- if !sess.has_errors() {
130
- return Ok(m);
131
- }
132
-
133
- if sess.can_reset_errors() {
134
- sess.reset_errors();
135
136
137
- Err(ParserError::ParseError)
+ Ok(Some(m)) if !sess.has_errors() => Ok(m),
+ Ok(Some(m)) if sess.can_reset_errors() => {
+ sess.reset_errors();
+ Ok(m)
138
139
- Ok(None) => Err(ParserError::ParseError),
+ Ok(_) => Err(ParserError::ParseError),
140
Err(..) if path.exists() => Err(ParserError::ParseError),
141
Err(_) => Err(ParserError::ParsePanicError),
142
0 commit comments