Ignore test commands in parse_functions().

No point in returning a syntax error if the file contains test commands.
This commit is contained in:
Jakob Stoklund Olesen
2016-09-15 16:07:00 -07:00
parent 086bd601a2
commit edc4fff50c

View File

@@ -28,9 +28,7 @@ pub use lexer::Location;
///
/// Any test commands or ISA declarations are ignored.
pub fn parse_functions(text: &str) -> Result<Vec<Function>> {
Parser::new(text)
.parse_function_list()
.map(|list| list.into_iter().map(|(func, _)| func).collect())
parse_test(text).map(|file| file.functions.into_iter().map(|(func, _)| func).collect())
}
/// Parse the entire `text` as a test case file.