[pure-lang-svn] SF.net SVN: pure-lang: [282] pure/trunk/interpreter.cc
Status: Beta
Brought to you by:
agraef
From: <ag...@us...> - 2008-06-22 23:08:30
|
Revision: 282 http://pure-lang.svn.sourceforge.net/pure-lang/?rev=282&view=rev Author: agraef Date: 2008-06-22 16:08:38 -0700 (Sun, 22 Jun 2008) Log Message: ----------- Placing an "as" pattern at the head symbol of a function application causes trouble; forbid this. Modified Paths: -------------- pure/trunk/interpreter.cc Modified: pure/trunk/interpreter.cc =================================================================== --- pure/trunk/interpreter.cc 2008-06-22 22:54:24 UTC (rev 281) +++ pure/trunk/interpreter.cc 2008-06-22 23:08:38 UTC (rev 282) @@ -1075,7 +1075,7 @@ if (sym.s != "_") { if (sym.prec < 10 || sym.fix == nullary) throw err("error in pattern (bad variable symbol '"+sym.s+"')"); - if (p.len() == 0 && !b) + if (p.len() == 0 && !b || x.tag() > 0 && p.len() > 0 && p.last() == 0) throw err("error in pattern (misplaced variable '"+sym.s+"')"); env::iterator it = vars.find(sym.f); if (it != vars.end()) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |