MCPcopy Create free account
hub / github.com/chibash/stone / maybe

Method maybe

src/stone/Parser.java:366–371  ·  view source on GitHub ↗
(Parser p)

Source from the content-addressed store, hash-verified

364 return this;
365 }
366 public Parser maybe(Parser p) {
367 Parser p2 = new Parser(p);
368 p2.reset();
369 elements.add(new OrTree(new Parser[] { p, p2 }));
370 return this;
371 }
372 public Parser option(Parser p) {
373 elements.add(new Repeat(p, true));
374 return this;

Callers 4

TypedParserClass · 0.80
TypedParserMethod · 0.80
FuncParserClass · 0.80
ArrayParserMethod · 0.80

Calls 2

resetMethod · 0.95
addMethod · 0.45

Tested by

no test coverage detected