MCPcopy Create free account
hub / github.com/apache/madlib / check_token

Method check_token

src/madpack/yaml/scanner.py:113–123  ·  view source on GitHub ↗
(self, *choices)

Source from the content-addressed store, hash-verified

111 # Public methods.
112
113 def check_token(self, *choices):
114 # Check if the next token is one of the given types.
115 while self.need_more_tokens():
116 self.fetch_more_tokens()
117 if self.tokens:
118 if not choices:
119 return True
120 for choice in choices:
121 if isinstance(self.tokens[0], choice):
122 return True
123 return False
124
125 def peek_token(self):
126 # Return the next token, but do not delete if from the queue.

Callers 15

scanFunction · 0.80
parse_document_startMethod · 0.80
parse_document_endMethod · 0.80
process_directivesMethod · 0.80
parse_nodeMethod · 0.80

Calls 2

need_more_tokensMethod · 0.95
fetch_more_tokensMethod · 0.95

Tested by

no test coverage detected