def _create_struct_field(self, env, stone_field):
        """
        This function resolves symbols to objects that we've instantiated in
        the current environment. For example, a field with data type named
        "String" is pointed to a String() object.

        The caller needs to ensure that this stone_field is for a Struct and not
        for a Union.

        Returns:
            stone.data_type.StructField: A field of a struct.
        """
        if isinstance(stone_field, AstVoidField):
            raise InvalidSpec(
                'Struct field %s cannot have a Void type.' %
                quote(stone_field.name),
                stone_field.lineno, stone_field.path)

        data_type = self._resolve_type(env, stone_field.type_ref)
        annotations = [self._resolve_annotation_type(env, annotation)
                       for annotation in stone_field.annotations]

        if isinstance(data_type, Void):
            raise InvalidSpec(
                'Struct field %s cannot have a Void type.' %
                quote(stone_field.name),
                stone_field.lineno, stone_field.path)
        elif isinstance(data_type, Nullable) and stone_field.has_default:
            raise InvalidSpec('Field %s cannot be a nullable '
                              'type and have a default specified.' %
                              quote(stone_field.name),
                              stone_field.lineno, stone_field.path)
        api_type_field = StructField(
            name=stone_field.name,
            data_type=data_type,
            doc=stone_field.doc,
            ast_node=stone_field,
        )
        api_type_field.set_annotations(annotations)
        return api_type_field
def _create_struct_field ( self , env , stone_field ) : if isinstance ( stone_field , AstVoidField ) : raise InvalidSpec ( 'Struct field %s cannot have a Void type.' % quote ( stone_field . name ) , stone_field . lineno , stone_field . path ) data_type = self . _resolve_type ( env , stone_field . type_ref ) annotations = [ self . _resolve_annotation_type ( env , annotation ) for annotation in stone_field . annotations ] if isinstance ( data_type , Void ) : raise InvalidSpec ( 'Struct field %s cannot have a Void type.' % quote ( stone_field . name ) , stone_field . lineno , stone_field . path ) elif isinstance ( data_type , Nullable ) and stone_field . has_default : raise InvalidSpec ( 'Field %s cannot be a nullable ' 'type and have a default specified.' % quote ( stone_field . name ) , stone_field . lineno , stone_field . path ) api_type_field = StructField ( name = stone_field . name , data_type = data_type , doc = stone_field . doc , ast_node = stone_field , ) api_type_field . set_annotations ( annotations ) return api_type_field
This function resolves symbols to objects that we've instantiated in
        the current environment. For example, a field with data type named
        "String" is pointed to a String() object.

        The caller needs to ensure that this stone_field is for a Struct and not
        for a Union.

        Returns:
            stone.data_type.StructField: A field of a struct.