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

Method ws

src/main/java/org/sfj/PegLegParser.java:645–653  ·  view source on GitHub ↗

Generates a rule for the char sequence, allowing any amount of preceding/following whitespace. @param string char sequence @return rule

(CharSequence string)

Source from the content-addressed store, hash-verified

643 * @return rule
644 */
645 public CharTerminal<V> ws(CharSequence string) {
646 return new CharTerminal<>((ignoreCase) -> {
647 get().pushFrame("ws(\"" + string + "\")");
648 consumeWS();
649 if (!extremelyInnerString(string, ignoreCase)) { return get().ruleReturn(false, false); }
650 consumeWS();
651 return get().ruleReturn(true, true);
652 });
653 }
654
655 private boolean extremelyInnerString(CharSequence string, boolean ignoreCase) {
656 for (int i = 0; i < string.length(); i++) {

Callers 9

factorMethod · 0.80
numberMethod · 0.80
topMethod · 0.80
jsonObjectMethod · 0.80
pairMethod · 0.80
valueMethod · 0.80
jsonStringMethod · 0.80
jsonNumberMethod · 0.80
jsonArrayMethod · 0.80

Calls 6

getMethod · 0.95
consumeWSMethod · 0.95
extremelyInnerStringMethod · 0.95
pushFrameMethod · 0.80
ruleReturnMethod · 0.80
toStringMethod · 0.45

Tested by 3

factorMethod · 0.64
numberMethod · 0.64
topMethod · 0.64