wduquette / molt

Embeddable TCL Interpreter for Rust applications
BSD 3-Clause "New" or "Revised" License
103 stars 12 forks source link

Cache parsed scripts #46

Closed wduquette closed 4 years ago

wduquette commented 4 years ago

This pull request adds a new mode of parsing. A Value can now have a parsed script as its data_rep. The interpreter evaluates these parsed scripts. Thus, the body of a proc or a loop is usually parsed once.

The old parser/evaluator is still used by the expr.rs parser to handle interpolated variables and scripts in expressions, and the expr.rs parser still reparses the expression on each evaluation.