1 module orelang.operator.WhileOperator; 2 import orelang.operator.IOperator, 3 orelang.Engine, 4 orelang.Value; 5 6 class WhileOperator : IOperator { 7 /** 8 * Loop while the condition is true. 9 */ 10 public Value call(Engine engine, Value[] args) { 11 Value ret = null; 12 13 while (engine.eval(args[0]).getBool) { 14 ret = engine.eval(args[1]); 15 } 16 17 return ret; 18 } 19 }