MCPcopy Create free account
hub / github.com/awslabs/gap-text2sql / _add_constructor

Method _add_constructor

rat-sql-gap/seq2struct/ast_util.py:163–173  ·  view source on GitHub ↗
(self, sum_type_name, constructor)

Source from the content-addressed store, hash-verified

161 sum_type.seq_fragment_types += constructors
162
163 def _add_constructor(self, sum_type_name, constructor):
164 assert constructor.name not in self.constructors
165 self.constructors[constructor.name] = constructor
166 assert constructor.name not in self.singular_types
167 self.singular_types[constructor.name] = constructor
168 assert constructor.name not in self.constructor_to_sum_type
169 self.constructor_to_sum_type[constructor.name] = sum_type_name
170
171 if not constructor.fields:
172 self.fieldless_constructors.append(constructor.name)
173 self.fieldless_constructors.sort()
174
175 def verify_ast(self, node, expected_type=None, field_path=(), is_seq=False):
176 # type: (ASTWrapper, Node, Optional[str], Tuple[str, ...]) -> None

Callers 3

add_sum_typeMethod · 0.95
add_seq_fragment_typeMethod · 0.95

Calls 1

appendMethod · 0.80

Tested by

no test coverage detected