In perl.git, the branch sprout/lvref has been created
<http://perl5.git.perl.org/perl.git/commitdiff/bd4af6377ff145719fd77053afa2ca332b580757?hp=0000000000000000000000000000000000000000>
at bd4af6377ff145719fd77053afa2ca332b580757 (commit)
- Log -----------------------------------------------------------------
commit bd4af6377ff145719fd77053afa2ca332b580757
Author: Father Chrysostomos <[email protected]>
Date: Mon Sep 29 21:43:53 2014 -0700
Add lvavref op type
This will be used for slurpy array ref assignments. \(@a) = \(@b)
will make @a share the same elements as @b.
M ext/Opcode/Opcode.pm
M lib/B/Op_private.pm
M opcode.h
M opnames.h
M pp_proto.h
commit ae6421cdf367f9c2fafb0eb0e97756241fc2b8ad
Author: Father Chrysostomos <[email protected]>
Date: Mon Sep 29 21:40:28 2014 -0700
lvref is actually a baseop/unop
When used for pad vars, it is childless.
M opcode.h
M regen/opcodes
commit 943b2d0132c0b89597c2adfdb6d7529631185e55
Author: Father Chrysostomos <[email protected]>
Date: Mon Sep 29 18:03:57 2014 -0700
List assignment to array and hash refs
(\@a,\%h)=... works, but \(@a) and \(%h) do not. \(%h) correctly
croaks. (\local @a, \local %h)=... also works.
M mg.c
M op.c
M pp.c
M t/op/lvref.t
commit 7271a154ee978f38eb06024908b03187b467e6b9
Author: Father Chrysostomos <[email protected]>
Date: Mon Sep 29 16:10:44 2014 -0700
Fix up Peek.t for magic flag renumbering
M ext/Devel-Peek/t/Peek.t
commit d5d3bb2009804d743ce200897e92767e3910053d
Author: Father Chrysostomos <[email protected]>
Date: Mon Sep 29 15:48:24 2014 -0700
Renumber OPpLVREF_TYPE
so it can be copied to mg_flags without conflicting with the generic
magic flags. The previous commit made room in mg_flags for this.
M lib/B/Op_private.pm
M mg.h
M opcode.h
M regen/op_private
commit 15d3b936565328f42cd066119b8ec8eedbeb968e
Author: Father Chrysostomos <[email protected]>
Date: Mon Sep 29 15:45:21 2014 -0700
mg.h: Renumber magic flags
Put all the generic flags in the lower bits and the private flags in
the higher bits.
This makes it easier to understand whatâs what and also provides more
wiggle room for magic types that need contiguous bits available.
M mg.h
commit bfe74aa44a9a0ece1d35e1931b25b6524ec08823
Author: Father Chrysostomos <[email protected]>
Date: Sun Sep 28 22:17:27 2014 -0700
Assignment to \local @array and \local %hash
Doesnât work with lhs parentheses yet.
M pp.c
M t/op/lvref.t
commit a2fab7898e4f3550f71623f462dd694263e2b84e
Author: Father Chrysostomos <[email protected]>
Date: Sun Sep 28 11:45:57 2014 -0700
lvref.t: Tests for localised arrays and hashes
M t/op/lvref.t
commit e3f5ee0517d03bce9a6c286cea935a9b62c6d760
Author: Father Chrysostomos <[email protected]>
Date: Sun Sep 28 00:53:19 2014 -0700
lvref.t: Test assigning non-array to array
Same with hashes.
M t/op/lvref.t
commit 541a3418a9e3cab3b799d2822642917b0e829927
Author: Father Chrysostomos <[email protected]>
Date: Sun Sep 28 00:52:45 2014 -0700
Simple \@array and \%hash assignment
Parentheses do not work yet. Neither does local.
M op.c
M pp.c
M t/op/lvref.t
commit 2cd1a173424bc4683c5b6a71a8fd734f898059a6
Author: Father Chrysostomos <[email protected]>
Date: Sun Sep 28 00:42:09 2014 -0700
lvref.t: To-do tests for hashes
Concerning the error message tests, âparenthesized hashâ would be more
helpful than âhash dereferenceâ or âprivate hashâ (as would be
provided
by OP_DESC), as %foo doesnât look like a hash dereference and âprivate
hashâ suggests that \%foo= wonât work, whereas it will.
M t/op/lvref.t
commit fce3182a17fd23a5986b3301dfbe56c3b3885e6c
Author: Father Chrysostomos <[email protected]>
Date: Sat Sep 27 22:03:25 2014 -0700
Add priv flags for the type of lvalue ref
M lib/B/Op_private.pm
M opcode.h
M regen/op_private
commit 98889dd8bac47e2dfb9babe98ea1c60d0b0741a4
Author: Father Chrysostomos <[email protected]>
Date: Sat Sep 27 18:44:57 2014 -0700
lvref.t: To-do tests for array ref assignment
The evals are temporary. Some of the tests donât even make sense
with the evals; they are more placeholders and reminders for now
that tests.
M t/op/lvref.t
commit 1022ec1236c0ea33ca9cbd09c1d653e9e296f263
Author: Father Chrysostomos <[email protected]>
Date: Sat Sep 27 14:17:09 2014 -0700
pp.c: Fold SvIV into S_localise_aelem_lval
All three callers were doing SvIV, so we can do it in one spot.
M pp.c
commit 13b864133c2c6a144d25ca7d118d3fd57bd4c0da
Author: Father Chrysostomos <[email protected]>
Date: Sat Sep 27 14:15:50 2014 -0700
pp.c: Some branch prediction hints
M pp.c
commit f7bb3c9d5a9ea2f3fa70d44dba3631aca2589229
Author: Father Chrysostomos <[email protected]>
Date: Sat Sep 27 14:15:00 2014 -0700
Assignment to hash element refs
M mg.c
M op.c
M pp.c
M t/op/lvref.t
commit 17363302094d267f84c42c1d4c78b1d079eaf548
Author: Father Chrysostomos <[email protected]>
Date: Sat Sep 27 11:07:35 2014 -0700
pp.c: Consolidate some local aelem code
In the process, avoid a redundant av_fetch for \local$a[0]= and
\local($a[0])=.
M pp.c
commit 3d44f83f225a3056e7e80144854a4fd7ec80c0f6
Author: Father Chrysostomos <[email protected]>
Date: Sat Sep 27 10:49:46 2014 -0700
pp.c:pp_lvrefslice: Unused var
M pp.c
commit dbc724e6b09ec074a97b781e3595a2e659db0dcf
Author: Father Chrysostomos <[email protected]>
Date: Sat Sep 27 10:49:24 2014 -0700
\local $a[$ix] assignment
M pp.c
M t/op/lvref.t
commit 7ef2eafdb633ee27220cde463986c2ff808eb640
Author: Father Chrysostomos <[email protected]>
Date: Fri Sep 26 10:40:19 2014 -0700
\@array[@slice] assignment
plus changes to the aelem tests to check rhs context.
I did \local @a[@s] at the same time, since I was practically copying
and pasting code from aslice (ok, not quite).
M op.c
M pp.c
M t/op/lvref.t
commit 0e08f9782131ed3f390feff46a71eb355218190a
Author: Father Chrysostomos <[email protected]>
Date: Thu Sep 25 22:13:33 2014 -0700
pp.c: Dodge compiler warning
M pp.c
commit 9959e4bf57a4b4bf96f95d9dcd14f5e3d1adfc99
Author: Father Chrysostomos <[email protected]>
Date: Thu Sep 25 22:10:39 2014 -0700
lvrefslice gets OPpLVAL_INTRO
M lib/B/Op_private.pm
M opcode.h
M regen/op_private
commit 2a32c67b0265b39629586cfa440a078ed9e46daa
Author: Father Chrysostomos <[email protected]>
Date: Thu Sep 25 22:08:15 2014 -0700
Add lvrefslice op type
M ext/Opcode/Opcode.pm
M opcode.h
M opnames.h
M pp.c
M pp_proto.h
M regen/opcodes
commit 468ab42666ece9f134734029f04dc5e7fd82abf0
Author: Father Chrysostomos <[email protected]>
Date: Thu Sep 25 20:34:11 2014 -0700
Assignment to array elem refs
M lib/B/Op_private.pm
M mg.c
M op.c
M opcode.h
M pp.c
M regen/op_private
M t/op/lvref.t
commit 5d7f157b350ef1397c55d2e57ddd7aefd0bb4318
Author: Father Chrysostomos <[email protected]>
Date: Thu Sep 25 16:10:14 2014 -0700
\local $scalar assignment
M op.c
M pp.c
M t/op/lvref.t
commit f9afb616e318b4f69ddf46bf8de9648a371d79b0
Author: Father Chrysostomos <[email protected]>
Date: Thu Sep 25 13:10:22 2014 -0700
Make \($x,$y) assignment work
This applies to \ with multiple kids (refgen). Up till now,
op_lvalue_flags only handled srefgen (single refgen).
Before I was converting srefgen to lvref and nulling the kid op:
srefgen
ex-list
rv2sv
gv
became:
lvref
ex-list
ex-rv2sv
gv
Now Iâm converting the kid instead and nulling the srefgen:
ex-srefgen
ex-list
lvref
gv
so that the same code can apply to refgen:
refgen
ex-list
pushmark
rv2sv
gv
rv2sv
gv
becomes
ex-refgen
ex-list
ex-pushmark
lvref
gv
lvref
gv
M op.c
M t/op/lvref.t
M t/op/ref.t
commit 79fbccfb322a512552933cf973a957ec8b4632f3
Author: Father Chrysostomos <[email protected]>
Date: Thu Sep 25 08:19:13 2014 -0700
List assignment to lexical scalar refs
\($x,$y)=... does not work yet, but \(my $x) and (\$x, \$y) do.
M lib/B/Op_private.pm
M mg.c
M op.c
M opcode.h
M pp.c
M regen/op_private
M t/op/lvref.t
commit 14604b6a8a918698aede4d9ac97919a21d616846
Author: Father Chrysostomos <[email protected]>
Date: Wed Sep 24 22:13:01 2014 -0700
Fix assertion failure with ... ? \$a : \$b = ...
Because both branches have a srefgen, this was treated as a scalar
reference assignment, which is usually handled by refassign. But
refassign expects the thing on the lhs to be srefgen, not a cond_expr.
The logic for propagating the assignment type must not propagate the
âASSIGN_REFâ type outward. Only list context propagates outward.
Eventually, this will be handled by sassign and the cond_expr will
have lvref kids. (Itâs too complicated for refassign, which is the
optimised form that combines \ and = into one op.)
For now, this commit just fixes the assertion failure without making
this type of assignment work yet.
M op.c
M t/op/lvref.t
commit f82d5d791b0535257cb1e974adb17d012c10eebe
Author: Father Chrysostomos <[email protected]>
Date: Wed Sep 24 16:21:03 2014 -0700
op.c: Apply spair optimisation to \% \@ \&
The âspairâ (scalar/single pair) optimisation applies to a few operat-
ors for which there are actually pairs of ops, one for scalars or sin-
gle items, the other for lists. refgen is one of them.
When taking references, hashes, arrays and subroutines are single
items, just like scalars, so they can go through the âsingleâ code and
benefit, too.
refassign will also benefit from this, as \@a = [] (not yet imple-
mented) should provide scalar context to the right-hand side, and this
avoids the need for special cases (because srefgen with the initial s
provides scalar context).
(This optimisation could have applied to aggregates passed to cho(m)p,
but it results in incorrect messages like âUninitialized value in sca-
lar chompâ for chomp @_, so Iâve left it for now.)
M op.c
M t/lib/warnings/op
commit be5669070e24d7d276cfb03d180c42f61d02431a
Author: Father Chrysostomos <[email protected]>
Date: Sun Sep 28 22:50:57 2014 -0700
Use âCanât modify reference to...â for refassign, too
M op.c
M t/op/lvref.t
commit faf149fb03c4887d2c7b31c65b92d7b53ed1ddb5
Author: Father Chrysostomos <[email protected]>
Date: Wed Sep 24 14:22:38 2014 -0700
op.c: diag_listed_as for âCan't modify refâ
M op.c
commit aa588632c206a805d1c01e557b668cf44ff0af9a
Author: Father Chrysostomos <[email protected]>
Date: Wed Sep 24 14:20:48 2014 -0700
lvref.t: Test âCan't modify reference to...â
M t/op/lvref.t
commit 99b55dd2f4c3ba1df1484a80e1a1c351f0c71b00
Author: Father Chrysostomos <[email protected]>
Date: Wed Sep 24 13:22:49 2014 -0700
List assignment to package scalar ref
\ on the lhs returns a special magical scalar with set-magic that does
the aliasing.
I considered having a separate abind op that would be like aassign,
but different. However, I realised that for ($x, \$y) = ... to work
it would have to duplicate all of aassign. So I went with the sim-
pler magic implementation.
M mg.c
M op.c
M pp.c
M t/op/lvref.t
commit ccec94b4dfce207e65a367dd16467c2cbed60b21
Author: Father Chrysostomos <[email protected]>
Date: Wed Sep 24 01:45:47 2014 -0700
Capitalise magic descriptions consistently
M mg_raw.h
M mg_vtable.h
M pod/perlguts.pod
M regen/mg_vtable.pl
commit bf7c1a9d6631384221409e3b4d7ede5bd4ac7c85
Author: Father Chrysostomos <[email protected]>
Date: Wed Sep 24 01:42:30 2014 -0700
Add lvref magic type
I just couldnât resist using the backslash for the character, even
though I had to tweak mg_vtable.pl to make it work.
M embed.fnc
M embed.h
M mg.c
M mg_names.c
M mg_raw.h
M mg_vtable.h
M pod/perlguts.pod
M proto.h
M regen/mg_vtable.pl
commit b254f3d82e8bf78efe435e1e6fe290a0503b71f5
Author: Father Chrysostomos <[email protected]>
Date: Wed Sep 24 00:58:23 2014 -0700
Add lvref op type
M ext/Opcode/Opcode.pm
M lib/B/Op_private.pm
M opcode.h
M opnames.h
M pp.c
M pp_proto.h
M regen/opcode.pl
M regen/opcodes
commit 25a7748ed98ca1f163fcc3bb21bccc5672fb7209
Author: Father Chrysostomos <[email protected]>
Date: Wed Sep 24 00:19:33 2014 -0700
lvref.t: More parenthesized scalar ref tests
These tests are actually nonsensical with the evals, but they currently
cause syntax errors. Ultimately they are placeholders and reminders,
so it doesnât matter.
M t/op/lvref.t
commit 0c53c18147b1b27156e299272a77fa84722ca4d9
Author: Father Chrysostomos <[email protected]>
Date: Tue Sep 23 22:33:09 2014 -0700
lvref.t: Some assignments with mixed lhs
M t/op/lvref.t
commit 2869957745e4aca8e8ac45766633ed56e00a34b8
Author: Father Chrysostomos <[email protected]>
Date: Sun Sep 21 23:11:32 2014 -0700
Implement \my $x = ...
M lib/B/Op_private.pm
M op.c
M opcode.h
M pp.c
M regen/op_private
M t/op/lvref.t
commit daa1c6c0e72e8d840681d52786f2bb9c08cf294f
Author: Father Chrysostomos <[email protected]>
Date: Sun Sep 21 16:04:23 2014 -0700
lvref.t: Test \$foo = \*bar
M t/op/lvref.t
commit f4b9d86939764dd929cf82b0c3795f7591a2cf92
Author: Father Chrysostomos <[email protected]>
Date: Sun Sep 21 15:04:20 2014 -0700
lvref.t: To-do tests for foreach \
M t/op/lvref.t
commit 4356772292f33f68abdc4527d06da5380ade1901
Author: Father Chrysostomos <[email protected]>
Date: Sun Sep 21 14:58:15 2014 -0700
lvret.t: To-do tests for \local $scalar=
M t/op/lvref.t
commit 3e7fbd784865fa3ac21d4f6e5a81ba0e699f512f
Author: Father Chrysostomos <[email protected]>
Date: Sun Sep 21 14:43:37 2014 -0700
When making lex alias, donât free old var too soon
It could be exactly the same variable, and the reference on the rhs
could be weak:
use feature ":all";
use Scalar::Util 'weaken';
my $a;
weaken($r = \$a);
\$a = $r;
__END__
Lvalue references are experimental at - line 5.
Segmentation fault: 11
M pp.c
M t/op/lvref.t
commit 88e1a8c4c694d3f7ab71e2d112c14f25f62f437d
Author: Father Chrysostomos <[email protected]>
Date: Sun Sep 21 14:23:00 2014 -0700
lvref.t: To-do test for PADSTALE handling
M t/op/lvref.t
commit 00fa3aa7579abc380499498b68d03ecfe07d4160
Author: Father Chrysostomos <[email protected]>
Date: Sun Sep 21 13:56:01 2014 -0700
Simple package scalar lvalue refs
\$::x = ... works, but not \local $x yet.
M embed.fnc
M embed.h
M op.c
M pp.c
M proto.h
M sv.c
M t/op/lvref.t
commit aaec7f7dff9f5017f8b94bb8e2ee9f7deb49b12e
Author: Father Chrysostomos <[email protected]>
Date: Sun Sep 21 12:29:30 2014 -0700
lvref.t: Tests for error massages
M t/op/lvref.t
commit c13a25e290d02e037544ec3e27476382fbdddd74
Author: Father Chrysostomos <[email protected]>
Date: Sun Sep 21 11:19:41 2014 -0700
lvref.t: Remove to-do and eval from passing test
This one passing test was failing inside the eval because closures
are not yet supported. (Thatâs why I added explicit closure tests
in the previous commit.)
M t/op/lvref.t
commit 8d604e1a4cd10a4bcf29bf79862899dc55e9a536
Author: Father Chrysostomos <[email protected]>
Date: Sun Sep 21 11:16:33 2014 -0700
lvref.t: To-do tests for closures
M t/op/lvref.t
commit 61788342d845f759e46cf84c5004d69b66bd4d0c
Author: Father Chrysostomos <[email protected]>
Date: Sun Sep 21 00:22:41 2014 -0700
Document lvalue ref diagnostics
Also, use âa SCALAR referenceâ rather than âa scalar referenceâ, to
match the style used elsewhere.
M pod/perldiag.pod
M pp.c
commit af9a8a1d183afeea66494d05946b918dc8bcc8dc
Author: Father Chrysostomos <[email protected]>
Date: Sat Sep 20 14:49:04 2014 -0700
First stab at lexical scalar aliases
No \my$x= yet. Only my $x; \$x =....
It does not work properly with variables closed over from outside;
hence, all the to-do tests fail still, since they do the assign-
ment in evals.
But this much works:
$ ./miniperl -Ilib -Mfeature=:all -e 'my $m; \$m = \$n; warn \$m; warn \$n'
Lvalue references are experimental at -e line 1.
SCALAR(0x7fa04b805510) at -e line 1.
SCALAR(0x7fa04b805510) at -e line 1.
M embed.fnc
M embed.h
M op.c
M opcode.h
M pp.c
M proto.h
M regen/opcodes
M scope.c
commit 46a70ae801aaf16e4c45f4cf7aa25a27be70e790
Author: Father Chrysostomos <[email protected]>
Date: Sat Sep 20 23:33:26 2014 -0700
op.c: In newBINOP, set up op_last before CHECKOP
Set up op_last pointers in newBINOP before calling the op-specific
ck_* routine.
That way, since this op sub-tree is well-formed from the outset, we
donât need as much fix-up code elsewhere to account for the case where
the binop has been embedded inside a larger op tree (state var ini-
tialisation).
The repetition operator is an odd bird. If the lhs is a list of one
item, it is effectively an unop, though still of class binop. Though
op_last would usually point to the last immediate child, it ended
up null instead. B::Deparse was written to expect that, so letâs
keep it that way by setting it to null in ck_repeat, now that the
last = first->sibling assignment in newBINOP (which used to do it)
happens earlier.
M op.c
commit 7aaa5f06f48d5f80bc5513e1e1194618f7fd67fa
Author: Father Chrysostomos <[email protected]>
Date: Sat Sep 20 13:48:48 2014 -0700
Increase $Opcode::VERSION to 1.29
M ext/Opcode/Opcode.pm
commit 34d97c0f7d015d8136a2640f469236ce4cfbdaa4
Author: Father Chrysostomos <[email protected]>
Date: Sat Sep 20 13:47:58 2014 -0700
Add refassign op type
M ext/Opcode/Opcode.pm
M lib/B/Op_private.pm
M opcode.h
M opnames.h
M pp.c
M pp_proto.h
M regen/opcodes
commit 81a20d98c1eca679f7a8f5eb614233eb02727ef4
Author: Father Chrysostomos <[email protected]>
Date: Sat Sep 20 13:27:47 2014 -0700
op.c:ck_spair: Remove redundant checks
Neither the av nor the hv ops have the OA_RETSCALAR flag, so these
checks are unreachable.
These checks go all the way back to a0d0e21e (perl 5.000).
M op.c
commit 9ec3dac0da209c505ca0772b47b598cfdc5d6d8f
Author: Father Chrysostomos <[email protected]>
Date: Sat Sep 20 11:46:14 2014 -0700
To-do tests for scalar lvalue refs
M MANIFEST
A t/op/lvref.t
commit da3043222cf49dee529371ea8da618f1bf744511
Author: Father Chrysostomos <[email protected]>
Date: Sat Sep 20 11:16:08 2014 -0700
Increase $warnings::VERSION to 1.27
M lib/warnings.pm
M regen/warnings.pl
commit ea729b1060bba8b424b0c59a31ad63ebff54fa8c
Author: Father Chrysostomos <[email protected]>
Date: Sat Sep 20 11:15:18 2014 -0700
Add experimental::lvalue_refs warnings category
M lib/warnings.pm
M regen/warnings.pl
M warnings.h
commit e3ac08773f6cdf5dfed5057ce960e604ddac0431
Author: Father Chrysostomos <[email protected]>
Date: Sat Sep 20 11:13:58 2014 -0700
Increase $feature::VERSION to 1.38
M lib/feature.pm
M regen/feature.pl
commit f740f1970ca3800dbba07351ccb32c0c024c594a
Author: Father Chrysostomos <[email protected]>
Date: Sat Sep 20 11:12:37 2014 -0700
Add lvalue_refs feature feature
M feature.h
M lib/feature.pm
M regen/feature.pl
-----------------------------------------------------------------------
--
Perl5 Master Repository