Summary Files Commits Branches @commit @diff @stats
path: root / src / StringConsumer / HigherOrderConsumers / IfConsumer.cl
blob: 431f79b5cd16b8069e0261bcfbd4133d99a96ff6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
class IfConsumer inherits IHigherOrderConsumer {
	ifc: IStringConsumer <- (new KeywordsIfConsumer).init();

	consume(s: String) : Int {{
		consumed_length <- 0;
		if did(ifc.consume(s))
		then
			token <- ifc.token()
		else
			void
		fi;
		consumed_length;
	}};
};