MCPcopy Index your code
hub / github.com/bazelbuild/bazel / tokenizeTwoChars

Method tokenizeTwoChars

src/main/java/net/starlark/java/syntax/Lexer.java:660–678  ·  view source on GitHub ↗

Tokenizes a two-char operator. @return true if it tokenized an operator

()

Source from the content-addressed store, hash-verified

658 * @return true if it tokenized an operator
659 */
660 private boolean tokenizeTwoChars() {
661 if (pos + 2 >= buffer.length) {
662 return false;
663 }
664 char c1 = buffer[pos];
665 char c2 = buffer[pos + 1];
666 TokenKind tok = null;
667 if (c2 == '=') {
668 tok = EQUAL_TOKENS.get(c1);
669 } else if (c2 == '*' && c1 == '*') {
670 tok = TokenKind.STAR_STAR;
671 }
672 if (tok == null) {
673 return false;
674 } else {
675 setToken(tok, pos, pos + 2);
676 return true;
677 }
678 }
679
680 // Returns the ith unconsumed char, or -1 for EOF.
681 private int peek(int i) {

Callers 1

tokenizeMethod · 0.95

Calls 2

setTokenMethod · 0.95
getMethod · 0.65

Tested by

no test coverage detected