2
0
Эх сурвалжийг харах

Short-circuit `comment_scope` if there's an error

This makes debugging easier because you can see what parser the error
originated in more easily
Isaac Woods 5 жил өмнө
parent
commit
3697db1856

+ 3 - 2
aml_parser/src/parser.rs

@@ -127,9 +127,10 @@ where
 {
     move |input| {
         trace!("--> {}", scope_name);
-        let result = parser.parse(input);
+        // Return if the parse fails, so we don't print the tail. Makes it easier to debug.
+        let (new_input, result) = parser.parse(input)?;
         trace!("<-- {}", scope_name);
-        result
+        Ok((new_input, result))
     }
 }