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

Method visit

src/ast/ast.cpp:889–918  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

887 }
888
889 FunctionPtr Function::visit(Visitor & vis) {
890 vis.preVisit(this);
891 for ( auto & arg : arguments ) {
892 vis.preVisitArgument(this, arg, arg==arguments.back() );
893 if ( arg->type ) {
894 vis.preVisit(arg->type);
895 arg->type = arg->type->visit(vis);
896 arg->type = vis.visit(arg->type);
897 }
898 if ( arg->init && vis.canVisitArgumentInit(this,arg,arg->init) ) {
899 vis.preVisitArgumentInit(this, arg, arg->init);
900 arg->init = arg->init->visit(vis);
901 if ( arg->init ) {
902 arg->init = vis.visitArgumentInit(this, arg, arg->init);
903 }
904 }
905 arg = vis.visitArgument(this, arg, arg==arguments.back() );
906 }
907 if ( result ) {
908 vis.preVisit(result);
909 result = result->visit(vis);
910 result = vis.visit(result);
911 }
912 if ( body ) {
913 vis.preVisitFunctionBody(this, body);
914 if ( body ) body = body->visit(vis);
915 if ( body ) body = vis.visitFunctionBody(this, body);
916 }
917 return vis.visit(this);
918 }
919
920 bool Function::isGeneric() const {
921 for ( const auto & ann : annotations ) {

Callers 8

runMethod · 0.45
tryPipedCallPaddingMethod · 0.45
inferFunctionCallMethod · 0.45
inferPartialAliasesMethod · 0.45
inferTypeExprMethod · 0.45
visitFinallyMethod · 0.45
appendLocalVariablesMethod · 0.45

Calls 15

gc_unlinkMethod · 0.80
visitFunction · 0.50
preVisitMethod · 0.45
preVisitArgumentMethod · 0.45
canVisitArgumentInitMethod · 0.45
preVisitArgumentInitMethod · 0.45
visitArgumentInitMethod · 0.45
visitArgumentMethod · 0.45
preVisitFunctionBodyMethod · 0.45
visitFunctionBodyMethod · 0.45
canVisitReaderMethod · 0.45
canVisitLabelMethod · 0.45

Tested by

no test coverage detected