Skip to main content

eval_input

Function eval_input 

Source
pub fn eval_input(
    input: &str,
    evaluator: &mut Evaluator,
    output: &mut Vec<OutputLine>,
) -> bool
Expand description

Lexes, parses, and evaluates input, appending results to output.

Expression statements have their return value rendered directly with syntax highlighting (unless the value is null). Non-expression statements (declarations, loops, etc.) are evaluated for their side effects only.

Any println / print output captured in Evaluator::output_buffer is flushed into output as OutputLine::Result lines after evaluation.

Returns true if all statements evaluated without error.