Expose parsing of run commands and trivially use in testing framework
This is necessary to avoid build errors from dead code (and I didn't want to litter all of the structs with `#[allow(dead_code)]` just to remove in a subsequent PR).
This commit is contained in:
@@ -28,7 +28,8 @@
|
||||
|
||||
pub use crate::error::{Location, ParseError, ParseResult};
|
||||
pub use crate::isaspec::{parse_options, IsaSpec};
|
||||
pub use crate::parser::{parse_functions, parse_test, ParseOptions};
|
||||
pub use crate::parser::{parse_functions, parse_run_command, parse_test, ParseOptions};
|
||||
pub use crate::run_command::{Comparison, DataValue, Invocation, RunCommand};
|
||||
pub use crate::sourcemap::SourceMap;
|
||||
pub use crate::testcommand::{TestCommand, TestOption};
|
||||
pub use crate::testfile::{Comment, Details, Feature, TestFile};
|
||||
|
||||
@@ -114,6 +114,13 @@ pub fn parse_test<'a>(text: &'a str, options: ParseOptions<'a>) -> ParseResult<T
|
||||
})
|
||||
}
|
||||
|
||||
/// Parse the entire `text` as a run command.
|
||||
pub fn parse_run_command<'a>(text: &str, signature: &Signature) -> ParseResult<RunCommand> {
|
||||
let _tt = timing::parse_text();
|
||||
let mut parser = Parser::new(text);
|
||||
parser.parse_run_command(signature)
|
||||
}
|
||||
|
||||
pub struct Parser<'a> {
|
||||
lex: Lexer<'a>,
|
||||
|
||||
|
||||
Reference in New Issue
Block a user