mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-14 14:03:58 +00:00
parse_util: deduplicate append_syntax_error macro
This commit is contained in:
parent
56ad7fe0e5
commit
07cc33e7aa
1 changed files with 3 additions and 9 deletions
|
@ -1166,15 +1166,9 @@ macro_rules! append_syntax_error {
|
|||
$(, $arg:expr)* $(,)?
|
||||
) => {
|
||||
{
|
||||
if let Some(ref mut errors) = $errors {
|
||||
let mut error = ParseError::default();
|
||||
error.source_start = $source_location;
|
||||
error.source_length = $source_length;
|
||||
error.code = ParseErrorCode::syntax;
|
||||
error.text = wgettext_fmt!($fmt $(, $arg)*);
|
||||
errors.push(error);
|
||||
}
|
||||
true
|
||||
append_syntax_error_formatted!(
|
||||
$errors, $source_location, $source_length,
|
||||
wgettext_fmt!($fmt $(, $arg)*))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue