Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow trailing commas in error_node_position and in error_position macros #1711

Merged
merged 2 commits into from
May 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/error.rs
Expand Up @@ -278,7 +278,7 @@
}
}

use crate::internal::{Err, IResult};

Check warning on line 281 in src/error.rs

View workflow job for this annotation

GitHub Actions / Test (nightly, --no-default-features)

unused import: `IResult`

Check warning on line 281 in src/error.rs

View workflow job for this annotation

GitHub Actions / Test (nightly, --no-default-features)

unused import: `IResult`

Check warning on line 281 in src/error.rs

View workflow job for this annotation

GitHub Actions / Test (stable, --no-default-features)

unused import: `IResult`

Check warning on line 281 in src/error.rs

View workflow job for this annotation

GitHub Actions / Test (stable, --no-default-features)

unused import: `IResult`

Check warning on line 281 in src/error.rs

View workflow job for this annotation

GitHub Actions / Test (nightly, --no-default-features --features "alloc")

unused import: `IResult`

Check warning on line 281 in src/error.rs

View workflow job for this annotation

GitHub Actions / Test (nightly, --no-default-features --features "alloc")

unused import: `IResult`

Check warning on line 281 in src/error.rs

View workflow job for this annotation

GitHub Actions / Test (stable, --no-default-features --features "alloc")

unused import: `IResult`

Check warning on line 281 in src/error.rs

View workflow job for this annotation

GitHub Actions / Test (stable, --no-default-features --features "alloc")

unused import: `IResult`

/// Create a new error from an input position, a static string and an existing error.
/// This is used mainly in the [context] combinator, to add user friendly information
Expand Down Expand Up @@ -632,7 +632,7 @@
#[allow(unused_variables)]
#[macro_export(local_inner_macros)]
macro_rules! error_position(
($input:expr, $code:expr) => ({
($input:expr, $code:expr $(,)?) => ({
$crate::error::make_error($input, $code)
});
);
Expand All @@ -643,7 +643,7 @@
#[allow(unused_variables)]
#[macro_export(local_inner_macros)]
macro_rules! error_node_position(
($input:expr, $code:expr, $next:expr) => ({
($input:expr, $code:expr, $next:expr $(,)?) => ({
$crate::error::append_error($input, $code, $next)
});
);
Expand Down Expand Up @@ -691,7 +691,7 @@
#[cfg(test)]
mod tests {
use super::*;
use crate::character::complete::char;

Check warning on line 694 in src/error.rs

View workflow job for this annotation

GitHub Actions / Test (nightly, --no-default-features)

unused import: `crate::character::complete::char`

Check warning on line 694 in src/error.rs

View workflow job for this annotation

GitHub Actions / Test (stable, --no-default-features)

unused import: `crate::character::complete::char`

#[test]
fn context_test() {
Expand Down