| 191 | } |
| 192 | |
| 193 | bool Program::addStructureHandle ( const StructurePtr & st, const TypeAnnotationPtr & ann, const AnnotationArgumentList & arg ) { |
| 194 | if ( ann->rtti_isStructureTypeAnnotation() ) { |
| 195 | auto annotation = static_cast<StructureTypeAnnotation*>(ann->clone()); |
| 196 | annotation->name = st->name; |
| 197 | string err; |
| 198 | if ( annotation->create(st,arg,err) ) { |
| 199 | return thisModule->addAnnotation(annotation, true); |
| 200 | } else { |
| 201 | error("can't create structure handle "+ann->name,err,"",st->at,CompilationError::cant_create_structure_annotation); |
| 202 | return false; |
| 203 | } |
| 204 | } else { |
| 205 | error("not a structure annotation "+ann->name,"","",st->at,CompilationError::invalid_structure_annotation); |
| 206 | return false; |
| 207 | } |
| 208 | } |
| 209 | |
| 210 | Program::Program() { |
| 211 | ref_count_magic = TRACK_PTR_PROGRAM; |
no test coverage detected