From ca886b32b360650ef162213978c48c4e2f711fbb Mon Sep 17 00:00:00 2001 From: kobaken Date: Fri, 20 Dec 2024 20:48:24 +0900 Subject: [PATCH] Added parser setting --- lib/Syntax/Keyword/Assert.xs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/Syntax/Keyword/Assert.xs b/lib/Syntax/Keyword/Assert.xs index 805ebac..fdf05f5 100644 --- a/lib/Syntax/Keyword/Assert.xs +++ b/lib/Syntax/Keyword/Assert.xs @@ -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) { @@ -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