org.jtwig.plural.parse.parboiled.NumberParser Maven / Gradle / Ivy
package org.jtwig.plural.parse.parboiled;
import org.parboiled.Rule;
public class NumberParser extends BasicParser {
public NumberParser(ParserContext context) {
super(NumberParser.class, context);
}
@Override
public Rule Rule() {
return Sequence(
Sequence(
Optional("-"),
OneOrMore(CharRange('0', '9'))
),
push(Integer.parseInt(match()))
);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy