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; }}; };