@Test public void multiTie() { final Token multiTie = seq(def("d", con(3)), def("d", con(3)), tie(SIMPLE_SEQ, ref("d"))); final Optional<ParseState> result = multiTie.parse(env(stream(1, 2, 3, 1, 2, 3))); assertTrue(result.isPresent()); assertEquals(0, getReferences(result.get().order).size); final String[] names = { "a", "b", "c", "d" }; for (String name : names) { ImmutableList<ParseValue> values = getAllValues(result.get().order, name); assertEquals(2, values.size); } }
public Tie(final String name, final Token token, final ValueExpression dataExpression, final Encoding encoding) { super(name, encoding); this.token = checkNotNull(token, "token"); this.dataExpression = checkNotNull(dataExpression, "dataExpression"); }
Tie extends Token { public Tie(final String name, final Token token, final ValueExpression dataExpression, final Encoding encoding) { super(name, encoding); this.token = checkNotNull(token, "token"); this.dataExpression = checkNotNull(dataExpression, "dataExpression"); } }
Tie extends Token { public Tie(final String name, final Token token, final ValueExpression dataExpression, final Encoding encoding) { super(name, encoding); this.token = checkNotNull(token, "token"); this.dataExpression = checkNotNull(dataExpression, "dataExpression"); } Tie(final String name, final Token token, final ValueExpression dataExpression, final Encoding encoding); }
Tie extends Token { public Tie(final String name, final Token token, final ValueExpression dataExpression, final Encoding encoding) { super(name, encoding); this.token = checkNotNull(token, "token"); this.dataExpression = checkNotNull(dataExpression, "dataExpression"); } Tie(final String name, final Token token, final ValueExpression dataExpression, final Encoding encoding); @Override String toString(); @Override boolean equals(final Object obj); @Override int hashCode(); }
Tie extends Token { public Tie(final String name, final Token token, final ValueExpression dataExpression, final Encoding encoding) { super(name, encoding); this.token = checkNotNull(token, "token"); this.dataExpression = checkNotNull(dataExpression, "dataExpression"); } Tie(final String name, final Token token, final ValueExpression dataExpression, final Encoding encoding); @Override String toString(); @Override boolean equals(final Object obj); @Override int hashCode(); final Token token; final ValueExpression dataExpression; }