Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: 693e93a79a24ce8294b62f4c65497b9edc1da197
      
https://github.com/Perl/perl5/commit/693e93a79a24ce8294b62f4c65497b9edc1da197
  Author: Karl Williamson <[email protected]>
  Date:   2025-10-17 (Fri, 17 Oct 2025)

  Changed paths:
    M embed.fnc
    M proto.h
    M toke.c

  Log Message:
  -----------
  toke.c: White space/comments only

This does better vertical alignment, and fixes a typo in a comment that
led to it being misleading


  Commit: 438e1f58143ef38b328c0bf5c7a0a82b7d21e00b
      
https://github.com/Perl/perl5/commit/438e1f58143ef38b328c0bf5c7a0a82b7d21e00b
  Author: Karl Williamson <[email protected]>
  Date:   2025-10-17 (Fri, 17 Oct 2025)

  Changed paths:
    M toke.c

  Log Message:
  -----------
  S_parse_ident is not inline

So don't mark it as such in its definition.  embed.fnc already does not say it 
is inline.  It is too complicated to be inline.


  Commit: 9abb9be73eefcb53f2dff8cea4bab5eb71f9a092
      
https://github.com/Perl/perl5/commit/9abb9be73eefcb53f2dff8cea4bab5eb71f9a092
  Author: Karl Williamson <[email protected]>
  Date:   2025-10-17 (Fri, 17 Oct 2025)

  Changed paths:
    M toke.c

  Log Message:
  -----------
  toke.c: Simplify two ternaries

I don't know why these required ternaries; perhaps a bug in a C89
compiler.


  Commit: bfbd5f7e35650613ff4e802aa1facdf2b3aa3044
      
https://github.com/Perl/perl5/commit/bfbd5f7e35650613ff4e802aa1facdf2b3aa3044
  Author: Karl Williamson <[email protected]>
  Date:   2025-10-17 (Fri, 17 Oct 2025)

  Changed paths:
    M embed.fnc
    M embed.h
    M proto.h
    M toke.c

  Log Message:
  -----------
  toke.c: Use flags parameter for S_force_word

This makes it clear at each call point what is happening, instead of
having to jump to the S_force_word definition to know what 'false, true'
vs 'true, false' actually means.

And this prepares for future commits.


  Commit: 4349cf9cd0486e9818f0d91326218f56fd3cdfb2
      
https://github.com/Perl/perl5/commit/4349cf9cd0486e9818f0d91326218f56fd3cdfb2
  Author: Karl Williamson <[email protected]>
  Date:   2025-10-17 (Fri, 17 Oct 2025)

  Changed paths:
    M toke.c

  Log Message:
  -----------
  toke.c: Document S_parse_ident


  Commit: e4be40247756d7965d7fdda977f1c7d5d6728ba4
      
https://github.com/Perl/perl5/commit/e4be40247756d7965d7fdda977f1c7d5d6728ba4
  Author: Karl Williamson <[email protected]>
  Date:   2025-10-17 (Fri, 17 Oct 2025)

  Changed paths:
    M embed.fnc
    M embed.h
    M proto.h
    M toke.c

  Log Message:
  -----------
  toke.c: Use flags parameter to S_parse_ident

This makes it clearer at each call point what is happening, and prepares
for future commits where more flags will be passed to this function.


  Commit: 735e7cc211563d9eb8db6ac79d6da933c59df6f9
      
https://github.com/Perl/perl5/commit/735e7cc211563d9eb8db6ac79d6da933c59df6f9
  Author: Karl Williamson <[email protected]>
  Date:   2025-10-17 (Fri, 17 Oct 2025)

  Changed paths:
    M embed.fnc
    M embed.h
    M proto.h
    M toke.c

  Log Message:
  -----------
  toke.c: Change parse_ident to take any string

Prior to this commit, the string passed to this function had to be
pointing to somewhere in PL_bufptr.  But this is only because it assumed
that the initial position is less than PL_bufend.  By passing the upper
bound in, that assumption is automatically removed.


  Commit: bd66bdcc7de36e8e030001b7584bc6894a845d03
      
https://github.com/Perl/perl5/commit/bd66bdcc7de36e8e030001b7584bc6894a845d03
  Author: Karl Williamson <[email protected]>
  Date:   2025-10-17 (Fri, 17 Oct 2025)

  Changed paths:
    M embed.fnc
    M proto.h
    M toke.c

  Log Message:
  -----------
  parse_ident: Add const to two parameters

This function doesn't change anything in the string delimitted by these
parameters, and future commits will call it with const strings that
otherwise would have to cast away const


  Commit: 7ebcbe8d0ae48d2ea42b45311eb27e7964c63b76
      
