Removed macros
This commit is contained in:
parent
0b5ca8ee66
commit
cb10fc8f83
@ -1,5 +1,4 @@
|
||||
mod collected_substring;
|
||||
mod macros;
|
||||
mod stream;
|
||||
|
||||
pub use collected_substring::CollectedSubstring;
|
||||
|
||||
@ -1,39 +0,0 @@
|
||||
#[macro_export]
|
||||
macro_rules! builder_trait_decl {
|
||||
(
|
||||
$scope:vis trait $name:ident
|
||||
$(<
|
||||
$generic0Name:ident $(: $generic0Bound:path)?
|
||||
$(, $genericNName:ident $(: $genericNBound:path)?)* $(,)?
|
||||
>)?
|
||||
$(: $base0:path $(, $baseN:path)*)?
|
||||
{ $($body:tt)* }
|
||||
) => {
|
||||
$scope trait $name
|
||||
<
|
||||
'source, 'pos, P:Pos<'pos>, CS:CollectedSubstring<'source>
|
||||
$(, $generic0Name $(: $generic0Bound)? $(, $genericNName $(: $genericNBound)?)* )?
|
||||
>
|
||||
$(: $base0 $(+ $baseN)*)?
|
||||
{ $($body)* }
|
||||
};
|
||||
|
||||
(
|
||||
$scope:vis trait $name:ident
|
||||
<
|
||||
$lifetime0Name:lifetime $(, $lifetimeNName:lifetime)*
|
||||
$(, $genericNName:ident $(: $genericNBound:path)?)* $(,)?
|
||||
>
|
||||
$(: $base0:path $(, $baseN:path)*)?
|
||||
{ $($body:tt)* }
|
||||
) => {
|
||||
$scope trait $name
|
||||
<
|
||||
'source, 'pos, $lifetime0Name $(, $lifetimeNName)*,
|
||||
P: Pos<'pos>, CS: CollectedSubstring<'source>
|
||||
$(, $genericNName $(: $genericNBound)?)*
|
||||
>
|
||||
$(: $base0 $(+ $baseN)*)?
|
||||
{ $($body)* }
|
||||
};
|
||||
}
|
||||
@ -1,114 +0,0 @@
|
||||
#[macro_export]
|
||||
macro_rules! builder_type_t {
|
||||
(
|
||||
$name:ident
|
||||
$(<
|
||||
$generic0Name:ty $(, $genericNName:ty)* $(,)?
|
||||
>)?
|
||||
|
||||
) => {
|
||||
$name $(:: $path)*
|
||||
<
|
||||
'source, 'pos, P, CS
|
||||
$(, $generic0Name $(, $genericNName)*)?
|
||||
>
|
||||
|
||||
};
|
||||
(
|
||||
$name:ident $(:: $path:ident)*
|
||||
<
|
||||
$lifetime0Name:lifetime $(, $lifetimeNName:lifetime)*
|
||||
$(, $genericNName:ty)* $(,)?
|
||||
>
|
||||
) => {
|
||||
$($path ::)* $name $(:: $path)*
|
||||
<
|
||||
'source, 'pos, $lifetime0Name $(, $lifetimeNName)*,
|
||||
P, CS $(, $genericNName)*
|
||||
>
|
||||
};
|
||||
|
||||
(
|
||||
impl $name:ident $(:: $path:ident)*
|
||||
$(<
|
||||
$generic0Name:ty $(, $genericNName:ty)* $(,)?
|
||||
>)?
|
||||
|
||||
) => {
|
||||
impl $name $(:: $path)*
|
||||
<
|
||||
'source, 'pos, P, CS
|
||||
$(, $generic0Name $(, $genericNName)*)?
|
||||
>
|
||||
|
||||
};
|
||||
(
|
||||
impl $name:ident $(:: $path:ident)*
|
||||
<
|
||||
$lifetime0Name:lifetime $(, $lifetimeNName:lifetime)*
|
||||
$(, $genericNName:ty)* $(,)?
|
||||
>
|
||||
) => {
|
||||
impl $name $(:: $path)*
|
||||
<
|
||||
'source, 'pos, $lifetime0Name $(, $lifetimeNName)*,
|
||||
P, CS $(, $genericNName)*
|
||||
>
|
||||
};
|
||||
|
||||
(
|
||||
&impl $name:ident $(:: $path:ident)*
|
||||
$(<
|
||||
$generic0Name:ty $(, $genericNName:ty)* $(,)?
|
||||
>)?
|
||||
|
||||
) => {
|
||||
&impl $name $(:: $path)*
|
||||
<
|
||||
'source, 'pos, P, CS
|
||||
$(, $generic0Name $(, $genericNName)*)?
|
||||
>
|
||||
|
||||
};
|
||||
(
|
||||
&impl $name:ident $(:: $path:ident)*
|
||||
<
|
||||
$lifetime0Name:lifetime $(, $lifetimeNName:lifetime)*
|
||||
$(, $genericNName:ty)* $(,)?
|
||||
>
|
||||
) => {
|
||||
&impl $name $(:: $path)*
|
||||
<
|
||||
'source, 'pos, $lifetime0Name $(, $lifetimeNName)*,
|
||||
P, CS $(, $genericNName)*
|
||||
>
|
||||
};
|
||||
|
||||
(
|
||||
&mut impl $name:ident $(:: $path:ident)*
|
||||
$(<
|
||||
$generic0Name:ty $(, $genericNName:ty)* $(,)?
|
||||
>)?
|
||||
|
||||
) => {
|
||||
&mut impl $name $(:: $path)*
|
||||
<
|
||||
'source, 'pos, P, CS
|
||||
$(, $generic0Name $(, $genericNName)*)?
|
||||
>
|
||||
|
||||
};
|
||||
(
|
||||
&mut impl $name:ident $(:: $path:ident)*
|
||||
<
|
||||
$lifetime0Name:lifetime $(, $lifetimeNName:lifetime)*
|
||||
$(, $genericNName:ty)* $(,)?
|
||||
>
|
||||
) => {
|
||||
&mut impl $name $(:: $path)*
|
||||
<
|
||||
'source, 'pos, $lifetime0Name $(, $lifetimeNName)*,
|
||||
P, CS $(, $genericNName)*
|
||||
>
|
||||
};
|
||||
}
|
||||
@ -1,3 +0,0 @@
|
||||
mod builder_type_t;
|
||||
mod parser_fn_decl;
|
||||
mod builder_trait_decl;
|
||||
@ -1,130 +0,0 @@
|
||||
#[macro_export]
|
||||
macro_rules! parser_fn_decl {
|
||||
// unknown char type | custom src type ---------------------------------------------------------
|
||||
(
|
||||
$scope:vis fn $name:ident
|
||||
<
|
||||
C=?
|
||||
$(, $lifetimeName:lifetime)*
|
||||
$(, $genericName:ident $(: $genericBound:path)?)*
|
||||
$(,)?
|
||||
>
|
||||
(
|
||||
$srcName:ident : $srcType:ty
|
||||
$(, $argName:ident : $argType:ty)*
|
||||
$(,)?
|
||||
)
|
||||
$(-> $ret:ty)?
|
||||
$body:block
|
||||
) => {
|
||||
$scope fn $name
|
||||
<
|
||||
'source, 'pos,
|
||||
$( $lifetimeName, )*
|
||||
C:Copy, P:Pos<'pos>, CS:CollectedSubstring<'source, C=C>
|
||||
$(, $genericName $(: $genericBound)?)*
|
||||
>
|
||||
(
|
||||
$srcName: $srcType
|
||||
$(, $argName : $argType)*
|
||||
)
|
||||
$(-> $ret)?
|
||||
$body
|
||||
};
|
||||
|
||||
// explicit char type | custom src type ---------------------------------------------------------
|
||||
(
|
||||
$scope:vis fn $name:ident
|
||||
<
|
||||
C=$charType:ty
|
||||
$(, $lifetimeName:lifetime)*
|
||||
$(, $genericName:ident $(: $genericBound:path)?)*
|
||||
$(,)?
|
||||
>
|
||||
(
|
||||
$srcName:ident : $srcType:ty
|
||||
$(, $argName:ident : $argType:ty)*
|
||||
$(,)?
|
||||
)
|
||||
$(-> $ret:ty)?
|
||||
$body:block
|
||||
) => {
|
||||
$scope fn $name
|
||||
<
|
||||
'source, 'pos,
|
||||
$( $lifetimeName, )*
|
||||
P:Pos<'pos>, CS:CollectedSubstring<'source, C=$charType>
|
||||
$(, $genericName $(: $genericBound)?)*
|
||||
>
|
||||
(
|
||||
$srcName: $srcType
|
||||
$(, $argName : $argType)*
|
||||
)
|
||||
$(-> $ret)?
|
||||
$body
|
||||
};
|
||||
|
||||
// unknown char type | default src type --------------------------------------------------------
|
||||
(
|
||||
$scope:vis fn $name:ident
|
||||
<
|
||||
C=?
|
||||
$(, $lifetimeName:lifetime)*
|
||||
$(, $genericName:ident $(: $genericBound:path)?)*
|
||||
$(,)?
|
||||
>
|
||||
(
|
||||
$srcName:ident
|
||||
$(, $argName:ident : $argType:ty)*
|
||||
$(,)?
|
||||
)
|
||||
$(-> $ret:ty)?
|
||||
$body:block
|
||||
) => {
|
||||
$scope fn $name
|
||||
<
|
||||
'source, 'pos,
|
||||
$( $lifetimeName, )*
|
||||
C:Copy, P:Pos<'pos>, CS:CollectedSubstring<'source, C=C>
|
||||
$(, $genericName $(: $genericBound)?)*
|
||||
>
|
||||
(
|
||||
$srcName: &mut impl SourceStream<'source, 'pos, C=C, P=P, CS=CS>
|
||||
$(, $argName : $argType)*
|
||||
)
|
||||
$(-> $ret)?
|
||||
$body
|
||||
};
|
||||
|
||||
// explicit char type | default src type -------------------------------------------------------
|
||||
(
|
||||
$scope:vis fn $name:ident
|
||||
<
|
||||
C=$charType:ty
|
||||
$(, $lifetimeName:lifetime)*
|
||||
$(, $genericName:ident $(: $genericBound:path)?)*
|
||||
$(,)?
|
||||
>
|
||||
(
|
||||
$srcName:ident
|
||||
$(, $argName:ident : $argType:ty)*
|
||||
$(,)?
|
||||
)
|
||||
$(-> $ret:ty)?
|
||||
$body:block
|
||||
) => {
|
||||
$scope fn $name
|
||||
<
|
||||
'source, 'pos,
|
||||
$( $lifetimeName, )*
|
||||
P:Pos<'pos>, CS:CollectedSubstring<'source, C=$charType>
|
||||
$(, $genericName $(: $genericBound)?)*
|
||||
>
|
||||
(
|
||||
$srcName: &mut impl SourceStream<'source, 'pos, C=$charType, P=P, CS=CS>
|
||||
$(, $argName : $argType)*
|
||||
)
|
||||
$(-> $ret)?
|
||||
$body
|
||||
};
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user