MCPcopy Create free account
hub / github.com/NICUP14/MiniLang / parse_gen

Method parse_gen

src/Parser.py:1164–1177  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1162 return node
1163
1164 def parse_gen(self) -> List[str]:
1165 gen_names = []
1166
1167 if not self.no_more_tokens() and self.curr_token().kind == TokenKind.LBRACE:
1168 self.match_token(TokenKind.LBRACE)
1169 while not self.no_more_tokens() and self.curr_token().kind != TokenKind.RBRACE:
1170 gen_name = self.match_token(TokenKind.IDENT).value
1171 gen_names.append(gen_name)
1172
1173 if not self.no_more_tokens() and self.curr_token().kind != TokenKind.RBRACE:
1174 self.match_token(TokenKind.COMMA)
1175 self.match_token(TokenKind.RBRACE)
1176
1177 return gen_names
1178
1179 def parse_type(self) -> ParsedType:
1180 meta_kind = VariableMetaKind.PRIM

Callers

nothing calls this directly

Calls 3

no_more_tokensMethod · 0.95
curr_tokenMethod · 0.95
match_tokenMethod · 0.95

Tested by

no test coverage detected