Source-Changes-D archive

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

Re: CVS commit: src



Am 29.10.2021 um 22:40 schrieb Robert Elz:
     Date:        Fri, 29 Oct 2021 17:50:38 +0000
     From:        "Roland Illig" <rillig%netbsd.org@localhost>
     Message-ID:  <20211029175038.33B08FA97%cvs.NetBSD.org@localhost>

   | Log Message:
   | indent: use prev/curr/next to refer to the current token
   |
   | The word 'last' just didn't match with 'next'.

That depends upon how it is used, last is one of those "flexible"
words which means different things, depending upon the context.

It's exactly this flexibility that I wanted to eliminate from the code.

For example, the function process_command has the variable last_blank
that remembers the index of the last (rightmost) seen blank in a line.
In that case, "previous" and "last seen" and "rightmost" are equivalent,
which is OK in that context.

To avoid confusion in the parser_state, I wanted to use a different word
to specify the directly adjacent item, and prev/curr/next just seemed to
be a good fit in a situation of iterating over tokens, to avoid the
ambiguity of first/last and last/next. The code is still complicated
enough that I welcome every little bit of disambiguation that I can get.

Roland


Home | Main Index | Thread Index | Old Index