History log of /freebsd/usr.bin/indent/lexi.c (Results 1 – 25 of 88)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 5e3934b1 24-Nov-2023 Warner Losh <imp@FreeBSD.org>

usr.bin: Automated cleanup of cdefs and other formatting

Apply the following automated changes to try to eliminate
no-longer-needed sys/cdefs.h includes as well as now-empty
blank lines in a row.

R

usr.bin: Automated cleanup of cdefs and other formatting

Apply the following automated changes to try to eliminate
no-longer-needed sys/cdefs.h includes as well as now-empty
blank lines in a row.

Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/
Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/
Remove /\n+#if.*\n#endif.*\n+/
Remove /^#if.*\n#endif.*\n/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/

Sponsored by: Netflix

show more ...


# bdcbfde3 23-Nov-2023 Warner Losh <imp@FreeBSD.org>

usr.bin: Remove ancient SCCS tags.

Remove ancient SCCS tags from the tree, automated scripting, with two
minor fixup to keep things compiling. All the common forms in the tree
were removed with a pe

usr.bin: Remove ancient SCCS tags.

Remove ancient SCCS tags from the tree, automated scripting, with two
minor fixup to keep things compiling. All the common forms in the tree
were removed with a perl script.

Sponsored by: Netflix

show more ...


Revision tags: release/14.0.0
# 1d386b48 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/


# b5b9eaa9 29-Jun-2023 Dag-Erling Smørgrav <des@FreeBSD.org>

Restore and document -ps / -nps option.

Sponsored by: Klara, Inc.
Reviewed by: pauamma_gundo.com, pstef, kevans
Differential Revision: https://reviews.freebsd.org/D40788


Revision tags: release/13.2.0, release/12.4.0, release/13.1.0, release/12.3.0
# 288e5536 14-Aug-2021 Gordon Bergling <gbe@FreeBSD.org>

Fix a few typos in source code comments

- s/procesing/processing/

MFC after: 5 days


Revision tags: release/13.0.0, release/12.2.0, release/11.4.0, release/12.1.0, release/11.3.0, release/12.0.0
# 3611ec60 18-Aug-2018 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r337646 through r338014.


# dad19de0 15-Aug-2018 Piotr Pawel Stefaniak <pstef@FreeBSD.org>

indent(1): bug fix after r336333

The bug was that isalnum() is not exactly equivalent to previous code which
also allowed characters "$" and "_", so check for those explicitly.

Reported by: tuexen@


# 01c66110 16-Jul-2018 Piotr Pawel Stefaniak <pstef@FreeBSD.org>

indent(1): rewrite the integer/floating constant scanning part of lexi.c

Remove procedural code that did the scanning, which was faulty and didn't
support complex constants such as 0x1p-61. Replace

indent(1): rewrite the integer/floating constant scanning part of lexi.c

Remove procedural code that did the scanning, which was faulty and didn't
support complex constants such as 0x1p-61. Replace it with a finite state
machine expressed as a transition table. The table was rewritten by hand
from lx's output, given parts of grammar expressed as regular expressions.

lx is Katherine Flavel's lexer generator, currently available at
https://github.com/katef/libfsm and the parts of grammar were taken from
http://quut.com/c/ANSI-C-grammar-l-2011.html and extended to support binary
integer constants which are a popular GCC extension.

Reported by: bde

show more ...


Revision tags: release/11.2.0
# 7e53aaed 10-Jun-2018 Piotr Pawel Stefaniak <pstef@FreeBSD.org>

indent(1): group global option variables into an options structure

It's clearer now when a variable represents a toggable command line option.

Many options were stored in the parser's state structu

indent(1): group global option variables into an options structure

It's clearer now when a variable represents a toggable command line option.

Many options were stored in the parser's state structure, so fix also that.

show more ...


# 2364d1a7 03-Jun-2018 Piotr Pawel Stefaniak <pstef@FreeBSD.org>

indent(1): if an identifier can be either a typedef name or as a struct
member, it is taken as the latter


# 9de29bfb 03-Jun-2018 Piotr Pawel Stefaniak <pstef@FreeBSD.org>

indent(1): improve CHECK_SIZE_ macros

Rewrite the macros so that they take a parameter. Consumers use it to signal
how much room in the buffer they need; this lets them do that once when
required sp

indent(1): improve CHECK_SIZE_ macros

Rewrite the macros so that they take a parameter. Consumers use it to signal
how much room in the buffer they need; this lets them do that once when
required space is known instead of doing the check once every loop step.

Also take the parameter value into consideration when resizing the buffer;
the requested space may be larger than the constant 400 bytes that the
previous version used - now it's the sum of those two values.

On the consumer side, don't copy strings byte by byte - use memcpy().

