Permalink
Browse files

[mmd] Fixes for "my multi regex"

  • Loading branch information...
1 parent c464669 commit f40836b9fe924509a8d8fd38796dcece1844af83 @sorear committed Apr 8, 2011
Showing with 9 additions and 2 deletions.
  1. +1 −1 lib/CLRBackend.cs
  2. +8 −1 src/NieczaPassBegin.pm6
View
@@ -2584,7 +2584,7 @@ class NamProcessor {
CpsOp MakeDispatch(string prefix) {
HashSet<string> names = new HashSet<string>();
List<CpsOp> cands = new List<CpsOp>();
- string filter = prefix + ":(";
+ string filter = prefix + ":";
string pn = prefix + ":(!proto)";
for (StaticSub csr = sub; ; csr = csr.outer.Resolve<StaticSub>()) {
View
@@ -288,7 +288,14 @@ augment class Op::SubDef { #OK exist
$prefix = $*unit.deref(@*opensubs[*-1].body_of).name ~ ".";
}
$.multiness //= 'only';
- if $.bindlex {
+ if $.bindlex && $.body.class eq 'Regex' {
+ $.symbol = '&' ~ $.body.name;
+ my $proto = $.symbol;
+ $proto ~~ s/\:.*//;
+ @*opensubs[*-1].add_dispatcher($proto) if $.multiness ne 'only'
+ && !@*opensubs[*-1].lexicals.{$proto};
+ $.symbol ~= ":(!proto)" if $.multiness eq 'proto';
+ } elsif $.bindlex {
$.symbol = '&' ~ $.body.name;
@*opensubs[*-1].add_dispatcher($.symbol) if $.multiness ne 'only'
&& !@*opensubs[*-1].lexicals.{$.symbol};

0 comments on commit f40836b

Please sign in to comment.