toSource method

String toSource()

Implementation

String toSource() {
  var lines = _lines;
  if (identical(lines[lines.length - 1].parts.length, 0)) {
    lines = lines.sublist(0, lines.length - 1);
  }
  return lines
      .map((line) {
        if (line.parts.isNotEmpty) {
          return _createIndent(line.indent) + line.parts.join('');
        } else {
          return '';
        }
      })
      .toList()
      .join('\n');
}