interpret method
Implementation
@override
String interpret(EditorContext context) {
var buffer = StringBuffer();
buffer.write(context.indent());
/// example: [factory] modifier
buffer.write(modifier.isEmpty ? '' : '$modifier ');
buffer.write(className);
if (constructorName?.isNotEmpty ?? false) {
buffer.write('.$constructorName');
}
buffer.write('(${param?.interpret(context) ?? ''})');
if (superArgument != null) {
buffer.write(' : super(${superArgument!.interpret(context)})');
}
if (statements != null) {
buffer.writeln(context.openScope(Scope.METHOD));
statements!.forEach((element) {
buffer.write(element.interpret(context));
});
buffer.write(context.closeScope());
} else {
buffer.writeln(''.putSemicolon);
}
return buffer.toString();
}