Skip to main content

parse_expression

Function parse_expression 

Source
pub fn parse_expression(
    source: Option<&str>,
    segment: &str,
    line: usize,
    column: usize,
) -> Option<SNode>
Expand description

Parse one ${...} hole into an expression whose spans address source.

segment, line, and column come from a harn_lexer::StringSegment::Expression; source is the whole file that segment was lexed from. Pass None only when the containing file is not available — the expression still parses, but its spans stay relative to the hole and must not be used to edit the file.