def parse_nbt(literal):
parser = Parser(tokenize(literal))<EOL>tag = parser.parse()<EOL>cursor = parser.token_span[<NUM_LIT:1>]<EOL>leftover = literal[cursor:]<EOL>if leftover.strip():<EOL><INDENT>parser.token_span = cursor, cursor + len(leftover)<EOL>raise parser.error(f'<STR_LIT>')<EOL><DEDENT>return tag<EOL>
Parse a literal nbt string and return the resulting tag.