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

Method parse_block_mapping_key

src/madpack/yaml/parser.py:424–441  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

422 return self.parse_block_mapping_key()
423
424 def parse_block_mapping_key(self):
425 if self.check_token(KeyToken):
426 token = self.get_token()
427 if not self.check_token(KeyToken, ValueToken, BlockEndToken):
428 self.states.append(self.parse_block_mapping_value)
429 return self.parse_block_node_or_indentless_sequence()
430 else:
431 self.state = self.parse_block_mapping_value
432 return self.process_empty_scalar(token.end_mark)
433 if not self.check_token(BlockEndToken):
434 token = self.peek_token()
435 raise ParserError("while parsing a block mapping", self.marks[-1],
436 "expected <block end>, but found %r" % token.id, token.start_mark)
437 token = self.get_token()
438 event = MappingEndEvent(token.start_mark, token.end_mark)
439 self.state = self.states.pop()
440 self.marks.pop()
441 return event
442
443 def parse_block_mapping_value(self):
444 if self.check_token(ValueToken):

Callers 1

Calls 7

process_empty_scalarMethod · 0.95
ParserErrorClass · 0.85
MappingEndEventClass · 0.85
check_tokenMethod · 0.80
get_tokenMethod · 0.80
peek_tokenMethod · 0.80

Tested by

no test coverage detected