Module Name:    src
Committed By:   rillig
Date:           Thu May 11 09:28:53 UTC 2023

Modified Files:
        src/tests/usr.bin/indent: fmt_block.c fmt_decl.c fmt_else_comment.c
            label.c lsym_comment.c lsym_form_feed.c lsym_period.c opt_bl_br.c
            opt_ce.c opt_d.c opt_sob.c opt_v.c psym_if_expr_stmt_else.c
            t_errors.sh t_misc.sh t_options.awk
        src/usr.bin/indent: indent.c indent.h lexi.c parse.c

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/tests/usr.bin/indent/fmt_block.c \
    src/tests/usr.bin/indent/fmt_else_comment.c \
    src/tests/usr.bin/indent/label.c src/tests/usr.bin/indent/lsym_comment.c \
    src/tests/usr.bin/indent/lsym_form_feed.c \
    src/tests/usr.bin/indent/lsym_period.c src/tests/usr.bin/indent/opt_d.c \
    src/tests/usr.bin/indent/psym_if_expr_stmt_else.c
cvs rdiff -u -r1.36 -r1.37 src/tests/usr.bin/indent/fmt_decl.c
cvs rdiff -u -r1.6 -r1.7 src/tests/usr.bin/indent/opt_bl_br.c \
    src/tests/usr.bin/indent/opt_ce.c
cvs rdiff -u -r1.5 -r1.6 src/tests/usr.bin/indent/opt_sob.c
cvs rdiff -u -r1.8 -r1.9 src/tests/usr.bin/indent/opt_v.c
cvs rdiff -u -r1.24 -r1.25 src/tests/usr.bin/indent/t_errors.sh
cvs rdiff -u -r1.20 -r1.21 src/tests/usr.bin/indent/t_misc.sh
cvs rdiff -u -r1.10 -r1.11 src/tests/usr.bin/indent/t_options.awk
cvs rdiff -u -r1.245 -r1.246 src/usr.bin/indent/indent.c
cvs rdiff -u -r1.112 -r1.113 src/usr.bin/indent/indent.h
cvs rdiff -u -r1.172 -r1.173 src/usr.bin/indent/lexi.c
cvs rdiff -u -r1.49 -r1.50 src/usr.bin/indent/parse.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Reply via email to