BeginComment:
This program simply copies an input stream to the console character by
character like the Unix 'cat' program.

Copyright © 2020 Richard Lesh.  All rights reserved.
EndComment

Pragma: UseUnicode

BeginProgram: StreamIO1

BeginMain:
	ScalarDecl: <codepoint_t>? c
###############################################################################
# Python and Swift don't have assignment operators usually
# used in this type of input loop so we have to assign separately.
###############################################################################
BeginEval: language =~ m/py|swift/
	BeginFor: getcodepoint(c); c != EOF; getcodepoint(c)
		Statement: putcodepoint(c!)
	EndFor
ElseEval
	BeginWhile: getcodepoint(c)
		Statement: putcodepoint(c!)
	EndWhile
EndEval
EndMain
EndProgram