Deduplicate code that copied base 2, base 8 and base 16 literals.

Don't advance the e_token pointer once the token has been copied into
s_token. This allows easy calculation of the token's length.

show more ...


# 1479f36d 03-Jun-2018 Piotr Pawel Stefaniak <pstef@FreeBSD.org>

indent(1): remove troff output support

The troff output in indent was invented at Sun and the online documentation
for some post-SunOS operating system includes this:
The usual way to get a troff

indent(1): remove troff output support

The troff output in indent was invented at Sun and the online documentation
for some post-SunOS operating system includes this:
The usual way to get a troffed listing is with the command
indent -troff program.c | troff -mindent

The indent manual page in FreeBSD 1.0 already lacks that information and
troff -mindent complains about not being able to find the macro file.
It seems that the file did exist on SunOS and was supposed to be imported
into 4.3BSD together with the feature, but that has never happened.

Removal of troff output support simplifies a lot of indent's code.

vgrind(1) seems to be a promising replacement.

show more ...


# e1baf57e 03-Jun-2018 Piotr Pawel Stefaniak <pstef@FreeBSD.org>

indent(1): limit character classification functions' input to unsigned char


# 95b813e5 03-Jun-2018 Piotr Pawel Stefaniak <pstef@FreeBSD.org>

indent(1): recognize more type names

Most are from C99.


# 9522d0b0 03-Jun-2018 Piotr Pawel Stefaniak <pstef@FreeBSD.org>

indent(1): don't format function declarations as variables


# f9287a9d 03-Jun-2018 Piotr Pawel Stefaniak <pstef@FreeBSD.org>

indent(1): disjoint parser state from lexi()

The function is sometimes used as a look-ahead, so ideally it should bear
no information about parser state.


# 63c3f226 03-Jun-2018 Piotr Pawel Stefaniak <pstef@FreeBSD.org>

indent(1): improve predictability of lexi()

lexi() reads the input stream and categorizes the next token. indent will
sometimes buffer up a sequence of tokens in order rearrange them. That is
needed

indent(1): improve predictability of lexi()

lexi() reads the input stream and categorizes the next token. indent will
sometimes buffer up a sequence of tokens in order rearrange them. That is
needed for properly cuddling else or placing braces correctly according to
the chosen style (KNF vs Allman) when comments are around. The loop that
buffers tokens up uses lexi() to decide if it's time to stop buffering. Then
the temporary buffer is used to feed lexi() the same tokens again, this time
for normal processing.

The problem is that lexi() apart from recognizing the token, can change
a lot of information about the current state, for example ps.last_nl,
ps.keyword, buf_ptr. It also abandons leading whitespace, which is needed
mainly for comment-related considerations. So the call to lexi() while
tokens are buffered up and categorized can change the state before they're
read again for normal processing which may easily result in changing
interpretation of the current state and lead to incorrect output.

To work around the problems:
1) copy the whitespace into the save_com buffer so that it will be read
again when processed
2) trick lexi() into modifying a temporary copy of the parser state instead
of the original.

show more ...


# 5bdd8509 03-Jun-2018 Piotr Pawel Stefaniak <pstef@FreeBSD.org>

indent(1): remove undocumented and rather useless option (-ps)

It's used to treat the "->" access operator as a binary operator and put
space characters around it.


# 3bbaa755 01-Jun-2018 Piotr Pawel Stefaniak <pstef@FreeBSD.org>

indent(1): don't indent typedef declarations as object declarations


# 937d37fc 19-Nov-2017 Hans Petter Selasky <hselasky@FreeBSD.org>

Merge ^/head r325842 through r325998.


# df57947f 18-Nov-2017 Pedro F. Giffuni <pfg@FreeBSD.org>

spdx: initial adoption of licensing ID tags.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensou

spdx: initial adoption of licensing ID tags.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

Special thanks to Wind River for providing access to "The Duke of
Highlander" tool: an older (2014) run over FreeBSD tree was useful as a
starting point.

Initially, only tag files that use BSD 4-Clause "Original" license.

RelNotes: yes
Differential Revision: https://reviews.freebsd.org/D13133

show more ...


Revision tags: release/10.4.0
# 531c2d7a 24-Jul-2017 Enji Cooper <ngie@FreeBSD.org>

MFhead@r320180


# bca9d05f 23-Jul-2017 Hans Petter Selasky <hselasky@FreeBSD.org>

Merge ^/head r319973 through 321382.


# a3abcad0 23-Jul-2017 Piotr Pawel Stefaniak <pstef@FreeBSD.org>

indent(1): don't produce unneeded space character in function declarators.


Revision tags: release/11.1.0
# ea1e967c 19-May-2017 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r318380 through r318559.


1234