@Test public void test_simple_regex() { String s = (String) parse("xy", null, -1); assertThat(s, is("any/xy")); }
@Override public Object parse(MatcherAPI matcherAPI, Matcher matcher, int capturingBase, Object memento, Object lastArgValue) { if (memento instanceof WidthMatchSubpatterns) { WidthMatchSubpatterns sub = (WidthMatchSubpatterns) memento; int n = sub.getMatchingPattern(matcher, capturingBase); capturingBase += sub.getCapturingOffset(n); Object m = sub.getMemento(n); return parse(matcher, capturingBase, n-1, m, lastArgValue); } else { return parse(matcher, capturingBase+1, -2, memento, lastArgValue); } }
PatternAlignmentBase extends FormatPatternBase { @Override public Object parse(MatcherAPI matcherAPI, Matcher matcher, int capturingBase, Object memento, Object lastArgValue) { if (memento instanceof WidthMatchSubpatterns) { WidthMatchSubpatterns sub = (WidthMatchSubpatterns) memento; int n = sub.getMatchingPattern(matcher, capturingBase); capturingBase += sub.getCapturingOffset(n); Object m = sub.getMemento(n); return parse(matcher, capturingBase, n-1, m, lastArgValue); } else { return parse(matcher, capturingBase+1, -2, memento, lastArgValue); } } }
PatternAlignmentBase extends FormatPatternBase { @Override public Object parse(MatcherAPI matcherAPI, Matcher matcher, int capturingBase, Object memento, Object lastArgValue) { if (memento instanceof WidthMatchSubpatterns) { WidthMatchSubpatterns sub = (WidthMatchSubpatterns) memento; int n = sub.getMatchingPattern(matcher, capturingBase); capturingBase += sub.getCapturingOffset(n); Object m = sub.getMemento(n); return parse(matcher, capturingBase, n-1, m, lastArgValue); } else { return parse(matcher, capturingBase+1, -2, memento, lastArgValue); } }  }
PatternAlignmentBase extends FormatPatternBase { @Override public Object parse(MatcherAPI matcherAPI, Matcher matcher, int capturingBase, Object memento, Object lastArgValue) { if (memento instanceof WidthMatchSubpatterns) { WidthMatchSubpatterns sub = (WidthMatchSubpatterns) memento; int n = sub.getMatchingPattern(matcher, capturingBase); capturingBase += sub.getCapturingOffset(n); Object m = sub.getMemento(n); return parse(matcher, capturingBase, n-1, m, lastArgValue); } else { return parse(matcher, capturingBase+1, -2, memento, lastArgValue); } }  @Override int toRegex(PatternAPI pattern, Locale locale, String flags, int width, int precision, String formatString, int position); @Override Object parse(MatcherAPI matcherAPI, Matcher matcher, int capturingBase, Object memento, Object lastArgValue); }
PatternAlignmentBase extends FormatPatternBase { @Override public Object parse(MatcherAPI matcherAPI, Matcher matcher, int capturingBase, Object memento, Object lastArgValue) { if (memento instanceof WidthMatchSubpatterns) { WidthMatchSubpatterns sub = (WidthMatchSubpatterns) memento; int n = sub.getMatchingPattern(matcher, capturingBase); capturingBase += sub.getCapturingOffset(n); Object m = sub.getMemento(n); return parse(matcher, capturingBase, n-1, m, lastArgValue); } else { return parse(matcher, capturingBase+1, -2, memento, lastArgValue); } }  @Override int toRegex(PatternAPI pattern, Locale locale, String flags, int width, int precision, String formatString, int position); @Override Object parse(MatcherAPI matcherAPI, Matcher matcher, int capturingBase, Object memento, Object lastArgValue);  }