| 235 | } |
| 236 | |
| 237 | void AddFunctionArgument( ASTNode* parent, const Symbol* functionSymbol, Symbol* arg ) |
| 238 | { |
| 239 | assert( parent ); |
| 240 | |
| 241 | for( size_t i = 0, n = parent->GetChildrenCount(); i < n; ++i ) |
| 242 | { |
| 243 | ASTNode* node = parent->GetChild( i ); |
| 244 | if( !node ) |
| 245 | { |
| 246 | continue; |
| 247 | } |
| 248 | |
| 249 | if( node->GetNodeType() == NT_FUNCTION_CALL && |
| 250 | node->GetSymbol() == functionSymbol ) |
| 251 | { |
| 252 | ASTNode* child = new ASTNode( NT_VAR_IDENTIFIER, node->GetLocation(), node->GetScope(), nullptr ); |
| 253 | child->SetSymbol( arg ); |
| 254 | |
| 255 | node->InsertChild( 0, child ); |
| 256 | } |
| 257 | |
| 258 | AddFunctionArgument( node, functionSymbol, arg ); |
| 259 | } |
| 260 | } |
| 261 | |
| 262 | void AddFunctionArgument( std::map<Symbol*, ASTNode*>& functions, const Symbol* functionSymbol, Symbol* arg ) |
| 263 | { |
no test coverage detected