Skip to content

Commit

Permalink
Added parser setting
Browse files Browse the repository at this point in the history
  • Loading branch information
kfly8 committed Dec 20, 2024
1 parent 54dd7c9 commit ca886b3
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions lib/Syntax/Keyword/Assert.xs
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,9 @@ ok:
RETURN;
}

static int build_assert(pTHX_ OP **out, XSParseKeywordPiece *arg0, void *hookdata)
static int build_assert(pTHX_ OP **out, XSParseKeywordPiece *args[], size_t nargs, void *hookdata)
{
OP *argop = arg0->op;
OP *argop = args[0]->op;
if (assert_enabled) {
enum BinopType binoptype = classify_binop(argop->op_type);
if (binoptype) {
Expand All @@ -239,8 +239,14 @@ static int build_assert(pTHX_ OP **out, XSParseKeywordPiece *arg0, void *hookdat

static const struct XSParseKeywordHooks hooks_assert = {
.permit_hintkey = "Syntax::Keyword::Assert/assert",
.piece1 = XPK_TERMEXPR_SCALARCTX,
.build1 = &build_assert,
.pieces = (const struct XSParseKeywordPieceType[]) {
XPK_PARENS(
XPK_TERMEXPR_SCALARCTX,
XPK_OPTIONAL(XPK_COMMA),
XPK_TERMEXPR_SCALARCTX_OPT
)
},
.build = &build_assert,
};

MODULE = Syntax::Keyword::Assert PACKAGE = Syntax::Keyword::Assert
Expand Down

0 comments on commit ca886b3

Please sign in to comment.