christos
562596981f
match the new compiler warning
2023-05-24 20:02:34 +00:00
christos
c59fd10753
no more md5 for you.
2023-05-24 18:22:05 +00:00
rillig
e9b5780b33
indent: fix indentation of struct declarations
2023-05-23 16:53:57 +00:00
rillig
fadc996fc6
indent: fix spacing around '*' in declarations
2023-05-23 06:43:19 +00:00
rillig
756425c686
indent: fix spacing in declarations in for loops
2023-05-23 06:35:01 +00:00
rillig
3368225913
tests/indent: add code snippets found in make and lint1
2023-05-23 06:18:00 +00:00
rillig
8bd40c7adb
indent: fix spacing between block braces
2023-05-22 23:03:16 +00:00
rillig
9bf982382f
tests/indent: refine a few tests
2023-05-22 23:01:27 +00:00
rillig
27a3cefcf0
tests/lint1: allow whitespace in files containing the expected output
...
This reduces the amount of wizardry needed to interpret the files. For
a more gentle introduction of the file format, see ../lint2/msg_000.ln.
The whitespace that is removed is very similar to the one in the lint2
tests, the difference is that '%<space>' and '%#' need to be preserved
in abbreviated printf and scanf format strings.
2023-05-22 20:11:24 +00:00
rillig
960cfb1b4e
lint: fix emitted type for arrays of unknown size
2023-05-22 17:53:27 +00:00
rillig
f14ab694cd
lint: rename constant NOTSPEC to NO_TSPEC
...
It was too easy to misread the old name as NOT_SPEC instead of the
intended NO_TSPEC.
2023-05-22 12:55:04 +00:00
rillig
9379c1663f
tests/lint: demonstrate wrong emitted array length in initialization
...
Seen in usr.bin/indent/debug.c, in the various 'name' arrays.
2023-05-22 11:51:46 +00:00
rillig
b95ee04d96
indent: implement suppressing optional blank lines
2023-05-22 10:28:59 +00:00
rillig
0df62e5bf6
tests/indent: skip creating an intermediate file in tests
2023-05-22 06:35:56 +00:00
andvar
e7745f3aff
s/thar/that/ in comments.
2023-05-21 18:01:38 +00:00
rillig
c99fb69e72
tests/indent: fix outdated or wrong comments
2023-05-21 10:18:44 +00:00
rillig
4779b6fb88
indent: don't error out on unrecognized preprocessor directives
...
This allows indent to be used on the GCC preprocessor output.
2023-05-21 09:48:22 +00:00
rillig
89b72942a5
tests/indent: prevent 'indent end' with arguments
2023-05-20 22:08:07 +00:00
rillig
a9183f83be
tests/indent: migrate test driver from AWK to Lua
...
Lua reports more details when os.execute fails, which is useful when
running old versions of indent for comparison. The new test driver also
supports multiple test files in the same run.
2023-05-20 21:32:05 +00:00
rillig
04185e831b
tests/indent: clean up test driver
...
No functional change.
2023-05-20 17:31:53 +00:00
rillig
fe2fb3c8db
indent: don't insert blank line between two closing lines
2023-05-20 12:05:01 +00:00
rillig
5a9a628018
indent: implement blank line above block comment
2023-05-20 11:19:17 +00:00
rillig
1764a17f2c
indent: implement blank line after function body
2023-05-20 10:46:21 +00:00
rillig
c7613eff0b
indent: ensure that no blank lines are inserted in INDENT OFF mode
...
No blank lines were inserted previously, but the code looked
suspicious as if that were possible.
2023-05-20 10:25:47 +00:00
rillig
4d19140d48
indent: implement blank lines around conditional compilation
2023-05-20 10:09:02 +00:00
rillig
895746d7ed
tests/indent: test multi-line comments with -ncdb
2023-05-19 07:05:26 +00:00
rillig
d46fdfe393
indent: document the funcname token
2023-05-18 08:09:28 +00:00
rillig
2d18db1bfc
indent: manually wrap overly long lines
...
No functional change.
2023-05-18 05:33:27 +00:00
gutteridge
b1f970ed17
t_ptm.c: add a test case that passes extra flags
...
Validate that O_NONBLOCK and O_CLOEXEC are actually set by
posix_openpt(3), as until circa 9.99.101 they were not.
If/when other flags are added like close-on-fork, this test could be
adjusted. The current concern is with supporting the expectations of
components like vte3, used by various graphical terminal clients.
2023-05-17 03:16:11 +00:00
rillig
81c7fd789d
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.
2023-05-16 11:32:01 +00:00
rillig
db245c79a9
indent: remove blank between comment and parentheses or brackets
...
Finally, indent formats its own source code without messing up the
layout.
2023-05-16 08:22:11 +00:00
rillig
c5b428c7c1
indent: fix handling of INDENT OFF/ON comments
...
Previously, the 'INDENT OFF' comments were interpreted when the newline
token from the line above the comment was processed, which was earlier
than could be reasonably expected.
The 'INDENT ON' comments were interpreted equally early, which led to
the situation that the 'INDENT OFF' comments were preserved literally
but the 'INDENT ON' comments weren't.
2023-05-16 08:04:03 +00:00
rillig
70c3f641d2
indent: fix detection of casts
...
A word followed by a '(' does not start a cast expression.
2023-05-15 21:51:45 +00:00
rillig
62d29170f1
indent: fix type cast in function definition
2023-05-15 20:50:37 +00:00
rillig
a59ea3192b
indent: fix duplicate space between comment and binary operator
2023-05-15 20:30:20 +00:00
rillig
2aaa93dadf
indent: fix line wrapping of comments to the right of code
2023-05-15 19:55:51 +00:00
rillig
219ccf6233
indent: improve type guessing, fix formatting of declarations
2023-05-15 18:22:40 +00:00
rillig
3357d7dc84
tests/indent: test type detection
2023-05-15 17:51:49 +00:00
rillig
2e1f799d6b
indent: remove accidental space before tab
2023-05-15 17:38:56 +00:00
rillig
3842fd14e5
indent: remove backslash line continuation outside preprocessing
...
The indenter did not handle these backslashes well, interpreting them as
unary operators, and they are an edge case anyway. Line continuations
in string literals and character constants are kept.
2023-05-15 17:28:14 +00:00
rillig
c3a01c7bfa
tests/indent: demonstrate wrong spacing after function prototype
2023-05-15 15:04:48 +00:00
rillig
6c38484f82
indent: fix spacing between function prototype and attributes
2023-05-15 14:55:47 +00:00
rillig
c74302075d
indent: fix indentation of struct member names
2023-05-15 14:12:03 +00:00
rillig
415b6afa14
tests/indent: demonstrate wrong indentation of struct members
2023-05-15 13:53:32 +00:00
rillig
b33d7ae266
indent: fix indentation of statements after controlling expression
2023-05-15 13:33:19 +00:00
rillig
60722870c9
tests/indent: add another test for -eei -nlp
2023-05-15 13:28:05 +00:00
rillig
8bbe0ac207
indent: fix indentation of expressions in -nlp -eei mode
2023-05-15 12:59:43 +00:00
rillig
3801fbef33
tests/indent: test extra indentation with fixed continuation indentation
2023-05-15 12:11:07 +00:00
rillig
09166ed3ac
indent: fix indentation of multi-line '?:' expressions in functions
2023-05-15 10:13:40 +00:00
rillig
e311e1f8e6
tests/indent: -badp should not add blank lines in initializers
2023-05-15 09:05:08 +00:00