MCPcopy Create free account
hub / github.com/GaijinEntertainment/daScript / touch

Method touch

modules/dasUnitTest/test_handles.cpp:138–148  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

136struct 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;

Callers

nothing calls this directly

Calls 5

getBoolOptionMethod · 0.80
LineInfoClass · 0.50
findFieldMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected