convert method

Fence convert(
  1. Fence src
)
override

Converts input and returns the result of the conversion.

Implementation

Fence convert(Fence src) => switch(src.type) {
  InstructionType.core => src,
  InstructionType.cmd => switch(src.inst) {
    "file" => (type: InstructionType.core, inst: "d" + src.values[0], values: File(src.values[1]).readAsBytesSync().map<String>((int byte) => byte.toString()).toList(), at: src.at),
    "stdin" => (type: InstructionType.core, inst: "d" + src.values[0], values: stdin.readBytesAll().map<String>((int byte) => byte.toString()).toList(), at: src.at),
    _ => src,
  }
};