Summary Files Commits Branches @commit @diff @stats
path: root / src / StringConsumer / WhitespaceConsumer.cl
blob: 4c0b8b50743b1d6c5e3af1df0f17715997fd5c63 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
class WhitespaceConsumer inherits IStringConsumer {
	consume(s: String) : Int {{
		consumed_length <- 0;
		while or(s.substr(consumed_length, 1) = " ",
		         s.substr(consumed_length, 1) = "\t")
		loop
			consumed_length <- consumed_length + 1
		pool;
		consumed_length;
	}};

	token() : IToken {
		new WhitespaceToken
	};
};