[svn:parrot] r47616 - branches/gsoc_past_optimization/runtime/parrot/library/PAST
tcurtis at svn.parrot.org
tcurtis at svn.parrot.org
Mon Jun 14 04:46:38 UTC 2010
Author: tcurtis
Date: Mon Jun 14 04:46:38 2010
New Revision: 47616
URL: https://trac.parrot.org/parrot/changeset/47616
Log:
Make $pattern.ACCEPTS(foo, :global(1), :pos(bar)) throw.
Modified:
branches/gsoc_past_optimization/runtime/parrot/library/PAST/Pattern.nqp
Modified: branches/gsoc_past_optimization/runtime/parrot/library/PAST/Pattern.nqp
==============================================================================
--- branches/gsoc_past_optimization/runtime/parrot/library/PAST/Pattern.nqp Mon Jun 14 04:42:41 2010 (r47615)
+++ branches/gsoc_past_optimization/runtime/parrot/library/PAST/Pattern.nqp Mon Jun 14 04:46:38 2010 (r47616)
@@ -44,8 +44,10 @@
method ACCEPTS ($node, *%opts) {
my $global := ?%opts<g> || ?%opts<global>;
- return self.ACCEPTSGLOBALLY($node) if $global;
my $pos := %opts<p> || %opts<pos>;
+ pir::die("ACCEPTS cannot take both :global and :pos modifiers.")
+ if $global && $pos;
+ return self.ACCEPTSGLOBALLY($node) if $global;
return self.ACCEPTSEXACTLY($pos) if $pos;
my $/ := self.ACCEPTSEXACTLY($node);
if (!$/ && ($node ~~ PAST::Node)) {
More information about the parrot-commits
mailing list