Up to [cvs.NetBSD.org] / src / tests / usr.bin / indent
Request diff between arbitrary revisions
Default branch: MAIN
Revision 1.60 / (download) - annotate - [select for diffs], Sun Jun 25 19:19:42 2023 UTC (9 months, 3 weeks ago) by rillig
Branch: MAIN
CVS Tags: HEAD
Changes since 1.59: +8 -9
lines
Diff to previous 1.59 (colored) to selected 1.3 (colored)
indent: fix formatting of parenthesized name in function definition
Revision 1.59 / (download) - annotate - [select for diffs], Fri Jun 16 23:51:32 2023 UTC (10 months ago) by rillig
Branch: MAIN
Changes since 1.58: +1 -5
lines
Diff to previous 1.58 (colored) to selected 1.3 (colored)
indent: merge lexer symbols for type in/outside parentheses
Revision 1.58 / (download) - annotate - [select for diffs], Fri Jun 16 12:30:45 2023 UTC (10 months ago) by rillig
Branch: MAIN
Changes since 1.57: +4 -6
lines
Diff to previous 1.57 (colored) to selected 1.3 (colored)
indent: fix indentation and linebreaks in typedef declarations
Revision 1.57 / (download) - annotate - [select for diffs], Thu Jun 15 09:19:07 2023 UTC (10 months ago) by rillig
Branch: MAIN
Changes since 1.56: +18 -1
lines
Diff to previous 1.56 (colored) to selected 1.3 (colored)
indent: miscellaneous cleanups, more tests for edge cases
Revision 1.56 / (download) - annotate - [select for diffs], Thu Jun 15 08:40:20 2023 UTC (10 months ago) by rillig
Branch: MAIN
Changes since 1.55: +15 -18
lines
Diff to previous 1.55 (colored) to selected 1.3 (colored)
indent: fix alignment of multi-line declarations
Revision 1.55 / (download) - annotate - [select for diffs], Wed Jun 14 20:46:08 2023 UTC (10 months ago) by rillig
Branch: MAIN
Changes since 1.54: +102 -1
lines
Diff to previous 1.54 (colored) to selected 1.3 (colored)
indent: clean up the code, add a few tests
Revision 1.54 / (download) - annotate - [select for diffs], Sat Jun 10 17:56:29 2023 UTC (10 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.53: +17 -1
lines
Diff to previous 1.53 (colored) to selected 1.3 (colored)
tests/indent: add move coverage tests
Revision 1.53 / (download) - annotate - [select for diffs], Sat Jun 10 06:38:21 2023 UTC (10 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.52: +22 -1
lines
Diff to previous 1.52 (colored) to selected 1.3 (colored)
indent: rename and sort variables in parser state No functional change.
Revision 1.52 / (download) - annotate - [select for diffs], Fri Jun 9 09:49:07 2023 UTC (10 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.51: +4 -5
lines
Diff to previous 1.51 (colored) to selected 1.3 (colored)
indent: improve heuristics for function declaration vs. definition
Revision 1.51 / (download) - annotate - [select for diffs], Fri Jun 9 09:45:55 2023 UTC (10 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.50: +48 -1
lines
Diff to previous 1.50 (colored) to selected 1.3 (colored)
tests/indent: add real-life test cases from make(1) and lint(1)
Revision 1.50 / (download) - annotate - [select for diffs], Thu Jun 8 21:18:54 2023 UTC (10 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.49: +15 -5
lines
Diff to previous 1.49 (colored) to selected 1.3 (colored)
indent: remove fragile heuristic for detecting cast expressions The assumption that in an expression of the form '(a * anything)', the '*' marks a pointer type was too simple-minded. For now, fix the obvious cases and leave the others for later. If needed, they can be worked around using the '-T' option.
Revision 1.49 / (download) - annotate - [select for diffs], Mon Jun 5 15:02:54 2023 UTC (10 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.48: +19 -1
lines
Diff to previous 1.48 (colored) to selected 1.3 (colored)
tests/indent: add test for left-justifying declarations
Revision 1.48 / (download) - annotate - [select for diffs], Fri Jun 2 14:34:14 2023 UTC (10 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.47: +4 -3
lines
Diff to previous 1.47 (colored) to selected 1.3 (colored)
indent: remove newline between 'switch' and '{'
Revision 1.47 / (download) - annotate - [select for diffs], Fri Jun 2 14:21:55 2023 UTC (10 months, 2 weeks ago) by rillig
Branch: MAIN
Changes since 1.46: +2 -13
lines
Diff to previous 1.46 (colored) to selected 1.3 (colored)
indent: improve heuristics of classifying '*' as pointer or operator
Revision 1.46 / (download) - annotate - [select for diffs], Tue May 23 16:53:57 2023 UTC (10 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.45: +13 -38
lines
Diff to previous 1.45 (colored) to selected 1.3 (colored)
indent: fix indentation of struct declarations
Revision 1.45 / (download) - annotate - [select for diffs], Tue May 23 06:43:19 2023 UTC (10 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.44: +2 -3
lines
Diff to previous 1.44 (colored) to selected 1.3 (colored)
indent: fix spacing around '*' in declarations
Revision 1.44 / (download) - annotate - [select for diffs], Tue May 23 06:18:00 2023 UTC (10 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.43: +51 -1
lines
Diff to previous 1.43 (colored) to selected 1.3 (colored)
tests/indent: add code snippets found in make and lint1
Revision 1.43 / (download) - annotate - [select for diffs], Tue May 16 08:22:11 2023 UTC (11 months ago) by rillig
Branch: MAIN
Changes since 1.42: +3 -3
lines
Diff to previous 1.42 (colored) to selected 1.3 (colored)
indent: remove blank between comment and parentheses or brackets Finally, indent formats its own source code without messing up the layout.
Revision 1.42 / (download) - annotate - [select for diffs], Mon May 15 21:51:46 2023 UTC (11 months ago) by rillig
Branch: MAIN
Changes since 1.41: +42 -1
lines
Diff to previous 1.41 (colored) to selected 1.3 (colored)
indent: fix detection of casts A word followed by a '(' does not start a cast expression.
Revision 1.41 / (download) - annotate - [select for diffs], Mon May 15 20:50:37 2023 UTC (11 months ago) by rillig
Branch: MAIN
Changes since 1.40: +4 -4
lines
Diff to previous 1.40 (colored) to selected 1.3 (colored)
indent: fix type cast in function definition
Revision 1.40 / (download) - annotate - [select for diffs], Mon May 15 15:04:48 2023 UTC (11 months ago) by rillig
Branch: MAIN
Changes since 1.39: +33 -1
lines
Diff to previous 1.39 (colored) to selected 1.3 (colored)
tests/indent: demonstrate wrong spacing after function prototype
Revision 1.39 / (download) - annotate - [select for diffs], Mon May 15 14:55:47 2023 UTC (11 months ago) by rillig
Branch: MAIN
Changes since 1.38: +8 -8
lines
Diff to previous 1.38 (colored) to selected 1.3 (colored)
indent: fix spacing between function prototype and attributes
Revision 1.38 / (download) - annotate - [select for diffs], Sat May 13 06:52:48 2023 UTC (11 months ago) by rillig
Branch: MAIN
Changes since 1.37: +13 -35
lines
Diff to previous 1.37 (colored) to selected 1.3 (colored)
tests/indent: explain, clean up and add some tests
Revision 1.37 / (download) - annotate - [select for diffs], Thu May 11 09:28:53 2023 UTC (11 months, 1 week ago) by rillig
Branch: MAIN
Changes since 1.36: +9 -5
lines
Diff to previous 1.36 (colored) to selected 1.3 (colored)
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.
Revision 1.36 / (download) - annotate - [select for diffs], Sun Apr 24 10:36:37 2022 UTC (23 months, 3 weeks ago) by rillig
Branch: MAIN
CVS Tags: netbsd-10-base,
netbsd-10-0-RELEASE,
netbsd-10-0-RC6,
netbsd-10-0-RC5,
netbsd-10-0-RC4,
netbsd-10-0-RC3,
netbsd-10-0-RC2,
netbsd-10-0-RC1,
netbsd-10
Changes since 1.35: +22 -1
lines
Diff to previous 1.35 (colored) to selected 1.3 (colored)
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.
Revision 1.35 / (download) - annotate - [select for diffs], Sun Apr 24 09:04:12 2022 UTC (23 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.34: +144 -144
lines
Diff to previous 1.34 (colored) to selected 1.3 (colored)
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.
Revision 1.34 / (download) - annotate - [select for diffs], Sun Apr 24 08:52:44 2022 UTC (23 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.33: +4 -1
lines
Diff to previous 1.33 (colored) to selected 1.3 (colored)
tests/indent: normalize amount of empty lines between test cases
Revision 1.33 / (download) - annotate - [select for diffs], Fri Apr 22 21:21:20 2022 UTC (23 months, 3 weeks ago) by rillig
Branch: MAIN
Changes since 1.32: +1 -2
lines
Diff to previous 1.32 (colored) to selected 1.3 (colored)
indent: remove FreeBSD IDs Most of the IDs were empty anyway.
Revision 1.32 / (download) - annotate - [select for diffs], Sat Nov 27 20:33:39 2021 UTC (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.31: +8 -7
lines
Diff to previous 1.31 (colored) to selected 1.3 (colored)
indent: fix out of bounds memory access (since 2021-11-25)
Revision 1.31 / (download) - annotate - [select for diffs], Sat Nov 27 19:21:42 2021 UTC (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.30: +54 -1
lines
Diff to previous 1.30 (colored) to selected 1.3 (colored)
tests/indent: demonstrate strange formatting (since 2021-11-25)
Revision 1.30 / (download) - annotate - [select for diffs], Thu Nov 25 20:02:06 2021 UTC (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.29: +3 -3
lines
Diff to previous 1.29 (colored) to selected 1.3 (colored)
tests/indent: fix misleading typedef name
Revision 1.29 / (download) - annotate - [select for diffs], Thu Nov 25 18:36:30 2021 UTC (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.28: +21 -16
lines
Diff to previous 1.28 (colored) to selected 1.3 (colored)
indent: improve heuristic for spaces around '*' in declarations
Revision 1.28 / (download) - annotate - [select for diffs], Thu Nov 25 18:20:21 2021 UTC (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.27: +35 -1
lines
Diff to previous 1.27 (colored) to selected 1.3 (colored)
tests/indent: demonstrate more example for broken '*' in declarations Since indent-2021.11.25.16.41.33.
Revision 1.27 / (download) - annotate - [select for diffs], Thu Nov 25 17:10:53 2021 UTC (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.26: +20 -19
lines
Diff to previous 1.26 (colored) to selected 1.3 (colored)
indent: fix heuristic for declaration/definition to post-1990 reality
Revision 1.26 / (download) - annotate - [select for diffs], Thu Nov 25 16:41:33 2021 UTC (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.25: +44 -49
lines
Diff to previous 1.25 (colored) to selected 1.3 (colored)
indent: fix spacing for unknown type names in declarations
Revision 1.25 / (download) - annotate - [select for diffs], Thu Nov 25 16:05:07 2021 UTC (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.24: +37 -1
lines
Diff to previous 1.24 (colored) to selected 1.3 (colored)
tests/indent: test '*' in function declarations
Revision 1.24 / (download) - annotate - [select for diffs], Thu Nov 25 08:03:08 2021 UTC (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.23: +15 -35
lines
Diff to previous 1.23 (colored) to selected 1.3 (colored)
indent: fix formatting of a few declarations involving unknown types
Revision 1.23 / (download) - annotate - [select for diffs], Wed Nov 24 21:34:34 2021 UTC (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.22: +207 -1
lines
Diff to previous 1.22 (colored) to selected 1.3 (colored)
tests/indent: demonstrate several real-life formatting bugs Collected by indenting usr.bin/make with the default profile. The heuristic for distinguishing between type names and other identifiers is way too primitive, it seems to have stopped evolving somewhere before function prototypes were standardized in C90, at least it handles function prototypes poorly. indent-2014.09.04.04.06.07 added seemingly random spaces to declarations, which were fixed in indent-2019.04.04.15.27.35, which came 5 years later. The latter commit introduced many new bugs, but it also fixed this one. The wrongly indented struct member declaration for HashTable has been there since at least indent-2000.10.11.14.46.04. The wrongly indented initializer expression was added in indent-2019.04.04.15.27.35 (see above).
Revision 1.22 / (download) - annotate - [select for diffs], Sun Nov 21 11:02:25 2021 UTC (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.21: +41 -1
lines
Diff to previous 1.21 (colored) to selected 1.3 (colored)
tests/indent: demonstrate wrong formatting of type names in declarations
Revision 1.21 / (download) - annotate - [select for diffs], Sat Nov 20 11:13:18 2021 UTC (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.20: +2 -1
lines
Diff to previous 1.20 (colored) to selected 1.3 (colored)
tests/indent: normalize empty lines in tests
Revision 1.20 / (download) - annotate - [select for diffs], Sat Nov 20 09:59:53 2021 UTC (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.19: +3 -3
lines
Diff to previous 1.19 (colored) to selected 1.3 (colored)
indent: clean up lint annotation and tests
Revision 1.19 / (download) - annotate - [select for diffs], Fri Nov 19 22:24:29 2021 UTC (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.18: +33 -4
lines
Diff to previous 1.18 (colored) to selected 1.3 (colored)
tests/indent: refine and extend tests
Revision 1.18 / (download) - annotate - [select for diffs], Fri Nov 19 19:37:13 2021 UTC (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.17: +12 -28
lines
Diff to previous 1.17 (colored) to selected 1.3 (colored)
indent: fix formatting of function definitions (since 2019-04-04) In the definition of a function with a pointer return type, the formatting depended on the name of the function. Function names matching [A-Za-z+] were formatted correctly, those containing [$0-9_] weren't.
Revision 1.17 / (download) - annotate - [select for diffs], Fri Nov 19 18:55:10 2021 UTC (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.16: +3 -3
lines
Diff to previous 1.16 (colored) to selected 1.3 (colored)
tests/indent: update comment for the fix from the previous commit
Revision 1.16 / (download) - annotate - [select for diffs], Fri Nov 19 18:52:33 2021 UTC (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.15: +3 -3
lines
Diff to previous 1.15 (colored) to selected 1.3 (colored)
indent: fix lost function name (since 2019-04-04) When indent searched for an identifier followed by a '(', to see whether the identifier is a function name, it didn't care that the input buffer could be resized due to a long line, which had made the pointer 'tp' invalid. Fix this by stopping the search at the end of the line. A better approach would be to have an unlimited lookahead buffer for situations like these. The code that deals with character input has already been extracted to io.c, so it's possible to implement that now. While here, fix another access to undefined memory, after the loop. There is still the issue of overwriting procname[0] with a blank, which results in inconsistent formatting depending on the function name, probably another case of accessing undefined memory, although the results have been reproducible, but that may have been pure luck. The formatted code looks clearly broken, but that's still better than losing a token and destroying the whole file.
Revision 1.15 / (download) - annotate - [select for diffs], Thu Nov 18 23:06:51 2021 UTC (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.14: +37 -1
lines
Diff to previous 1.14 (colored) to selected 1.3 (colored)
tests/indent: demonstrate disappearing function name Since 2019-04-04, as usual.
Revision 1.14 / (download) - annotate - [select for diffs], Thu Nov 18 22:27:01 2021 UTC (2 years, 4 months ago) by rillig
Branch: MAIN
Changes since 1.13: +31 -1
lines
Diff to previous 1.13 (colored) to selected 1.3 (colored)
tests/indent: demonstrate another bug imported from FreeBSD Side note: the newly added test crashes at least the following versions of indent with a segmentation fault on x86_64: 2000.10.11.14.46.04 2000.10.14.18.07.10 2000.10.17.02.16.44 2000.10.19.14.48.53 2000.10.19.16.31.26 2001.03.16.06.23.20 2001.03.23.20.12.41 2001.06.16.21.47.42 2001.07.20.13.43.50 2001.08.20.12.00.55 2001.12.01.19.27.33 2002.05.26.22.53.38 2003.02.25.10.35.44
Revision 1.13 / (download) - annotate - [select for diffs], Sun Nov 7 07:45:00 2021 UTC (2 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.12: +10 -10
lines
Diff to previous 1.12 (colored) to selected 1.3 (colored)
indent: rename type_at_paren_level_0 to type_outside_parentheses For symmetry with type_in_parentheses. No functional change.
Revision 1.12 / (download) - annotate - [select for diffs], Sun Oct 31 19:20:53 2021 UTC (2 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.11: +2 -2
lines
Diff to previous 1.11 (colored) to selected 1.3 (colored)
indent: rename lsym_type to better reflect reality Type names that occur in parentheses are parsed as lsym_ident having the subtype kw_type instead. No functional change.
Revision 1.11 / (download) - annotate - [select for diffs], Sun Oct 31 19:13:41 2021 UTC (2 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.10: +3 -3
lines
Diff to previous 1.10 (colored) to selected 1.3 (colored)
indent: remove support for pre-1978 variable initialization
Revision 1.10 / (download) - annotate - [select for diffs], Sun Oct 31 19:08:39 2021 UTC (2 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.9: +21 -1
lines
Diff to previous 1.9 (colored) to selected 1.3 (colored)
tests/indent: test support for ancient initialization without '='
Revision 1.9 / (download) - annotate - [select for diffs], Sun Oct 31 17:22:48 2021 UTC (2 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.8: +6 -6
lines
Diff to previous 1.8 (colored) to selected 1.3 (colored)
indent: in debug log, print token subtype in same line The keyword 'void' is parsed as lsym_type in some cases and lsym_ident in others. Its corresponding keyword is always kw_type though. Put the subtype into the same line as the other token information.
Revision 1.8 / (download) - annotate - [select for diffs], Sun Oct 31 10:56:19 2021 UTC (2 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.7: +35 -1
lines
Diff to previous 1.7 (colored) to selected 1.3 (colored)
tests/indent: document that 'void' is not always parsed as a type
Revision 1.7 / (download) - annotate - [select for diffs], Sat Oct 30 11:41:49 2021 UTC (2 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.6: +7 -2
lines
Diff to previous 1.6 (colored) to selected 1.3 (colored)
tests/indent: document why declaration lines are broken unnecessarily
Revision 1.6 / (download) - annotate - [select for diffs], Wed Oct 27 00:04:51 2021 UTC (2 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.5: +10 -9
lines
Diff to previous 1.5 (colored) to selected 1.3 (colored)
indent: fix indentation of local variable declarations This had been broken since the import of FreeBSD indent in 2019.
Revision 1.5 / (download) - annotate - [select for diffs], Tue Oct 26 23:58:40 2021 UTC (2 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.4: +16 -1
lines
Diff to previous 1.4 (colored) to selected 1.3 (colored)
tests/indent: demonstrate another example of wrong formatting
Revision 1.4 / (download) - annotate - [select for diffs], Tue Oct 26 23:37:40 2021 UTC (2 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.3: +22 -1
lines
Diff to previous 1.3 (colored)
tests/indent: demonstrate wrong indentation of local declarations Reported by RVP via private mail. Importing FreeBSD indent in 2019 fixed the trailing space in line 1, at the cost of lots of other bugs. indent-2000.10.11.14.46.04 | int <-- trailing space | main(void) | { | char (*f1) () = NULL; | char *(*f1) () = NULL; | char *(*f2) (); | } indent-2019.02.03.03.19.29 indent-2019.04.04.15.27.35 | int | main(void) | { | char (*f1) () = NULL; | char *(* f1) () = NULL; | char *(* f2) (); | } indent-2021.09.30.21.38.43 indent-2021.09.30.21.48.12 | int | main(void) | { | char (*f1)() = NULL; | char *(* f1)() = NULL; | char *(* f2)(); | }
Revision 1.3 / (download) - annotate - [selected], Sat Oct 23 20:07:03 2021 UTC (2 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.2: +2 -1
lines
Diff to previous 1.2 (colored)
tests/indent: remove redundant test list_head The test cases are already in fmt_decl.c, in old_style_definition and LIST_HEAD.
Revision 1.2 / (download) - annotate - [select for diffs], Sat Oct 23 20:01:14 2021 UTC (2 years, 5 months ago) by rillig
Branch: MAIN
Changes since 1.1: +114 -20
lines
Diff to previous 1.1 (colored) to selected 1.3 (colored)
tests/indent: migrate f_decls to using t_options, add more tests
Revision 1.1 / (download) - annotate - [select for diffs], Fri Oct 22 19:27:53 2021 UTC (2 years, 5 months ago) by rillig
Branch: MAIN
Diff to selected 1.3 (colored)
tests/indent: migrate a few more tests to t_options