https://github.com/Perl/perl5/commit/7ebcbe8d0ae48d2ea42b45311eb27e7964c63b76
  Author: Karl Williamson <[email protected]>
  Date:   2025-10-17 (Fri, 17 Oct 2025)

  Changed paths:
    M toke.c

  Log Message:
  -----------
  parse_ident: Use variable to avoid expression duplication

And make it clearer


  Commit: ec82a315a995762d49d0dc7a35241c48690fea84
      
https://github.com/Perl/perl5/commit/ec82a315a995762d49d0dc7a35241c48690fea84
  Author: Karl Williamson <[email protected]>
  Date:   2025-10-17 (Fri, 17 Oct 2025)

  Changed paths:
    M toke.c

  Log Message:
  -----------
  S_parse_ident: Terminate output with NUL

All calls to it did this termination individually.  Better to do it in
one place


  Commit: e75195e6bc46b0c74e08bfccc66f27083618dbad
      
https://github.com/Perl/perl5/commit/e75195e6bc46b0c74e08bfccc66f27083618dbad
  Author: Karl Williamson <[email protected]>
  Date:   2025-10-17 (Fri, 17 Oct 2025)

  Changed paths:
    M toke.c

  Log Message:
  -----------
  S_parse_ident: Restructure croaks

This removes the test for the identifier being too long at the beginning
of the loop.

Almost all the branches already have their own checks for this, and by
restructuring those slightly, this one becomes extraneous, except for
the one branch that didn't have a check.  And it turns out this was
wrong for that branch, which is the one that turns an apostrophe package
separator into ::.  The removed code assumed that the output doesn't
expand, whereas each single apostrophe is in fact replaced by two
characters.  This commit corrects that.

And it consolidates the handling to the target of a goto at the end of
the function.  Right now, there is no real advantage in that, but a
future commit will make the handling more complicated, so a single point
for it will be useful.


  Commit: 81f75d090cc77c9b718e0d0687eca61e2c4570ac
      
https://github.com/Perl/perl5/commit/81f75d090cc77c9b718e0d0687eca61e2c4570ac
  Author: Karl Williamson <[email protected]>
  Date:   2025-10-17 (Fri, 17 Oct 2025)

  Changed paths:
    M toke.c

  Log Message:
  -----------
  parse_ident: Use constant when known.

We know the contents of *s here; it is a colon.  Just use that instead
of derefencing.


  Commit: ce66c5749355bb2d24c3dd91a493726778c6a7b7
      
https://github.com/Perl/perl5/commit/ce66c5749355bb2d24c3dd91a493726778c6a7b7
  Author: Karl Williamson <[email protected]>
  Date:   2025-10-17 (Fri, 17 Oct 2025)

  Changed paths:
    M toke.c

  Log Message:
  -----------
  S_parse_ident: Collapse two branches into one

These branches differ only
    1)  in part of the conditions that indicate to take them, so combine
        those conditions together,
    2)  the number of bytes to advance, which is easily determinable

Otherwise they are identical, so it is easier to understand if they are
made common


  Commit: 8fd4cbe61656a5f4ef8aee6ed17ab6066e58165a
      
https://github.com/Perl/perl5/commit/8fd4cbe61656a5f4ef8aee6ed17ab6066e58165a
  Author: Karl Williamson <[email protected]>
  Date:   2025-10-17 (Fri, 17 Oct 2025)

  Changed paths:
    M toke.c

  Log Message:
  -----------
  S_parse_ident: Restructure loop

The loop is refactored to eliminate an assignment at the end, and I
think it is slightly clearer.  But more importantly, it prepares for
future commits.  There is some extra indentation that will make sense
when those commits are done


  Commit: bd3f5d9b50b8756dd2fbf8bacfd7e61aa8a6c320
      
https://github.com/Perl/perl5/commit/bd3f5d9b50b8756dd2fbf8bacfd7e61aa8a6c320
  Author: Karl Williamson <[email protected]>
  Date:   2025-10-17 (Fri, 17 Oct 2025)

  Changed paths:
    M toke.c

  Log Message:
  -----------
  S_parse_ident: Add ability to parse only IDFIRST strings

An identifier parsed by this function can include the ones most people
would expect, but also ones that begin with a digit followed by ASCII \w
characters.  This commit adds a flag so that the function doesn't
recognize the latter type as an identifier


  Commit: d2a0fb8c48c5baf9b54f467909b3ff0c824cf26e
      
https://github.com/Perl/perl5/commit/d2a0fb8c48c5baf9b54f467909b3ff0c824cf26e
  Author: Karl Williamson <[email protected]>
  Date:   2025-10-17 (Fri, 17 Oct 2025)

  Changed paths:
    M toke.c

  Log Message:
  -----------
  toke.c: Move some code into a called function

S_scan_ident accepts another type of identifier: all digits.  This moves
the code that looks for those into S_parse_ident, adding a flag to
accept them in that function.  This adds a bit of complexity to
S_parse_ident, removing equivalent complexity, and a bit more from
S_scan_ident.  Future commits will remove more complexity.

