diff options
author | David Mitchell <davem@iabyn.com> | 2022-12-02 12:42:07 +0000 |
---|---|---|
committer | Yves Orton <demerphq@gmail.com> | 2023-02-28 20:53:51 +0800 |
commit | 43442f48654ecf2a2d0ee079c3c24250dbc6db42 (patch) | |
tree | 48e3dd02fdc522a534280727a1204a6548bb571e | |
parent | c8ec0d5816566f56e1e1f229a2e9c9a1d46df8f3 (diff) | |
download | perl-43442f48654ecf2a2d0ee079c3c24250dbc6db42.tar.gz |
pp_sort(): add comments what the op flags mean
-rw-r--r-- | pp_sort.c | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -716,6 +716,24 @@ PP(pp_sort) ENTER; SAVEVPTR(PL_sortcop); + + /* Important flag meanings: + * + * OPf_STACKED sort <function_name> args + * + * (OPf_STACKED + * |OPf_SPECIAL) sort { <block> } args + * + * ---- standard block; e.g. sort { $a <=> $b } args + * + * + * OPpSORT_NUMERIC { $a <=> $b } (as opposed to $a cmp $b) + * OPpSORT_INTEGER ditto in scope of 'use integer' + * OPpSORT_DESCEND { $b <=> $a } + * OPpSORT_REVERSE @a= reverse sort ....; + * OPpSORT_INPLACE @a = sort @a; + */ + if (flags & OPf_STACKED) { if (flags & OPf_SPECIAL) { OP *nullop = OpSIBLING(cLISTOP->op_first); /* pass pushmark */ |