evalString function

dynamic evalString(
  1. Parser parser,
  2. Environment env,
  3. String script
)

Reads and evaluates a script.

Implementation

dynamic evalString(Parser parser, Environment env, String script) {
  dynamic result;
  for (final cell in parser.parse(script).value) {
    result = eval(env, cell);
  }
  return result;
}