Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Rearrange binding process to bind signatures after lexpad setup; (fixes
  • Loading branch information
sorear committed Jan 1, 2012
1 parent 5dd6ed3 commit 2580531
Show file tree
Hide file tree
Showing 9 changed files with 288 additions and 253 deletions.
2 changes: 1 addition & 1 deletion lib/Builtins.cs
Expand Up @@ -2221,7 +2221,7 @@ class CrossSource: ItemSource {
n = o.slots[1] as VarHash;
}

return de.info.Binder(th, de.outer, de.ip6, p, n, false, de);
return de.info.SetupCall(th, de.outer, de.ip6, p, n, false, de);
}

public static bool obj_can(P6any obj, string mname) {
Expand Down
4 changes: 1 addition & 3 deletions lib/CORE.setting
Expand Up @@ -494,12 +494,10 @@ my class Cool {
Num; # XXX StrPos
}

my $_char = /./;
method comb($matcher?, $limit?, :$match) {
method comb($matcher = /./, $limit?, :$match) {
my $str = ~self;
my $C = Cursor.cursor_start($str);
my $i = 0;
$matcher := $matcher // $_char;
my $limctr = $limit // Inf;
my @out;
while ($i < chars $str) && $limctr > 0 {
Expand Down
5 changes: 5 additions & 0 deletions lib/CodeGen.cs
Expand Up @@ -469,6 +469,8 @@ sealed class Tokens {
RuntimeUnit.GetMethod("LoadLADArr");
public static readonly MethodInfo Frame_Return =
Frame.GetMethod("Return");
public static readonly MethodInfo Frame_Binder =
Frame.GetMethod("Binder");

public static readonly FieldInfo P6any_mo =
P6any.GetField("mo");
Expand Down Expand Up @@ -2671,6 +2673,7 @@ class NamProcessor {
return z[1] as CpsOp; };
handlers["_newdispatch"] = delegate(NamProcessor th, object[] z) {
return th.MakeDispatch(JScalar.S(z[1])); };
thandlers["_binder"] = Methody(Tokens.Void, Tokens.Frame_Binder);
handlers["class_ref"] = delegate(NamProcessor th, object[] z) {
string kind = FixStr(z[1]);
STable m;
Expand Down Expand Up @@ -3313,6 +3316,8 @@ class NamProcessor {
}
foreach (object lf in latefrags) frags.Add(lf);

if (sub.sig != null) frags.Add(a(j("_binder")));

// PRE
foreach (SubInfo z in sub.GetPhasers(Kernel.PHASER_PRE)) {
frags.Add(a(j("ternary"),
Expand Down
2 changes: 1 addition & 1 deletion lib/Cursor.cs
Expand Up @@ -31,7 +31,7 @@ public sealed class GState {
return th;
}

return m.info.Binder(th, m.outer, m.ip6, pos, null, false, m);
return m.info.SetupCall(th, m.outer, m.ip6, pos, null, false, m);
}

public GState(string orig, P6any actions) {
Expand Down

0 comments on commit 2580531

Please sign in to comment.