poke-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] pkl: make apush/apop applicable to unbounded arrays


From: Mohammad-Reza Nabipoor
Subject: Re: [PATCH] pkl: make apush/apop applicable to unbounded arrays
Date: Tue, 24 Jan 2023 00:34:49 +0100

Hi Jose.

On Tue, Jan 24, 2023 at 12:08:00AM +0100, Jose E. Marchesi wrote:
> 
> > +/* Make sure that apush/apop is not applied to an array with
> > +   fixed size boundary.  */
> > +
> > +PKL_PHASE_BEGIN_HANDLER (pkl_anal2_ps_op_apush_apop)
> > +{
> > +  pkl_ast_node exp = PKL_PASS_NODE;
> > +  pkl_ast_node arr = PKL_AST_EXP_OPERAND (exp, 0);
> > +  pkl_ast_node arr_type = PKL_AST_TYPE (arr);
> > +  pkl_ast_node arr_type_bound = PKL_AST_TYPE_A_BOUND (arr_type);
> > +
> > +  if (arr_type_bound)
> > +    {
> > +      if (PKL_AST_EXP_CODE (exp) == PKL_AST_OP_APUSH)
> > +        PKL_ERROR (PKL_AST_LOC (exp),
> > +                   "apush operation is not allowed on a bounded array");
> > +      else if (PKL_AST_EXP_CODE (exp) == PKL_AST_OP_APOP)
> > +        PKL_ERROR (PKL_AST_LOC (exp),
> > +                   "apop operation is not allowed on a bounded array");
> 
> s/operation// in both error messages.  Actually, what about:
> 
> PKL_ERROR (PKL_AST_LOC (exp),
>            "%s is not allowed on a bounded array",
>            PKL_AST_EXP_CODE (exp) == PKO_AST_OP_APUSH ? "apush" : "apop");
> 
> Other than that, OK for master.

Fixed and applied to master.
Thanks.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]