Skip to content

Commit

Permalink
Better error message for /<perl>/ et al (fixes sorear#69)
Browse files Browse the repository at this point in the history
  • Loading branch information
sorear committed Oct 31, 2011
1 parent db7fa59 commit 1b30eff
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/Cursor.cs
Expand Up @@ -261,7 +261,13 @@ public sealed class RxFrame: IFreeze {
}

public void IncorporateChild(string[] names, bool passcap, P6any match) {
Cursor child = (Cursor) match;
Cursor child = match as Cursor;

if (child == null)
throw new NieczaException((names.Length == 0 ?
"Anonymous submatch" : "Submatch to be bound to " + names[0]) +
" returned a " + match.mo.name + " instead of a Cursor, " +
"violating the submatch protocol.");

SetPos(child.pos);
if (passcap)
Expand Down

0 comments on commit 1b30eff

Please sign in to comment.