RosettaCodeData/Task/Copy-stdin-to-stdout/Draco/copy-stdin-to-stdout.draco
2023-07-01 13:44:08 -04:00

22 lines
610 B
Text

\util.g
proc nonrec main() void:
char c;
while
/* I/O is line-oriented, so first read characters
* from the current line while that is possible */
while read(c) do write(c) od;
case ioerror()
/* Then once it fails, if the line is empty,
* try to go to the next line. */
incase CH_MISSING:
readln();
writeln();
true
/* If it failed for another reason (which will be
* EOF here), stop. */
default:
false
esac
do od
corp