pub struct FunctionCallParser<R> {
pub function_name_rule: R,
pub function_arguments_rule: R,
pub keyword_argument_rule: R,
pub argument_name_rule: R,
pub argument_value_rule: R,
}
Expand description
Helper to parse function call.
Fields§
§function_name_rule: R
Function name.
function_arguments_rule: R
List of positional and keyword arguments.
keyword_argument_rule: R
Pair of parameter name and value.
argument_name_rule: R
Parameter name.
argument_value_rule: R
Value expression.
Implementations§
Source§impl<R: RuleType> FunctionCallParser<R>
impl<R: RuleType> FunctionCallParser<R>
Sourcepub fn parse<'i, T, E: From<InvalidArguments<'i>>>(
&self,
pair: Pair<'i, R>,
parse_name: impl Fn(Pair<'i, R>) -> Result<&'i str, E>,
parse_value: impl Fn(Pair<'i, R>) -> Result<ExpressionNode<'i, T>, E>,
) -> Result<FunctionCallNode<'i, T>, E>
pub fn parse<'i, T, E: From<InvalidArguments<'i>>>( &self, pair: Pair<'i, R>, parse_name: impl Fn(Pair<'i, R>) -> Result<&'i str, E>, parse_value: impl Fn(Pair<'i, R>) -> Result<ExpressionNode<'i, T>, E>, ) -> Result<FunctionCallNode<'i, T>, E>
Parses the given pair
as function call.
Trait Implementations§
Auto Trait Implementations§
impl<R> Freeze for FunctionCallParser<R>where
R: Freeze,
impl<R> RefUnwindSafe for FunctionCallParser<R>where
R: RefUnwindSafe,
impl<R> Send for FunctionCallParser<R>where
R: Send,
impl<R> Sync for FunctionCallParser<R>where
R: Sync,
impl<R> Unpin for FunctionCallParser<R>where
R: Unpin,
impl<R> UnwindSafe for FunctionCallParser<R>where
R: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more