Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package perl-XS-Parse-Keyword for
openSUSE:Factory checked in at 2022-06-02 21:54:46
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-XS-Parse-Keyword (Old)
and /work/SRC/openSUSE:Factory/.perl-XS-Parse-Keyword.new.1548 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-XS-Parse-Keyword"
Thu Jun 2 21:54:46 2022 rev:6 rq:980494 version:0.23
Changes:
--------
---
/work/SRC/openSUSE:Factory/perl-XS-Parse-Keyword/perl-XS-Parse-Keyword.changes
2022-03-01 17:04:49.092353333 +0100
+++
/work/SRC/openSUSE:Factory/.perl-XS-Parse-Keyword.new.1548/perl-XS-Parse-Keyword.changes
2022-06-02 21:55:02.412432048 +0200
@@ -1,0 +2,22 @@
+Thu May 19 03:07:43 UTC 2022 - Tina M??ller <[email protected]>
+
+- updated to 0.23
+ see /usr/share/doc/packages/perl-XS-Parse-Keyword/Changes
+
+ 0.23 2022-05-18
+ [CHANGES]
+ * Defined XPK_KEYWORD, a better version of XPK_LITERAL for
+ keyword-like tokens
+ * Defined XPK_ARITHEXPR, a higher-precedence version of XPK_TERMEXPR
+ * Defined XPK_ARGSCOPE, a variant of XPK_PARENSCOPE where the parens
+ themselves are optional
+ * Undocument the old XPK_STRING token type
+
+ [BUGFIXES]
+ * Fixes for bugs that affect -DDEBUGGING-enabled perls
+ + Remember to clear OPf_KIDS when stealing the op_first of a
+ LISTOP (RT142770)
+ + Don't call cv_clone() at compiletime when unit testing;
generate
+ an OP_ANONCODE instead (RT142771)
+
+-------------------------------------------------------------------
Old:
----
XS-Parse-Keyword-0.22.tar.gz
New:
----
XS-Parse-Keyword-0.23.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ perl-XS-Parse-Keyword.spec ++++++
--- /var/tmp/diff_new_pack.FzZU97/_old 2022-06-02 21:55:02.872432633 +0200
+++ /var/tmp/diff_new_pack.FzZU97/_new 2022-06-02 21:55:02.876432639 +0200
@@ -18,7 +18,7 @@
%define cpan_name XS-Parse-Keyword
Name: perl-XS-Parse-Keyword
-Version: 0.22
+Version: 0.23
Release: 0
License: Artistic-1.0 OR GPL-1.0-or-later
Summary: XS functions to assist in parsing keyword syntax
++++++ XS-Parse-Keyword-0.22.tar.gz -> XS-Parse-Keyword-0.23.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/XS-Parse-Keyword-0.22/Build.PL
new/XS-Parse-Keyword-0.23/Build.PL
--- old/XS-Parse-Keyword-0.22/Build.PL 2022-02-21 22:38:00.000000000 +0100
+++ new/XS-Parse-Keyword-0.23/Build.PL 2022-05-18 18:50:09.000000000 +0200
@@ -46,7 +46,7 @@
int main(void) { struct Perl_custom_infix def; return 0; }
EOF
- ) if $] >= 5.035010;
+ ) if $] >= 5.037000; # maybe I'll start this in 5.37...
if( $have_pl_infix_plugin ) {
print "Including support for core perl PL_infix_plugin\n";
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/XS-Parse-Keyword-0.22/Changes
new/XS-Parse-Keyword-0.23/Changes
--- old/XS-Parse-Keyword-0.22/Changes 2022-02-21 22:38:00.000000000 +0100
+++ new/XS-Parse-Keyword-0.23/Changes 2022-05-18 18:50:09.000000000 +0200
@@ -1,5 +1,21 @@
Revision history for XS-Parse-Keyword
+0.23 2022-05-18
+ [CHANGES]
+ * Defined XPK_KEYWORD, a better version of XPK_LITERAL for
+ keyword-like tokens
+ * Defined XPK_ARITHEXPR, a higher-precedence version of XPK_TERMEXPR
+ * Defined XPK_ARGSCOPE, a variant of XPK_PARENSCOPE where the parens
+ themselves are optional
+ * Undocument the old XPK_STRING token type
+
+ [BUGFIXES]
+ * Fixes for bugs that affect -DDEBUGGING-enabled perls
+ + Remember to clear OPf_KIDS when stealing the op_first of a
+ LISTOP (RT142770)
+ + Don't call cv_clone() at compiletime when unit testing; generate
+ an OP_ANONCODE instead (RT142771)
+
0.22 2022-02-21
[CHANGES]
* Added XPK_AUTOSEMI piece type
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/XS-Parse-Keyword-0.22/MANIFEST
new/XS-Parse-Keyword-0.23/MANIFEST
--- old/XS-Parse-Keyword-0.22/MANIFEST 2022-02-21 22:38:00.000000000 +0100
+++ new/XS-Parse-Keyword-0.23/MANIFEST 2022-05-18 18:50:09.000000000 +0200
@@ -16,7 +16,11 @@
lib/XS/Parse/Keyword.xs
lib/XS/Parse/Keyword/Builder.pm
lib/XS/Parse/Keyword/Builder_data.pm.PL
+LICENSE
MANIFEST This list of files
+META.json
+META.yml
+README
src/infix.c
src/infix.h
src/keyword.c
@@ -27,6 +31,7 @@
t/30pieces-literal.t
t/31pieces-block.t
t/32pieces-anonsub.t
+t/33pieces-arithexpr.t
t/33pieces-listexpr.t
t/33pieces-termexpr.t
t/34pieces-ident.t
@@ -54,7 +59,3 @@
t/testcase.pm
XSParseInfix.h
XSParseKeyword.h
-README
-LICENSE
-META.yml
-META.json
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/XS-Parse-Keyword-0.22/META.json
new/XS-Parse-Keyword-0.23/META.json
--- old/XS-Parse-Keyword-0.22/META.json 2022-02-21 22:38:00.000000000 +0100
+++ new/XS-Parse-Keyword-0.23/META.json 2022-05-18 18:50:09.000000000 +0200
@@ -40,19 +40,19 @@
"provides" : {
"XS::Parse::Infix" : {
"file" : "lib/XS/Parse/Infix.pm",
- "version" : "0.22"
+ "version" : "0.23"
},
"XS::Parse::Infix::Builder" : {
"file" : "lib/XS/Parse/Infix/Builder.pm",
- "version" : "0.22"
+ "version" : "0.23"
},
"XS::Parse::Keyword" : {
"file" : "lib/XS/Parse/Keyword.pm",
- "version" : "0.22"
+ "version" : "0.23"
},
"XS::Parse::Keyword::Builder" : {
"file" : "lib/XS/Parse/Keyword/Builder.pm",
- "version" : "0.22"
+ "version" : "0.23"
}
},
"release_status" : "stable",
@@ -61,6 +61,6 @@
"http://dev.perl.org/licenses/"
]
},
- "version" : "0.22",
+ "version" : "0.23",
"x_serialization_backend" : "JSON::PP version 4.06"
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/XS-Parse-Keyword-0.22/META.yml
new/XS-Parse-Keyword-0.23/META.yml
--- old/XS-Parse-Keyword-0.22/META.yml 2022-02-21 22:38:00.000000000 +0100
+++ new/XS-Parse-Keyword-0.23/META.yml 2022-05-18 18:50:09.000000000 +0200
@@ -19,19 +19,19 @@
provides:
XS::Parse::Infix:
file: lib/XS/Parse/Infix.pm
- version: '0.22'
+ version: '0.23'
XS::Parse::Infix::Builder:
file: lib/XS/Parse/Infix/Builder.pm
- version: '0.22'
+ version: '0.23'
XS::Parse::Keyword:
file: lib/XS/Parse/Keyword.pm
- version: '0.22'
+ version: '0.23'
XS::Parse::Keyword::Builder:
file: lib/XS/Parse/Keyword/Builder.pm
- version: '0.22'
+ version: '0.23'
requires:
perl: '5.014'
resources:
license: http://dev.perl.org/licenses/
-version: '0.22'
+version: '0.23'
x_serialization_backend: 'CPAN::Meta::YAML version 0.018'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/XS-Parse-Keyword-0.22/README
new/XS-Parse-Keyword-0.23/README
--- old/XS-Parse-Keyword-0.22/README 2022-02-21 22:38:00.000000000 +0100
+++ new/XS-Parse-Keyword-0.23/README 2022-05-18 18:50:09.000000000 +0200
@@ -266,6 +266,20 @@
body of a new anonymous subroutine. This will be passed as a protosub
CV in the cv field.
+ XPK_ARITHEXPR
+
+ atomic, emits op.
+
+ XPK_ARITHEXPR
+
+ An arithmetic expression is expected, parsed using parse_arithexpr(),
+ and passed as an optree in the op field.
+
+ XPK_ARITHEXPR_VOIDCTX, XPK_ARITHEXPR_SCALARCTX
+
+ Variants of XPK_ARITHEXPR which puts the expression in void or scalar
+ context.
+
XPK_TERMEXPR
atomic, emits op.
@@ -424,8 +438,20 @@
XPK_OPTIONAL or XPK_REPEATED sequence, to provide a "secondary keyword"
that such a repeated item can look out for.
- This was previously called XPK_STRING, and is provided as a synonym for
- back-compatibility but new code should use this new name instead.
+ XPK_KEYWORD
+
+ atomic, can probe, emits nothing.
+
+ XPK_KEYWORD("keyword")
+
+ A literal string match is expected. No argument value is passed.
+
+ This is similar to XPK_LITERAL except that it additionally checks that
+ the following character is not an identifier character. This ensures
+ that the expected keyword-like behaviour is preserved. For example,
+ given the input "keyword", the piece XPK_LITERAL("key") would match it,
+ whereas XPK_KEYWORD("key") would not because of the subsequent "w"
+ character.
XPK_SEQUENCE
@@ -529,6 +555,22 @@
A structural type which expects to find a sequence of pieces, all
contained in parentheses as ( ... ). This will pass no extra arguments.
+ XPK_ARGSCOPE
+
+ structural, emits nothing.
+
+ XPK_ARGSCOPE(pieces ...)
+
+ A structural type similar to XPK_PARENSCOPE, except that the
+ parentheses themselves are optional; much like Perl's parsing of calls
+ to known functions.
+
+ If parentheses are encountered in the input, they will be consumed by
+ this piece and it will behave identically to XPK_PARENSCOPE. If there
+ is no open parenthesis, this piece will behave like XPK_SEQUENCE and
+ consume all the pieces inside it, without expecting a closing
+ parenthesis.
+
XPK_BRACKETSCOPE
structural, can probe, emits nothing.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/XS-Parse-Keyword-0.22/XSParseKeyword.h
new/XS-Parse-Keyword-0.23/XSParseKeyword.h
--- old/XS-Parse-Keyword-0.22/XSParseKeyword.h 2022-02-21 22:38:00.000000000
+0100
+++ new/XS-Parse-Keyword-0.23/XSParseKeyword.h 2022-05-18 18:50:09.000000000
+0200
@@ -31,8 +31,8 @@
XS_PARSE_KEYWORD_BLOCK = 0x10, /* op */
XS_PARSE_KEYWORD_ANONSUB, /* cv */
- /* TODO: XS_PARSE_KEYWORD_ARITHEXPR = 0x12 */
- XS_PARSE_KEYWORD_TERMEXPR = 0x13, /* op */
+ XS_PARSE_KEYWORD_ARITHEXPR, /* op */
+ XS_PARSE_KEYWORD_TERMEXPR, /* op */
XS_PARSE_KEYWORD_LISTEXPR, /* op */
/* TODO: XS_PARSE_KEYWORD_FULLEXPR = 0x15 */
XS_PARSE_KEYWORD_IDENT = 0x16, /* sv */
@@ -66,7 +66,8 @@
enum {
XPK_TYPEFLAG_OPT = (1<<16),
- XPK_TYPEFLAG_SPECIAL = (1<<17), /* on XPK_BLOCK: scoped
+ XPK_TYPEFLAG_SPECIAL = (1<<17), /* on XPK_LITERALSTR: keyword
+ on XPK_BLOCK: scoped
on XPK_LEXVAR: my */
/* These three are shifted versions of perl's G_VOID, G_SCALAR, G_LIST */
@@ -75,6 +76,8 @@
XPK_TYPEFLAG_G_LIST = (3<<18),
XPK_TYPEFLAG_ENTERLEAVE = (1<<20), /* wrap ENTER/LEAVE pair around the item
*/
+
+ XPK_TYPEFLAG_MAYBEPARENS = (1<<21), /* parens themselves are optional on
PARENSCOPE */
};
#define XPK_BLOCK_flags(flags) {.type = XS_PARSE_KEYWORD_BLOCK|(flags),
.u.pieces = NULL}
@@ -92,6 +95,10 @@
#define XPK_ANONSUB {.type = XS_PARSE_KEYWORD_ANONSUB}
+#define XPK_ARITHEXPR_flags(flags) {.type = XS_PARSE_KEYWORD_ARITHEXPR|(flags)}
+#define XPK_ARITHEXPR XPK_ARITHEXPR_flags(0)
+#define XPK_ARITHEXPR_VOIDCTX XPK_ARITHEXPR_flags(XPK_TYPEFLAG_G_VOID)
+#define XPK_ARITHEXPR_SCALARCTX XPK_ARITHEXPR_flags(XPK_TYPEFLAG_G_SCALAR)
#define XPK_TERMEXPR_flags(flags) {.type = XS_PARSE_KEYWORD_TERMEXPR|(flags)}
#define XPK_TERMEXPR XPK_TERMEXPR_flags(0)
#define XPK_TERMEXPR_VOIDCTX XPK_TERMEXPR_flags(XPK_TYPEFLAG_G_VOID)
@@ -121,6 +128,7 @@
#define XPK_LITERAL(s) {.type = XS_PARSE_KEYWORD_LITERALSTR, .u.str = (const
char *)s}
#define XPK_STRING(s) XPK_LITERAL(s)
#define XPK_AUTOSEMI {.type = XS_PARSE_KEYWORD_AUTOSEMI}
+#define XPK_KEYWORD(s) {.type =
XS_PARSE_KEYWORD_LITERALSTR|XPK_TYPEFLAG_SPECIAL, .u.str = (const char *)s}
#define XPK_INFIX(select) {.type = XS_PARSE_KEYWORD_INFIX, .u.c = select}
#define XPK_INFIX_RELATION XPK_INFIX(XPI_SELECT_RELATION)
@@ -154,6 +162,9 @@
#define XPK_PARENSCOPE_OPT(...) \
{.type = XS_PARSE_KEYWORD_PARENSCOPE|XPK_TYPEFLAG_OPT, .u.pieces = (const
struct XSParseKeywordPieceType []){ __VA_ARGS__, {0} }}
+#define XPK_ARGSCOPE(...) \
+ {.type = XS_PARSE_KEYWORD_PARENSCOPE|XPK_TYPEFLAG_MAYBEPARENS, .u.pieces =
(const struct XSParseKeywordPieceType []){ __VA_ARGS__, {0} }}
+
#define XPK_BRACKETSCOPE(...) \
{.type = XS_PARSE_KEYWORD_BRACKETSCOPE, .u.pieces = (const struct
XSParseKeywordPieceType []){ __VA_ARGS__, {0} }}
#define XPK_BRACKETSCOPE_OPT(...) \
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/XS-Parse-Keyword-0.22/lib/XS/Parse/Infix/Builder.pm
new/XS-Parse-Keyword-0.23/lib/XS/Parse/Infix/Builder.pm
--- old/XS-Parse-Keyword-0.22/lib/XS/Parse/Infix/Builder.pm 2022-02-21
22:38:00.000000000 +0100
+++ new/XS-Parse-Keyword-0.23/lib/XS/Parse/Infix/Builder.pm 2022-05-18
18:50:09.000000000 +0200
@@ -3,7 +3,7 @@
#
# (C) Paul Evans, 2021 -- [email protected]
-package XS::Parse::Infix::Builder 0.22;
+package XS::Parse::Infix::Builder 0.23;
use v5.14;
use warnings;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/XS-Parse-Keyword-0.22/lib/XS/Parse/Infix/Builder_data.pm.PL
new/XS-Parse-Keyword-0.23/lib/XS/Parse/Infix/Builder_data.pm.PL
--- old/XS-Parse-Keyword-0.22/lib/XS/Parse/Infix/Builder_data.pm.PL
2022-02-21 22:38:00.000000000 +0100
+++ new/XS-Parse-Keyword-0.23/lib/XS/Parse/Infix/Builder_data.pm.PL
2022-05-18 18:50:09.000000000 +0200
@@ -28,7 +28,7 @@
<$in_h> } );
__DATA__
-package XS::Parse::Infix::Builder_data 0.22;
+package XS::Parse::Infix::Builder_data 0.23;
use v5.14;
use warnings;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/XS-Parse-Keyword-0.22/lib/XS/Parse/Infix.pm
new/XS-Parse-Keyword-0.23/lib/XS/Parse/Infix.pm
--- old/XS-Parse-Keyword-0.22/lib/XS/Parse/Infix.pm 2022-02-21
22:38:00.000000000 +0100
+++ new/XS-Parse-Keyword-0.23/lib/XS/Parse/Infix.pm 2022-05-18
18:50:09.000000000 +0200
@@ -3,7 +3,7 @@
#
# (C) Paul Evans, 2021 -- [email protected]
-package XS::Parse::Infix 0.22;
+package XS::Parse::Infix 0.23;
use v5.14;
use warnings;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/XS-Parse-Keyword-0.22/lib/XS/Parse/Keyword/Builder.pm
new/XS-Parse-Keyword-0.23/lib/XS/Parse/Keyword/Builder.pm
--- old/XS-Parse-Keyword-0.22/lib/XS/Parse/Keyword/Builder.pm 2022-02-21
22:38:00.000000000 +0100
+++ new/XS-Parse-Keyword-0.23/lib/XS/Parse/Keyword/Builder.pm 2022-05-18
18:50:09.000000000 +0200
@@ -3,7 +3,7 @@
#
# (C) Paul Evans, 2021 -- [email protected]
-package XS::Parse::Keyword::Builder 0.22;
+package XS::Parse::Keyword::Builder 0.23;
use v5.14;
use warnings;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/XS-Parse-Keyword-0.22/lib/XS/Parse/Keyword/Builder_data.pm.PL
new/XS-Parse-Keyword-0.23/lib/XS/Parse/Keyword/Builder_data.pm.PL
--- old/XS-Parse-Keyword-0.22/lib/XS/Parse/Keyword/Builder_data.pm.PL
2022-02-21 22:38:00.000000000 +0100
+++ new/XS-Parse-Keyword-0.23/lib/XS/Parse/Keyword/Builder_data.pm.PL
2022-05-18 18:50:09.000000000 +0200
@@ -28,7 +28,7 @@
<$in_h> } );
__DATA__
-package XS::Parse::Keyword::Builder_data 0.22;
+package XS::Parse::Keyword::Builder_data 0.23;
use v5.14;
use warnings;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/XS-Parse-Keyword-0.22/lib/XS/Parse/Keyword.pm
new/XS-Parse-Keyword-0.23/lib/XS/Parse/Keyword.pm
--- old/XS-Parse-Keyword-0.22/lib/XS/Parse/Keyword.pm 2022-02-21
22:38:00.000000000 +0100
+++ new/XS-Parse-Keyword-0.23/lib/XS/Parse/Keyword.pm 2022-05-18
18:50:09.000000000 +0200
@@ -3,7 +3,7 @@
#
# (C) Paul Evans, 2021-2022 -- [email protected]
-package XS::Parse::Keyword 0.22;
+package XS::Parse::Keyword 0.23;
use v5.14;
use warnings;
@@ -283,6 +283,19 @@
new anonymous subroutine. This will be passed as a protosub CV in the I<cv>
field.
+=head2 XPK_ARITHEXPR
+
+I<atomic, emits op.>
+
+ XPK_ARITHEXPR
+
+An arithmetic expression is expected, parsed using C<parse_arithexpr()>, and
+passed as an optree in the I<op> field.
+
+=head2 XPK_ARITHEXPR_VOIDCTX, XPK_ARITHEXPR_SCALARCTX
+
+Variants of C<XPK_ARITHEXPR> which puts the expression in void or scalar
context.
+
=head2 XPK_TERMEXPR
I<atomic, emits op.>
@@ -438,8 +451,19 @@
C<XPK_OPTIONAL> or C<XPK_REPEATED> sequence, to provide a "secondary keyword"
that such a repeated item can look out for.
-This was previously called C<XPK_STRING>, and is provided as a synonym for
-back-compatibility but new code should use this new name instead.
+=head2 XPK_KEYWORD
+
+I<atomic, can probe, emits nothing.>
+
+ XPK_KEYWORD("keyword")
+
+A literal string match is expected. No argument value is passed.
+
+This is similar to C<XPK_LITERAL> except that it additionally checks that the
+following character is not an identifier character. This ensures that the
+expected keyword-like behaviour is preserved. For example, given the input
+C<"keyword">, the piece C<XPK_LITERAL("key")> would match it, whereas
+C<XPK_KEYWORD("key")> would not because of the subsequent C<"w"> character.
=head2 XPK_SEQUENCE
@@ -539,6 +563,20 @@
A structural type which expects to find a sequence of pieces, all contained in
parentheses as C<( ... )>. This will pass no extra arguments.
+=head2 XPK_ARGSCOPE
+
+I<structural, emits nothing.>
+
+ XPK_ARGSCOPE(pieces ...)
+
+A structural type similar to C<XPK_PARENSCOPE>, except that the parentheses
+themselves are optional; much like Perl's parsing of calls to known functions.
+
+If parentheses are encountered in the input, they will be consumed by this
+piece and it will behave identically to C<XPK_PARENSCOPE>. If there is no open
+parenthesis, this piece will behave like C<XPK_SEQUENCE> and consume all the
+pieces inside it, without expecting a closing parenthesis.
+
=head2 XPK_BRACKETSCOPE
I<structural, can probe, emits nothing.>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/XS-Parse-Keyword-0.22/src/infix.c
new/XS-Parse-Keyword-0.23/src/infix.c
--- old/XS-Parse-Keyword-0.22/src/infix.c 2022-02-21 22:38:00.000000000
+0100
+++ new/XS-Parse-Keyword-0.23/src/infix.c 2022-05-18 18:50:09.000000000
+0200
@@ -167,6 +167,7 @@
if(kid->op_type == OP_PADAV) {
/* \@padav can just yield the array directly */
cLISTOPx(cUNOPo->op_first)->op_first = NULL;
+ cLISTOPx(cUNOPo->op_first)->op_flags &= ~OPf_KIDS;
op_free(o);
kid->op_flags &= ~(OPf_MOD|OPf_REF);
@@ -177,6 +178,7 @@
* or something else, but whatever it is we might as well do it
*/
cLISTOPx(cUNOPo->op_first)->op_first = NULL;
+ cLISTOPx(cUNOPo->op_first)->op_flags &= ~OPf_KIDS;
op_free(o);
kid->op_flags &= ~(OPf_MOD|OPf_REF);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/XS-Parse-Keyword-0.22/src/keyword.c
new/XS-Parse-Keyword-0.23/src/keyword.c
--- old/XS-Parse-Keyword-0.22/src/keyword.c 2022-02-21 22:38:00.000000000
+0100
+++ new/XS-Parse-Keyword-0.23/src/keyword.c 2022-05-18 18:50:09.000000000
+0200
@@ -87,8 +87,8 @@
croak("parse failed--compilation aborted")
/* TODO: Only ASCII */
-#define lex_probe_str(s) MY_lex_probe_str(aTHX_ s)
-STRLEN MY_lex_probe_str(pTHX_ const char *s)
+#define lex_probe_str(s, b) MY_lex_probe_str(aTHX_ s, b)
+STRLEN MY_lex_probe_str(pTHX_ const char *s, bool boundarycheck)
{
STRLEN i;
for(i = 0; s[i]; i++) {
@@ -96,13 +96,16 @@
return 0;
}
+ if(boundarycheck && isALNUM(PL_parser->bufptr[i]))
+ return 0;
+
return i;
}
-#define lex_expect_str(s) MY_lex_expect_str(aTHX_ s)
-void MY_lex_expect_str(pTHX_ const char *s)
+#define lex_expect_str(s, b) MY_lex_expect_str(aTHX_ s, b)
+void MY_lex_expect_str(pTHX_ const char *s, bool boundarycheck)
{
- STRLEN len = lex_probe_str(s);
+ STRLEN len = lex_probe_str(s, boundarycheck);
if(!len)
yycroakf("Expected \"%s\"", s);
@@ -168,6 +171,8 @@
#endif
CopLINE(PL_curcop);
+ bool is_special = !!(piece->type & XPK_TYPEFLAG_SPECIAL);
+
U32 type = piece->type & 0xFFFF;
switch(type) {
@@ -181,7 +186,7 @@
case XS_PARSE_KEYWORD_LITERALSTR:
{
- STRLEN len = lex_probe_str(piece->u.str);
+ STRLEN len = lex_probe_str(piece->u.str, is_special);
if(!len)
return FALSE;
@@ -303,6 +308,9 @@
}
case XS_PARSE_KEYWORD_PARENSCOPE:
+ if(piece->type & XPK_TYPEFLAG_MAYBEPARENS)
+ croak("TODO: probe_piece on type=PARENSCOPE+MAYBEPARENS");
+
if(lex_peek_unichar(0) != '(')
return FALSE;
@@ -372,7 +380,7 @@
return;
case XS_PARSE_KEYWORD_LITERALSTR:
- lex_expect_str(piece->u.str);
+ lex_expect_str(piece->u.str, is_special);
return;
case XS_PARSE_KEYWORD_AUTOSEMI:
@@ -455,6 +463,7 @@
return;
}
+ case XS_PARSE_KEYWORD_ARITHEXPR:
case XS_PARSE_KEYWORD_TERMEXPR:
/* TODO: This auto-parens behaviour ought to be tuneable, depend on how
* many args, open at i=0 and close at i=MAX, etc...
@@ -471,7 +480,14 @@
lex_expect_unichar(')');
}
else {
- THISARG.op = parse_termexpr(0);
+ switch(type) {
+ case XS_PARSE_KEYWORD_ARITHEXPR:
+ THISARG.op = parse_arithexpr(0);
+ break;
+ case XS_PARSE_KEYWORD_TERMEXPR:
+ THISARG.op = parse_termexpr(0);
+ break;
+ }
CHECK_PARSEFAIL;
}
@@ -646,21 +662,34 @@
return;
case XS_PARSE_KEYWORD_PARENSCOPE:
+ {
+ bool has_paren = (lex_peek_unichar(0) == '(');
+
if(is_optional) {
THISARG.i = 0;
(*argidx)++;
- if(lex_peek_unichar(0) != '(') return;
+ if(!has_paren) return;
THISARG.i++;
}
- lex_expect_unichar('(');
- lex_read_space(0);
+ if(has_paren) {
+ lex_expect_unichar('(');
+ lex_read_space(0);
- parse_pieces(aTHX_ argsv, argidx, piece->u.pieces, hookdata);
+ parse_pieces(aTHX_ argsv, argidx, piece->u.pieces, hookdata);
- lex_expect_unichar(')');
+ lex_expect_unichar(')');
+ }
+ else if(piece->type & XPK_TYPEFLAG_MAYBEPARENS) {
+ /* We didn't find a '(' but that's OK; they're optional */
+ parse_pieces(aTHX_ argsv, argidx, piece->u.pieces, hookdata);
+ }
+ else
+ /* We know this should fail */
+ lex_expect_unichar('(');
return;
+ }
case XS_PARSE_KEYWORD_BRACKETSCOPE:
if(is_optional) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/XS-Parse-Keyword-0.22/t/30pieces-literal.t
new/XS-Parse-Keyword-0.23/t/30pieces-literal.t
--- old/XS-Parse-Keyword-0.22/t/30pieces-literal.t 2022-02-21
22:38:00.000000000 +0100
+++ new/XS-Parse-Keyword-0.23/t/30pieces-literal.t 2022-05-18
18:50:09.000000000 +0200
@@ -21,6 +21,11 @@
}
{
+ my $ret = piecekw bar ;
+ is( $ret, "bar", 'result of piecekw' );
+}
+
+{
my $ret1 = do { pieceautosemi; };
is( $ret1, "EOS", 'result of pieceautosemi with ;' );
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/XS-Parse-Keyword-0.22/t/33pieces-arithexpr.t
new/XS-Parse-Keyword-0.23/t/33pieces-arithexpr.t
--- old/XS-Parse-Keyword-0.22/t/33pieces-arithexpr.t 1970-01-01
01:00:00.000000000 +0100
+++ new/XS-Parse-Keyword-0.23/t/33pieces-arithexpr.t 2022-05-18
18:50:09.000000000 +0200
@@ -0,0 +1,38 @@
+#!/usr/bin/perl
+
+use v5.14;
+use warnings;
+
+use Test::More;
+
+use lib "t";
+use testcase "t::pieces";
+
+BEGIN { $^H{"t::pieces/permit"} = 1; }
+
+my $ret;
+
+{
+ $ret = piecearithexpr "a term";
+ is( $ret, "(a term)", 'a single term' );
+}
+
+# arithexpr vs concat
+{
+ $ret = piecearithexpr "x" . "y";
+ is( $ret, "(xy)", 'arithexpr consumes concat' );
+}
+
+# arithexpr vs comma
+{
+ $ret = join "", "x", piecearithexpr "inside", "y";
+ is( $ret, "x(inside)y", 'arithexpr stops before comma' );
+}
+
+# arithexpr in piece1 can act as entire parens
+{
+ $ret = piecearithexpr( "x" ) . "y";
+ is( $ret, "(x)y", 'arithexpr treats (PARENS) as entire expression' );
+}
+
+done_testing;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/XS-Parse-Keyword-0.22/t/42scopes.t
new/XS-Parse-Keyword-0.23/t/42scopes.t
--- old/XS-Parse-Keyword-0.22/t/42scopes.t 2022-02-21 22:38:00.000000000
+0100
+++ new/XS-Parse-Keyword-0.23/t/42scopes.t 2022-05-18 18:50:09.000000000
+0200
@@ -15,6 +15,12 @@
is( scopeparen ( "abc" ), "abc", 'parenthesis scope' );
}
+# arg scope - parens are optional
+{
+ is( scopeargs ( "123" ), "123", 'arguments scope with parens' );
+ is( scopeargs "123", "123", 'arguments scope without parens' );
+}
+
# bracket scope
{
is( scopebracket [ "def" ], "def", 'bracket scope' );
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/XS-Parse-Keyword-0.22/t/pieces.xs
new/XS-Parse-Keyword-0.23/t/pieces.xs
--- old/XS-Parse-Keyword-0.22/t/pieces.xs 2022-02-21 22:38:00.000000000
+0100
+++ new/XS-Parse-Keyword-0.23/t/pieces.xs 2022-05-18 18:50:09.000000000
+0200
@@ -42,7 +42,8 @@
static int build_anonsub(pTHX_ OP **out, XSParseKeywordPiece *arg0, void
*hookdata)
{
- *out = newSVOP(OP_CONST, 0, newRV_noinc((SV *)cv_clone(arg0->cv)));
+ *out = newUNOP(OP_REFGEN, 0,
+ newSVOP(OP_ANONCODE, 0, (SV *)arg0->cv));
return KEYWORD_PLUGIN_EXPR;
}
@@ -176,6 +177,13 @@
.build1 = &build_anonsub,
};
+static const struct XSParseKeywordHooks hooks_arithexpr = {
+ .permit_hintkey = hintkey,
+
+ .piece1 = XPK_ARITHEXPR,
+ .build1 = &build_expr,
+};
+
static const struct XSParseKeywordHooks hooks_termexpr = {
.permit_hintkey = hintkey,
@@ -277,6 +285,13 @@
.build1 = &build_literal,
};
+static const struct XSParseKeywordHooks hooks_kw = {
+ .permit_hintkey = hintkey,
+
+ .piece1 = XPK_KEYWORD("bar"),
+ .build1 = &build_literal,
+};
+
static const struct XSParseKeywordHooks hooks_autosemi = {
.permit_hintkey = hintkey,
@@ -297,6 +312,7 @@
register_xs_parse_keyword("pieceprefixedblock_VAR",
&hooks_prefixedblock_VAR, "$VAR");
register_xs_parse_keyword("pieceanonsub", &hooks_anonsub, NULL);
+ register_xs_parse_keyword("piecearithexpr", &hooks_arithexpr, NULL);
register_xs_parse_keyword("piecetermexpr", &hooks_termexpr, NULL);
register_xs_parse_keyword("piecelistexpr", &hooks_listexpr, NULL);
@@ -318,5 +334,6 @@
register_xs_parse_keyword("piececolon", &hooks_colon, newSVpvs("colon"));
register_xs_parse_keyword("piecestr", &hooks_str, newSVpvs("foo"));
+ register_xs_parse_keyword("piecekw", &hooks_kw, newSVpvs("bar"));
register_xs_parse_keyword("pieceautosemi", &hooks_autosemi, newSVpvs("EOS"));
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/XS-Parse-Keyword-0.22/t/structures.xs
new/XS-Parse-Keyword-0.23/t/structures.xs
--- old/XS-Parse-Keyword-0.22/t/structures.xs 2022-02-21 22:38:00.000000000
+0100
+++ new/XS-Parse-Keyword-0.23/t/structures.xs 2022-05-18 18:50:09.000000000
+0200
@@ -117,6 +117,16 @@
.build = &build_op,
};
+static const struct XSParseKeywordHooks hooks_scope_args = {
+ .permit_hintkey = hintkey,
+
+ .pieces = (const struct XSParseKeywordPieceType []){
+ XPK_ARGSCOPE( XPK_TERMEXPR ),
+ {0}
+ },
+ .build = &build_op,
+};
+
static const struct XSParseKeywordHooks hooks_scope_bracket = {
.permit_hintkey = hintkey,
@@ -161,6 +171,7 @@
register_xs_parse_keyword("structcommalist", &hooks_commalist, NULL);
register_xs_parse_keyword("scopeparen", &hooks_scope_paren, NULL);
+ register_xs_parse_keyword("scopeargs", &hooks_scope_args, NULL);
register_xs_parse_keyword("scopebracket", &hooks_scope_bracket, NULL);
register_xs_parse_keyword("scopebrace", &hooks_scope_brace, NULL);
register_xs_parse_keyword("scopechevron", &hooks_scope_chevron, NULL);