generate method

  1. @override
Widget generate(
  1. Context context
)
override

Implementation

@override
Widget generate(Context context) {
  if (context.version < 20) {
    throw "Return requires at least version 20";
  }
  if (run != null) {
    if (run case Comment(text: '')) return Command('return fail');
    return Command(
      'return run ${getCommands(run!.generate(context), context: context).first}',
    );
  }

  return Command('return $val');
}