Quellcode durchsuchen

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 vor 5 Jahren
Ursprung
Commit
3697db1856
1 geänderte Dateien mit 3 neuen und 2 gelöschten Zeilen
  1. 3 2
      aml_parser/src/parser.rs

+ 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))
     }
 }