aboutsummaryrefslogtreecommitdiff
path: root/source/app.d
blob: dd7be6d7c18c2c7f16e8f223a15e0806f6edfa01 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import std.string    : split;
import std.range     : dropOne;
import std.algorithm : map, each;
import std.stdio     : stdin, File, lines;

static import machine;

void process(ref File file) {
	foreach ( string line; lines(file) ) {
		line.split.each!(machine.process);
	}
}

void main(string[] args) {
	args
		.dropOne
		.map!(File)
		.each!((File file) => file.process);

	while ( !stdin.eof ) {
		stdin.readln.split.each!(machine.process);
	}
}