MCPcopy Create free account
hub / github.com/cschanck/single-file-java / asSteps

Method asSteps

src/main/java/org/sfj/PegLegParser.java:525–540  ·  view source on GitHub ↗
(Object... objs)

Source from the content-addressed store, hash-verified

523 }
524
525 @SuppressWarnings("unchecked")
526 private List<Step> asSteps(Object... objs) {
527 if (objs.length == 0) {
528 return Collections.emptyList();
529 } else if (objs.length == 1) {
530 if (objs[0] instanceof PegLegParser.Step) {
531 return Collections.singletonList((Step) objs[0]);
532 }
533 return Collections.singletonList(new Step(objs[0]));
534 }
535 ArrayList<Step> ret = new ArrayList<>();
536 for (Object o : objs) {
537 ret.add(o instanceof PegLegParser.Step ? (PegLegParser<V>.Step) o : new Step(o));
538 }
539 return ret;
540 }
541
542 private RuleReturn<V> innerTimesOf(String name, int min, int max, Object... objs) {
543 PegLegRule<V> rule = seqOf(objs);

Callers 2

seqOfMethod · 0.95
firstOfMethod · 0.95

Calls 1

addMethod · 0.65

Tested by

no test coverage detected