Home | History | Annotate | Download | only in indent
History log of /src/tests/usr.bin/indent/lsym_comment.c
RevisionDateAuthorComments
 1.25  03-Jan-2025  rillig indent: fix line breaks in else-if sequences

The flag ps.want_newline did not adequately model the conditions under
which a line break should be inserted, thus the redesign.

A welcome side effect is that in statements like 'if (cond);', the
semicolon is now placed on a separate line, thus becoming more visible.
 1.24  23-Jun-2023  rillig branches: 1.24.2;
indent: fix scanning of no-wrap comments (since 2021.11.07.10.34.03)

The "refactoring" back then tried to be too clever.
 1.23  18-Jun-2023  rillig indent: remove support for backspace in code and comments

The C code in the whole tree does not contain a single literal
backspace.
 1.22  17-Jun-2023  rillig tests/indent: add miscellaneous test cases found during clean up
 1.21  14-Jun-2023  rillig indent: clean up handling of comments

One less moving part in the parser state.

No functional change.
 1.20  10-Jun-2023  rillig indent: miscellaneous cleanups
 1.19  10-Jun-2023  rillig indent: rename and sort variables in parser state

No functional change.
 1.18  06-Jun-2023  rillig indent: right-trim single-line comments
 1.17  06-Jun-2023  rillig tests/indent: comments with trailing whitespace may fit in a single line
 1.16  05-Jun-2023  rillig indent: fix trailing whitespace after comment
 1.15  21-May-2023  rillig tests/indent: fix outdated or wrong comments
 1.14  20-May-2023  rillig indent: implement blank line above block comment
 1.13  16-May-2023  rillig indent: remove support for form feed characters inside a line

Form feeds are occasionally used to split code into pages, and this use
is still supported. Having a form feed in the middle of a line is
exotic.
 1.12  15-May-2023  rillig indent: fix duplicate space between comment and binary operator
 1.11  15-May-2023  rillig indent: fix line wrapping of comments to the right of code
 1.10  15-May-2023  rillig indent: clean up memory and buffer management

Remove the need to explicitly initialize the buffers. To avoid
subtracting null pointers or comparing them using '<', migrate the
buffers from the (start, end) form to the (start, len) form. This form
also avoids inconsistencies in whether 'buf.e == buf.s' or 'buf.s ==
buf.e' is used.

Make buffer.st const, to avoid accidental modification of the buffer's
content.

Replace '*buf.e++ = ch' with buf_add_char, to avoid having to keep track
how much unwritten space is left in the buffer. Remove all safety
margins, that is, no more unchecked access to buf.st[-1] or appending
using '*buf.e++'.

Fix line number counting in lex_word for words that contain line breaks.

No functional change.
 1.9  14-May-2023  rillig indent: only null-terminate the buffers if necessary

The only case where a buffer is used as a C-style string is when looking
up a keyword.

No functional change.
 1.8  14-May-2023  rillig indent: fix handling of multiple block comments in a line
 1.7  13-May-2023  rillig indent: do not add a space before a comment that starts a line
 1.6  13-May-2023  rillig tests/indent: explain, clean up and add some tests
 1.5  11-May-2023  rillig indent: remove buggy code for swapping tokens

It is not the job of an indenter to swap tokens, even if it's only about
placing comments elsewhere. The code that swapped the tokens was
complicated, buggy and impossible to understand.

In -br (brace right) mode, indent no longer moves a '{' from the
beginning of a line to the end of the previous line, as that was handled
by the token swapping code as well. This change is unintended, but it
will be easier to re-add that now that the code is simpler.
 1.4  24-Apr-2022  rillig tests/indent: migrate token tests to other tests

In indent.h 1.49 from 2021-10-25, the enumeration token_type was split
into lexer_symbol and parser_symbol to more clearly express that these
tokens fall into completely different classes of usage patterns.
 1.3  24-Apr-2022  rillig tests/indent: change directive from '#' to '//'

Using a '//' instead of '#' turns the directives into well-formed C
code, resulting in fewer error markers in the editor.
 1.2  22-Apr-2022  rillig indent: remove FreeBSD IDs

Most of the IDs were empty anyway.
 1.1  18-Nov-2021  rillig tests/indent: add skeletons for testing tokens and parser symbols

The constants that were previously defined in indent_codes.h were a wild
mixture of tokens from the lexer and symbols on the parser stack. They
were split into separate types starting at indent.h 1.49 from 2021-10-25
and finishing at 1.73 from 2021-10-31.

To match the tests with the new token names, the old tests need to be
migrated to the newly added tests. This will take some time so first
add the skeletons and migrate them in smaller steps, cleaning them up
and extending them on the way.
 1.24.2.1  02-Aug-2025  perseant Sync with HEAD

RSS XML Feed