compile static method
Compiles commands to instructions.
Implementation
static List<Instruction> compile(List<TurtleCommand> commands) {
var turtle = TurtleState();
var argv = {};
var instructions = <Instruction>[];
try {
for (var command in commands) {
instructions.addAll(command.createInstruction(turtle, argv));
}
} on StopException catch (_) {}
return instructions;
}