| 01c66110 | 16-Jul-2018 |
Piotr Pawel Stefaniak <[email protected]> |
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 ...
|
| d0f86f66 | 04-Jun-2018 |
Piotr Pawel Stefaniak <[email protected]> |
indent(1): add --version option
There exist multi-platform programs that check indent's version in order to know what they can expect from it. GNU indent provides that via --version, so implement th
indent(1): add --version option
There exist multi-platform programs that check indent's version in order to know what they can expect from it. GNU indent provides that via --version, so implement the same option here.
show more ...
|
| aac30b75 | 03-Jun-2018 |
Piotr Pawel Stefaniak <[email protected]> |
indent(1): new option -lpl
With -lpl, code surrounded by parentheses in continuation lines is lined up even if it would extend past the right margin.
With -nlpl (the default), such a line that woul
indent(1): new option -lpl
With -lpl, code surrounded by parentheses in continuation lines is lined up even if it would extend past the right margin.
With -nlpl (the default), such a line that would extend past the right margin is moved left to keep it within the margin, if that does not require placing it to the left of the prevailing indentation level.
These switches have no effect if -nlp is selected.
Submitted by: Tom Lane
show more ...
|
| 971e1c47 | 03-Jun-2018 |
Piotr Pawel Stefaniak <[email protected]> |
indent(1): new option -lpl (always line up to parenthesis)
With -lp, if a line has an opening paren which is not closed on that line, then continuation lines will be lined up to start at the charact
indent(1): new option -lpl (always line up to parenthesis)
With -lp, if a line has an opening paren which is not closed on that line, then continuation lines will be lined up to start at the character position just after the opening paren.
Submitted by: Tom Lane
show more ...
|
| 9de29bfb | 03-Jun-2018 |
Piotr Pawel Stefaniak <[email protected]> |
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 <[email protected]> |
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 ...
|