mirror of
https://github.com/ProvableHQ/leo.git
synced 2024-12-24 02:31:44 +03:00
fixed ci
This commit is contained in:
parent
d25eb79594
commit
82ce58544b
@ -48,8 +48,8 @@ fn main() -> Result<(), String> {
|
||||
let input_tree = create_session_if_not_set_then(|_| {
|
||||
Handler::with(|handler| {
|
||||
let input =
|
||||
leo_parser::parse_program_inputs(&handler, input_string.clone(), opt.input_path.to_str().unwrap())?;
|
||||
Ok(input.to_json_string()?)
|
||||
leo_parser::parse_program_inputs(handler, input_string.clone(), opt.input_path.to_str().unwrap())?;
|
||||
input.to_json_string()
|
||||
})
|
||||
.map_err(|e| e.to_string())
|
||||
})?;
|
||||
|
@ -47,7 +47,7 @@ fn main() -> Result<(), String> {
|
||||
// Parses the Leo file constructing an ast which is then serialized.
|
||||
let serialized_leo_tree = create_session_if_not_set_then(|_| {
|
||||
Handler::with(|h| {
|
||||
let ast = leo_parser::parse_ast(&h, opt.input_path.to_str().unwrap(), &code)?;
|
||||
let ast = leo_parser::parse_ast(h, opt.input_path.to_str().unwrap(), &code)?;
|
||||
let json = Ast::to_json_string(&ast)?;
|
||||
println!("{}", json);
|
||||
Ok(json)
|
||||
|
@ -221,29 +221,27 @@ impl<'a> ParserContext<'a> {
|
||||
}
|
||||
|
||||
let second = self.peek_group_coordinate(&mut i)?;
|
||||
let right_paren_span;
|
||||
i = i.checked_sub(1)?;
|
||||
if let Some(SpannedToken {
|
||||
let right_paren_span = if let Some(SpannedToken {
|
||||
token: Token::RightParen,
|
||||
span,
|
||||
}) = self.tokens.get(i)
|
||||
{
|
||||
right_paren_span = span.clone();
|
||||
span.clone()
|
||||
} else {
|
||||
return None;
|
||||
}
|
||||
};
|
||||
|
||||
let end_span;
|
||||
i = i.checked_sub(1)?;
|
||||
if let Some(SpannedToken {
|
||||
let end_span = if let Some(SpannedToken {
|
||||
token: Token::Group,
|
||||
span,
|
||||
}) = self.tokens.get(i)
|
||||
{
|
||||
end_span = span.clone();
|
||||
span.clone()
|
||||
} else {
|
||||
return None;
|
||||
}
|
||||
};
|
||||
|
||||
self.tokens.drain(i..);
|
||||
if let Err(e) = assert_no_whitespace(
|
||||
|
@ -422,7 +422,7 @@ impl Token {
|
||||
eol + 4
|
||||
} else {
|
||||
return Err(ParserError::lexer_block_comment_does_not_close_before_eof(
|
||||
String::from_utf8_lossy(&input),
|
||||
String::from_utf8_lossy(input),
|
||||
)
|
||||
.into());
|
||||
};
|
||||
@ -515,7 +515,7 @@ impl Token {
|
||||
));
|
||||
}
|
||||
|
||||
Err(ParserError::could_not_lex(String::from_utf8_lossy(&input)).into())
|
||||
Err(ParserError::could_not_lex(String::from_utf8_lossy(input)).into())
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -238,8 +238,8 @@ impl TryFrom<&Path> for Manifest {
|
||||
// Fetch the author from the old remote.
|
||||
let remote_author = old_remote
|
||||
.split('/') // Split the old remote as '"{author}' and '{package_name}"'
|
||||
.nth(0).unwrap() // Fetch just the '"{author}'
|
||||
.replace(&['\"', ' '], ""); // Remove the quotes from the author string
|
||||
.next().unwrap() // Fetch just the '"{author}'
|
||||
.replace(['\"', ' '].as_slice(), ""); // Remove the quotes from the author string
|
||||
|
||||
// Construct the new remote section.
|
||||
let new_remote = format!(
|
||||
|
@ -21,7 +21,7 @@ use tendril::StrTendril;
|
||||
|
||||
/// Serialization for the StrTendril type.
|
||||
pub fn serialize<S: Serializer>(tendril: &StrTendril, serializer: S) -> Result<S::Ok, S::Error> {
|
||||
serializer.serialize_str(&tendril)
|
||||
serializer.serialize_str(tendril)
|
||||
}
|
||||
|
||||
/// Deserialization for the StrTendril type.
|
||||
|
@ -70,14 +70,7 @@ fn take_hook(
|
||||
output: Result<Result<Value, String>, Box<dyn Any + Send>>,
|
||||
panic_buf: Arc<Mutex<Option<String>>>,
|
||||
) -> Result<Result<Value, String>, String> {
|
||||
output.map_err(|_| {
|
||||
panic_buf
|
||||
.lock()
|
||||
.unwrap()
|
||||
.take()
|
||||
.expect("failed to get panic message")
|
||||
.clone()
|
||||
})
|
||||
output.map_err(|_| panic_buf.lock().unwrap().take().expect("failed to get panic message"))
|
||||
}
|
||||
|
||||
pub fn run_tests<T: Runner>(runner: &T, expectation_category: &str) {
|
||||
|
Loading…
Reference in New Issue
Block a user