removeGeneratedBlocks function

List<String> removeGeneratedBlocks(
  1. List<String> lines,
  2. String command
)

Implementation

List<String> removeGeneratedBlocks(List<String> lines, String command) {
  var result = Lines();

  for (var line in lines) {
    result.add(line);

    if (line.isMacroEnd(command)) {
      result.discard();
    } else if (line.isMacro(command)) {
      result.accept();
    }
  }
  return result.data();
}