[pure-lang-svn] SF.net SVN: pure-lang:[627] pure/trunk/interpreter.cc
Status: Beta
Brought to you by:
agraef
From: <ag...@us...> - 2008-08-27 08:07:28
|
Revision: 627 http://pure-lang.svn.sourceforge.net/pure-lang/?rev=627&view=rev Author: agraef Date: 2008-08-27 08:07:35 +0000 (Wed, 27 Aug 2008) Log Message: ----------- Allow externals to be bound to private Pure symbols. Modified Paths: -------------- pure/trunk/interpreter.cc Modified: pure/trunk/interpreter.cc =================================================================== --- pure/trunk/interpreter.cc 2008-08-27 08:01:20 UTC (rev 626) +++ pure/trunk/interpreter.cc 2008-08-27 08:07:35 UTC (rev 627) @@ -3403,14 +3403,10 @@ argt[i] = Type::Int64Ty; if (asname.empty()) asname = name; symbol& sym = symtab.sym(asname, modno); - if (sym.modno >= 0) - // We don't allow private externals for now. - throw err("symbol '"+name+"' is private in this context"); - else if (globenv.find(sym.f) != globenv.end() && - externals.find(sym.f) == externals.end()) - // There already is a Pure function or global variable for this - // symbol. This is an error (unless the symbol is already declared as an - // external, too). + if (globenv.find(sym.f) != globenv.end() && + externals.find(sym.f) == externals.end()) + // There already is a Pure function or global variable for this symbol. + // This is an error (unless the symbol is already declared as an external). throw err("symbol '"+name+"' is already defined as a Pure "+ ((globenv[sym.f].t == env_info::fun) ? "function" : (globenv[sym.f].t == env_info::fvar) ? "variable" : This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |