Function rubble_templates_evaluators::parser::parse_ast [−][src]
pub fn parse_ast(source: &str, code_start: &str, code_end: &str) -> SyntaxNode
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):
(
- left parenthesis)
- right parenthesis
Examples:
(function 1 2 3)
- interpreted asfunction
call with parameters1
,2
and3
plus 1 2 (times 3 4)
- interpreted as1 + 2 + (3 * 4)
, givenplus
is an addition function andtimes
is a multiplication function