From b7575fa0da53da968c5c705b978cb0f7f374916c Mon Sep 17 00:00:00 2001 From: Bazaah Date: Sat, 26 Jun 2021 07:24:57 +0000 Subject: [PATCH] scanner/macros: fix error path syntax --- src/scanner/macros.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/scanner/macros.rs b/src/scanner/macros.rs index 97c892c..4de3a78 100644 --- a/src/scanner/macros.rs +++ b/src/scanner/macros.rs @@ -70,7 +70,7 @@ macro_rules! check { (@priv $buffer:expr, $offset:expr => $( $match:tt )|+) => { match $buffer.get($offset..) { Some(buffer) => check!(@priv buffer => $( $match )|+), - None => check!(@eofck $( $match )|+ ) + None => check!(@eofck $( $match )|+ ), } }; (@priv $buffer:expr => $( $match:tt )|+) => { @@ -81,16 +81,16 @@ macro_rules! check { }; (@priv $buffer:expr, $offset:expr => $( $match:tt )|+, else $error:expr) => { match $buffer.get($offset..) { - Some(buffer) => check!(@priv buffer => $( $match )|+ else $error), - None if check!(@eofck $( $match )|+ ) => Ok(()) - _ => Err($crate::scanner::error::ScanError::UnexpectedEOF) + Some(buffer) => check!(@priv buffer => $( $match )|+, else $error), + None if check!(@eofck $( $match )|+ ) => Ok(()), + _ => Err($crate::scanner::error::ScanError::UnexpectedEOF), } }; (@priv $buffer:expr => $( $match:tt )|+, else $error:expr) => { match $buffer { $( check!(@ptn $match) )|+ => Ok(()), [] => Err($crate::scanner::error::ScanError::UnexpectedEOF), - _ => Err($error) + _ => Err($error), } };