This commit does just a bit beyond the bare minimum to move the code.
The next commit will simplify the moved code a bit.


  Commit: 7b37a6046ccf67b59759c5bde2e5b8a1adc49d7f
      
https://github.com/Perl/perl5/commit/7b37a6046ccf67b59759c5bde2e5b8a1adc49d7f
  Author: Karl Williamson <[email protected]>
  Date:   2025-10-17 (Fri, 17 Oct 2025)

  Changed paths:
    M toke.c

  Log Message:
  -----------
  toke.c: S_parse_ident: simplify

The previous commit just moved some code and added comments.  This
commit takes advantage of the new place, and simplifies the code, using
the paradigm from the isWORDCHAR_A clause just below.


  Commit: 23f586a1b706f20714fab6c1734cf4d1a99f17aa
      
https://github.com/Perl/perl5/commit/23f586a1b706f20714fab6c1734cf4d1a99f17aa
  Author: Karl Williamson <[email protected]>
  Date:   2025-10-17 (Fri, 17 Oct 2025)

  Changed paths:
    M toke.c

  Log Message:
  -----------
  S_scan_ident: Replace redundant code with function call

The previous two commits moved some code into a function.  This commit
takes very similar code and replaces it with a call to that function.


  Commit: fec412a0e82ca22727c82eb43fc9a8a3089fdeb2
      
https://github.com/Perl/perl5/commit/fec412a0e82ca22727c82eb43fc9a8a3089fdeb2
  Author: Karl Williamson <[email protected]>
  Date:   2025-10-17 (Fri, 17 Oct 2025)

  Changed paths:
    M toke.c

  Log Message:
  -----------
  S_parse_ident: Add flag to check for legality and not croak

When this flag is set, when an illegal identifier is found, instead of
croaking the function returns NULL.  This will allow future commits to
use this function when all that is desired is to determine if the
identifier is legal or not.


  Commit: 9bc8cdede186b1ed90c338590e8511d9931004c2
      
https://github.com/Perl/perl5/commit/9bc8cdede186b1ed90c338590e8511d9931004c2
  Author: Karl Williamson <[email protected]>
  Date:   2025-10-17 (Fri, 17 Oct 2025)

  Changed paths:
    M parser.h

  Log Message:
  -----------
  Add #define for the maximum Perl identifier length

This gives a more meaningful mnemonic


  Commit: bd4c0d1fc2ffbd9bba3fde74f68c05acfa7debb2
      
https://github.com/Perl/perl5/commit/bd4c0d1fc2ffbd9bba3fde74f68c05acfa7debb2
  Author: Karl Williamson <[email protected]>
  Date:   2025-10-17 (Fri, 17 Oct 2025)

  Changed paths:
    M embed.fnc
    M embed.h
    M proto.h
    M toke.c

  Log Message:
  -----------
  Add S_parse_ident_no_copy()

This new function is for callers that are merely checking if the string
being parsed is a legal identifier or not, and arent interested in the
normalized version of the identifier that parse_indent() generates.

This new function allows callers to not have to think about this buffer;
it just wraps plain parse_ident() using a throw-away buffer to hold the
returned normalized text.  This avoids introducing a bunch of
conditionals inside parse_ident.


  Commit: e75a2dc5d0b44677e89de6b1397b9fe62e17b305
      
https://github.com/Perl/perl5/commit/e75a2dc5d0b44677e89de6b1397b9fe62e17b305
  Author: Karl Williamson <[email protected]>
  Date:   2025-10-17 (Fri, 17 Oct 2025)

  Changed paths:
    M toke.c

  Log Message:
  -----------
  Perl_valid_identifier_pve: Use parse_ident

Instead of rolling its own version, incompletely.


  Commit: ec8fb4ca440d25240bdf779967b119cb42325a1b
      
https://github.com/Perl/perl5/commit/ec8fb4ca440d25240bdf779967b119cb42325a1b
  Author: Karl Williamson <[email protected]>
  Date:   2025-10-17 (Fri, 17 Oct 2025)

  Changed paths:
    M embed.fnc
    M embed.h
    M parser.h
    M proto.h
    M toke.c

  Log Message:
  -----------
  Merge branch Generalize S_parse_ident' into blead

This series of commits documents, and generalizes this function so that
it can be called in more circumstances; the final commit calls it from
one such place, as a demonstration.

This includes adding a flag to it that allows code to be moved from
S_scan_ident to this function, and then called from a second place,
eliminating near-duplication.

The goal is to centralize to here the sort of handling of names, like
identifiers, so changes can be made in just one place, and we can get
rid of the other places which have slightly different rules from each
other.


Compare: https://github.com/Perl/perl5/compare/3450d19250e2...ec8fb4ca440d

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

Reply via email to