Skip to content
This repository
Browse code

Fixes for Match.synthetic

  • Loading branch information...
commit 94d8f557cc6af016a306ec8e38ecb0c59d1efcdc 1 parent e80f452
Stefan O'Rear authored
2  lib/CLRBackend.cs
@@ -3811,7 +3811,7 @@ class NamProcessor {
3811 3811 thandlers["cursor_item"] = Methody(null, Tokens.Cursor.GetMethod("GetKey"));
3812 3812 thandlers["cursor_unpackcaps"] = Methody(null, Tokens.Cursor.GetMethod("UnpackCaps"));
3813 3813 thandlers["cursor_O"] = Methody(null, Tokens.Cursor.GetMethod("O"));
3814   - thandlers["cursor_synthetic"] = Methody(Tokens.Variable, Tokens.Cursor.GetMethod("Synthetic"));
  3814 + thandlers["cursor_synthetic"] = Methody(Tokens.Void, Tokens.Cursor.GetMethod("Synthetic"));
3815 3815 thandlers["cursor_fresh"] = Methody(null, Tokens.Cursor.GetMethod("FreshClass"));
3816 3816 thandlers["cursor_unmatch"] = Methody(null, Tokens.Cursor.GetMethod("UnMatch"));
3817 3817 thandlers["cursor_reduced"] = Methody(null, Tokens.Cursor.GetMethod("Reduced"));
14 lib/CORE.setting
@@ -1154,14 +1154,16 @@ my class Match is Cool {
1154 1154 method cursor() { Q:CgOp { (ns (cursor_unmatch (cast cursor (@ {self})))) } }
1155 1155 method reduced() { Q:CgOp { (box Str (cursor_reduced (cast cursor (@ {self})))) } }
1156 1156 method synthetic(:$cursor!, :$method!, :@captures!, :$from!, :$to!) {
  1157 + my $*match;
1157 1158 Q:CgOp {
1158   - (cursor_synthetic
1159   - (cast cursor (@ {$cursor})) (obj_getstr {$method})
1160   - (cast int (obj_getnum {$from}))
1161   - (cast int (obj_getnum {$to}))
1162   - {@captures})
  1159 + (prog
  1160 + (cursor_synthetic
  1161 + (cast cursor (@ {$cursor})) (obj_getstr {$method})
  1162 + (cast int (obj_getnum {$from}))
  1163 + (cast int (obj_getnum {$to}))
  1164 + {@captures})
  1165 + {$*match})
1163 1166 };
1164   - $/
1165 1167 }
1166 1168 }
1167 1169
2  lib/Cursor.cs
@@ -575,7 +575,7 @@ public Cursor(P6any proto, string text, P6any actions)
575 575 }
576 576 Cursor r = new Cursor(parent.global, parent.save_klass, from, to, ci,
577 577 null, method);
578   - Kernel.SetStatus(th, "$*/", Kernel.NewROScalar(r));
  578 + th.SetDynamic(th.info.dylex["$*match"], Kernel.NewROScalar(r));
579 579 return r.global.CallAction(th, method, r);
580 580 }
581 581
17 perf/perf.TODO
... ... @@ -1,25 +1,8 @@
1 1 == For STD/Niecza ==
2 2
3   -Calling action methods hurts
4   -- Try calling them on the loop
5   -- Try a .^blacklist_fallback method for avoiding <.ws> actions, etc
6   -
7 3 Experiment with techniques to avoid Variable[] allocation on all calls
8 4 - like a preallocated "outgoing arguments area"
9 5
10 6 Experiment with "if non-overriden, then replace method" hooks
11 7
12 8 Experiment with making P6any: Variable
13   -
14   -Any.exists-key is missing!
15   -
16   -Builtins.start_iteration to avoid creating an extra VarDeque in for @x {}
17   -
18   -Avoid PushD if empty(?). (And avoid CopyAsArray in both)
19   -
20   -Avoid slurpies with CgOp. Try using, I dunno, parcels instead, with
21   -custom code.
22   -
23   -Avoid the full lazy-iterator in JSON if possible.
24   -
25   -Avoid RxFrame.End in <ws>.

0 comments on commit 94d8f55

Please sign in to comment.
Something went wrong with that request. Please try again.