Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: 6169482089cb445aa192c06a636cea7306dab486
      
https://github.com/Perl/perl5/commit/6169482089cb445aa192c06a636cea7306dab486
  Author: Lukas Mai <[email protected]>
  Date:   2024-09-07 (Sat, 07 Sep 2024)

  Changed paths:
    M perly.act
    M perly.h
    M perly.tab
    M regen_perly.pl

  Log Message:
  -----------
  regen_perly.pl: remove mostly dead gather_tokens code

The idea behind this code was to find the big enum block in perlytmp.h
that looks like:

    enum yytokentype {
      YYEMPTY = -2,
      YYEOF = 0,                     /* "end of file"  */
      YYerror = 256,                 /* error  */
      YYUNDEF = 257,                 /* "invalid token"  */
      GRAMPROG = 258,                /* GRAMPROG  */
      GRAMEXPR = 259,                /* GRAMEXPR  */
      GRAMBLOCK = 260,               /* GRAMBLOCK  */
      ...
    };

... and append to it (in perly.h) a series of equivalent macro
definitions, one for each (non-negative) enum symbol:

    #define YYEOF 0
    #define YYerror 256
    #define YYUNDEF 257
    #define GRAMPROG 258
    #define GRAMEXPR 259
    #define GRAMBLOCK 260
    ...

However, due to slight formatting changes in the code generated by bison
3+, this code has been essentially dead because the starting regex
didn't match anymore, so $gather_tokens was never set to a true value.

The last time we had token macros in perly.h was before commit
a9f5ab8de628 (in 2016), in which I generated perly.h using bison 3 for
the first time (without noticing the disappearance of the token macros).

We could try to fix the regex logic in regen_perly.pl, but given that no
one has complained about the missing token macros in 8 years (as far as
I know), let's just remove the code. (Yay, accidental scream tests?)



To unsubscribe from these emails, change your notification settings at 
https://github.com/Perl/perl5/settings/notifications

Reply via email to