Function rubble_templates::evaluator::ast::parse_ast[][src]

pub fn parse_ast(source: &str) -> SyntaxNode
Expand description

Used for parsing AST for further evaluation.

This function tries to parse AST assuming it is Lisp-like syntax, which is practically function arg0 arg1 arg2, where function is the function name, and arg0... are the arguments.

It also allows to use parenthesis to evaluate a nested function.

Reserved characters (cannot be used in names):

  • - space
  • ( - left parenthesis
  • ) - right parenthesis

Examples:

  • (function 1 2 3) - interpreted as function call with parameters 1, 2 and 3
  • plus 1 2 (times 3 4) - interpreted as 1 + 2 + (3 * 4), given plus is an addition function and times is a multiplication function