develooper Front page | perl.perl5.changes | Postings from November 2022

[Perl/perl5] d32ea1: regcomp.c - add a PARNO() macro to wrap theARG() ...

From:
Yves Orton via perl5-changes
Date:
November 9, 2022 15:10
Subject:
[Perl/perl5] d32ea1: regcomp.c - add a PARNO() macro to wrap theARG() ...
Message ID:
Perl/perl5/push/refs/heads/yves/parno_macro/cfa161-d32ea1@github.com
  Branch: refs/heads/yves/parno_macro
  Home:   https://github.com/Perl/perl5
  Commit: d32ea1be2cef413816531dd9b3b9681bd2fb9a88
      https://github.com/Perl/perl5/commit/d32ea1be2cef413816531dd9b3b9681bd2fb9a88
  Author: Yves Orton <demerphq@gmail.com>
  Date:   2022-11-09 (Wed, 09 Nov 2022)

  Changed paths:
    M regcomp.c
    M regcomp.h
    M regexec.c

  Log Message:
  -----------
  regcomp.c - add a PARNO() macro to wrap the ARG() macro

We used the ARG() macro to access the parno data for the OPEN
and CLOSE regops. This made it difficult to find what needed to
change when the type and size or location of this data in the
node was modified. Replacing this access with a specific macro
makes the code more legible and future proof.

This was actually backported from finding everything that broke
by changing the regnode type for OPEN and CLOSE to 2L and moving
the paren parameter to the 2L slot. We might do something like this
in the future and separating the PARNO() macros from their
implementation will make it easier.





nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About