소스 검색

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 6 년 전
부모
커밋
3697db1856
1개의 변경된 파일3개의 추가작업 그리고 2개의 파일을 삭제
  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))
     }
 }