| 295 | } |
| 296 | |
| 297 | ExprLooksLikeCall * Program::makeCall ( const LineInfo & at, const string & name ) { |
| 298 | vector<ExprCallFactory *> ptr; |
| 299 | string moduleName, funcName; |
| 300 | splitTypeName(name, moduleName, funcName); |
| 301 | if ( moduleName != "_" && moduleName != "__" ) { // those are never found. in reality we may want to support this one day with "*" and "thisModuleName" accordingly |
| 302 | library.foreach([&](Module * pm) -> bool { |
| 303 | if ( auto pp = pm->findCall(funcName) ) { |
| 304 | ptr.push_back(pp); |
| 305 | } |
| 306 | return true; |
| 307 | }, moduleName); |
| 308 | } |
| 309 | if ( ptr.size()==1 ) { |
| 310 | return (*ptr.back())(at); |
| 311 | } else if ( ptr.size()==0 ) { |
| 312 | return new ExprCall(at,name); |
| 313 | } else { |
| 314 | error("too many options for " + name,"","", at, CompilationError::ambiguous_function); |
| 315 | return new ExprCall(at,name); |
| 316 | } |
| 317 | } |
| 318 | |
| 319 | ExprLooksLikeCall * Program::makeCall ( const LineInfo & at, const LineInfo & atEnd, const string & name ) { |
| 320 | auto res = makeCall(at, name); |
no test coverage detected