pub struct Call {
pub name: LitSym,
pub derivatives: u8,
pub args: Vec<Expr>,
pub span: Range<usize>,
pub paren_span: Range<usize>,
}Expand description
A function call, such as func(x, -40).
Fields§
§name: LitSymThe name of the function to call.
derivatives: u8The number of derivatives to take before calling the function.
args: Vec<Expr>The arguments to the function.
span: Range<usize>The region of the source code that this function call was parsed from.
paren_span: Range<usize>The span of the parentheses that surround the arguments.
Implementations§
Source§impl Call
impl Call
Sourcepub fn arg_span(&self, args: Range<usize>) -> Range<usize>
pub fn arg_span(&self, args: Range<usize>) -> Range<usize>
Returns a span that spans the selected arguments, given by index.
Sourcepub fn outer_span(&self) -> [Range<usize>; 2]
pub fn outer_span(&self) -> [Range<usize>; 2]
Returns a set of two spans, where the first is the span of the function name (with the opening parenthesis) and the second is the span of the closing parenthesis.
Sourcepub fn parse_or_lower(
input: &mut Parser<'_>,
recoverable_errors: &mut Vec<Error>,
target: Primary,
) -> Result<(Primary, bool), Vec<Error>>
pub fn parse_or_lower( input: &mut Parser<'_>, recoverable_errors: &mut Vec<Error>, target: Primary, ) -> Result<(Primary, bool), Vec<Error>>
Attempts to parse a Call, where the initial target has already been parsed.
Besides the returned Primary, the return value also includes a boolean that indicates
if the expression was changed due to successfully parsing a Call. This function can
return Ok even if no Call, which occurs when we determine that we shouldn’t have
taken the Call path. The boolean is used to let the caller know that this is was the
case.
This is similar to what we had to do with Binary.
Trait Implementations§
Source§impl Latex for Call
impl Latex for Call
Source§fn as_display(&self) -> LatexFormatter<'_, Self>
fn as_display(&self) -> LatexFormatter<'_, Self>
LatexFormatter, which implements Display.