Commit 03a35385 authored by Houtan Bastani's avatar Houtan Bastani
Browse files

preprocessor: don’t automatically declare external functions

parent c030a5d7
......@@ -2678,16 +2678,13 @@ ParsingDriver::add_model_var_or_external_function(string *function_name, bool in
return add_model_variable(mod_file->symbol_table.getID(*function_name), (int) rv.second);
}
else
{
//declare it as a function
warning(*function_name + " not declared. It is being automatically declared as an external function.");
declare_symbol(function_name, eExternalFunction, NULL, NULL);
current_external_function_options.nargs = stack_external_function_args.top().size();
mod_file->external_functions_table.addExternalFunction(mod_file->symbol_table.getID(*function_name),
current_external_function_options, in_model_block);
reset_current_external_function_options();
}
error("To use an external function (" + *function_name + ") within the model block, you must first declare it via the external_function() statement.");
}
declare_symbol(function_name, eExternalFunction, NULL, NULL);
current_external_function_options.nargs = stack_external_function_args.top().size();
mod_file->external_functions_table.addExternalFunction(mod_file->symbol_table.getID(*function_name),
current_external_function_options, in_model_block);
reset_current_external_function_options();
}
//By this point, we're sure that this function exists in the External Functions Table and is not a mod var
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment