use of org.apache.felix.gogo.runtime.Parser.Sequence in project felix by apache.
the class TestParser method testParentheses.
@Test
public void testParentheses() {
Parser parser = new Parser("(a|b)|(d|f)");
Program p = parser.program();
assertEquals("a|b", ((Sequence) ((Statement) ((Pipeline) p.tokens().get(0)).tokens().get(0)).tokens().get(0)).program().toString());
parser = new Parser("grep (d.*)|grep (d|f)");
p = parser.program();
assertEquals("d.*", ((Sequence) ((Statement) ((Pipeline) p.tokens().get(0)).tokens().get(0)).tokens().get(1)).program().toString());
}