toScript method

  1. @override
String toScript({
  1. DartBlockTypedLanguage language = DartBlockTypedLanguage.java,
})
override

Implementation

@override
String toScript({
  DartBlockTypedLanguage language = DartBlockTypedLanguage.java,
}) {
  final text = compositionNode.toScript(language: language);
  // Remove outer parentheses for clarity and because they're unnnecessary.
  if (text.startsWith("(") && text.endsWith(")") && text.length > 2) {
    return text.substring(1, text.length - 1);
  } else {
    return text;
  }
}