MCPcopy Create free account
hub / github.com/atas76/openengine / getNextToken

Method getNextToken

src/main/java/org/fgn/lexan/Scanner.java:64–83  ·  view source on GitHub ↗
(String token)

Source from the content-addressed store, hash-verified

62 }
63
64 private String getNextToken(String token) throws ScannerException {
65
66 int tokenIndex = 0;
67 int endTokenIndex = index + token.length();
68
69 while (index < endTokenIndex) {
70
71 char currentChar = statement.charAt(index);
72 char currentTokenChar = token.charAt(tokenIndex);
73
74 if (currentChar != currentTokenChar) {
75 throw new ScannerException(token);
76 }
77
78 tokenIndex++;
79 index++;
80 }
81
82 return token;
83 }
84
85 private String getNextToken(Predicate<Character> tokenInclusionPredicate) {
86

Callers 1

scanMethod · 0.95

Calls 1

toStringMethod · 0.45

Tested by

no test coverage detected