Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions embed.fnc
Original file line number Diff line number Diff line change
Expand Up @@ -2289,6 +2289,9 @@ ARdp |OP * |newBINOP |I32 type \
|I32 flags \
|NULLOK OP *first \
|NULLOK OP *last
dp |OP * |new_block_statement \
|NN OP *block \
|NULLOK OP *cont
ARdp |OP * |newCONDOP |I32 flags \
|NN OP *first \
|NULLOK OP *trueop \
Expand Down Expand Up @@ -2556,9 +2559,8 @@ px |OP * |op_unscope |NULLOK OP *o
ARdpx |OP * |op_wrap_finally|NN OP *block \
|NN OP *finally
: Used in perly.y
p |void |package |NN OP *o
: Used in perly.y
p |void |package_version|NN OP *v
dp |void |package |NN OP *name \
|NULLOK OP *version
Adp |void |packlist |NN SV *cat \
|NN const char *pat \
|NN const char *patend \
Expand Down
4 changes: 2 additions & 2 deletions embed.h
Original file line number Diff line number Diff line change
Expand Up @@ -1110,15 +1110,15 @@
# define newSVavdefelem(a,b,c) Perl_newSVavdefelem(aTHX_ a,b,c)
# define newXS_deffile(a,b) Perl_newXS_deffile(aTHX_ a,b)
# define newXS_len_flags(a,b,c,d,e,f,g) Perl_newXS_len_flags(aTHX_ a,b,c,d,e,f,g)
# define new_block_statement(a,b) Perl_new_block_statement(aTHX_ a,b)
# define nextargv(a,b) Perl_nextargv(aTHX_ a,b)
# define no_bareword_filehandle(a) Perl_no_bareword_filehandle(aTHX_ a)
# define noperl_die Perl_noperl_die
# define notify_parser_that_encoding_changed() Perl_notify_parser_that_encoding_changed(aTHX)
# define oopsAV(a) Perl_oopsAV(aTHX_ a)
# define oopsHV(a) Perl_oopsHV(aTHX_ a)
# define op_unscope(a) Perl_op_unscope(aTHX_ a)
# define package(a) Perl_package(aTHX_ a)
# define package_version(a) Perl_package_version(aTHX_ a)
# define package(a,b) Perl_package(aTHX_ a,b)
# define pad_add_weakref(a) Perl_pad_add_weakref(aTHX_ a)
# define pad_block_start(a) Perl_pad_block_start(aTHX_ a)
# define pad_fixup_inner_anons(a,b,c) Perl_pad_fixup_inner_anons(aTHX_ a,b,c)
Expand Down
54 changes: 45 additions & 9 deletions op.c
Original file line number Diff line number Diff line change
Expand Up @@ -4700,6 +4700,24 @@ Perl_block_end(pTHX_ I32 floor, OP *seq)
return retval;
}

/*
=for apidoc new_block_statement

Returns a C<OP *> representing block as statement.
Block is a loop that happens once.

Available since: v5.44

=cut
*/

OP*
Perl_new_block_statement (pTHX_ OP *block, OP *cont)
{
PERL_ARGS_ASSERT_NEW_BLOCK_STATEMENT;

return newWHILEOP (0, 1, NULL, NULL, block, cont, 0);
}
/*
=for apidoc_section $scope

Expand Down Expand Up @@ -6100,7 +6118,7 @@ Perl_newBINOP(pTHX_ I32 type, I32 flags, OP *first, OP *last)
? 2 /* Otherwise, minimum of 2 hex digits */\
: NUM_HEX_CHARS(num)))))))

/* To make evident, Configure with `-DDEBUGGING`, build, run
/* To make evident, Configure with `-DDEBUGGING`, build, run
* `./perl -Ilib -Dy t/op/tr.t`
*/
void
Expand Down Expand Up @@ -8223,13 +8241,11 @@ Perl_newPVOP(pTHX_ I32 type, I32 flags, char *pv)
return CHECKOP(type, pvop);
}

void
Perl_package(pTHX_ OP *o)
STATIC void
S_set_package_name(pTHX_ OP *o)
{
SV *const sv = cSVOPo->op_sv;

PERL_ARGS_ASSERT_PACKAGE;

SAVEGENERICSV(PL_curstash);
save_item(PL_curstname);

Expand All @@ -8243,17 +8259,37 @@ Perl_package(pTHX_ OP *o)
op_free(o);
}

void
Perl_package_version( pTHX_ OP *v )
STATIC void
S_set_package_version( pTHX_ OP *v )
{
U32 savehints = PL_hints;
PERL_ARGS_ASSERT_PACKAGE_VERSION;

PL_hints &= ~HINT_STRICT_VARS;
sv_setsv( GvSV(gv_fetchpvs("VERSION", GV_ADDMULTI, SVt_PV)), cSVOPx(v)->op_sv );
PL_hints = savehints;
op_free(v);
}

/*
=for apidoc package

Function sets current stash name and if $version is not NULL, sets it as C<$VERSION>.

It combines former C<package> and C<package_version> into single call.

=cut
*/

void
Perl_package (pTHX_ OP *name, OP *version)
{
PERL_ARGS_ASSERT_PACKAGE;

S_set_package_name (aTHX_ name);
if (version)
S_set_package_version (aTHX_ version);
}

/* Extract the first two components of a "version" object as two 8bit integers
* and return them packed into a single U16 in the format of PL_prevailing_version.
* This function only ever has to cope with version objects already known
Expand Down Expand Up @@ -16846,7 +16882,7 @@ Perl_subsignature_append_positional(pTHX_ PADOFFSET padix, OPCODE defmode, OP *d
signature->next_argix++;

if(!padix && !defexpr)
/* This param has no var and no defaulting expression. There's
/* This param has no var and no defaulting expression. There's
* nothing else for us to do here.
*/
return;
Expand Down
Loading
Loading