expression function
Expression — empty Str → null; returns the value on success, null on
failure (prints red-colored ERROR text).
Implementation
dynamic expression(String str, {bool nul = true}) {
if (str.isEmpty) return null;
final ev = _currentEvaluator;
if (ev == null) return null;
final v = ev.eval(str, nul: nul);
if (ev.hasError) {
// ignore: avoid_print
print('<font color="#ff0000">[ERROR] $str # ${ev.lastError}</font>');
return null;
}
return v;
}