| 136 | struct CheckRange : StructureAnnotation { |
| 137 | CheckRange() : StructureAnnotation("checkRange") {} |
| 138 | virtual bool touch(const StructurePtr & st, ModuleGroup &, |
| 139 | const AnnotationArgumentList & args, string & ) override { |
| 140 | // this is here for the 'example' purposes |
| 141 | // lets add a sample 'dummy' field |
| 142 | if (args.getBoolOption("dummy",false) && !st->findField("dummy")) { |
| 143 | st->fields.emplace_back("dummy", new TypeDecl(Type::tInt), |
| 144 | nullptr /*init*/, AnnotationArgumentList(), false /*move_to_init*/, LineInfo()); |
| 145 | st->fieldLookup.clear(); |
| 146 | } |
| 147 | return true; |
| 148 | } |
| 149 | virtual bool look ( const StructurePtr & st, ModuleGroup &, |
| 150 | const AnnotationArgumentList & args, string & err ) override { |
| 151 | bool ok = true; |
nothing calls this directly
no test coverage detected