Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/tests/usr.bin/indent tests/indent: test type detection
details: https://anonhg.NetBSD.org/src/rev/b1f08c0a6499
branches: trunk
changeset: 375363:b1f08c0a6499
user: rillig <rillig%NetBSD.org@localhost>
date: Mon May 15 17:51:49 2023 +0000
description:
tests/indent: test type detection
diffstat:
tests/usr.bin/indent/lsym_type_outside_parentheses.c | 22 +++++++++++++++++--
1 files changed, 19 insertions(+), 3 deletions(-)
diffs (36 lines):
diff -r 441a205ea76e -r b1f08c0a6499 tests/usr.bin/indent/lsym_type_outside_parentheses.c
--- a/tests/usr.bin/indent/lsym_type_outside_parentheses.c Mon May 15 17:38:56 2023 +0000
+++ b/tests/usr.bin/indent/lsym_type_outside_parentheses.c Mon May 15 17:51:49 2023 +0000
@@ -1,13 +1,29 @@
-/* $NetBSD: lsym_type_outside_parentheses.c,v 1.3 2022/04/24 09:04:12 rillig Exp $ */
+/* $NetBSD: lsym_type_outside_parentheses.c,v 1.4 2023/05/15 17:51:49 rillig Exp $ */
/*
* Tests for the token lsym_type_outside_parentheses, which represents a type
* name outside parentheses, such as in a declaration that is not for a
* function.
+ *
+ * See also:
+ * lex_ident
+ * lsym_type_in_parentheses
+ * lsym_word
+ * opt_ta
+ * opt_T
*/
+/*
+ * Indent has to guess which identifiers are types and which are variables.
+ */
//indent input
-// TODO: add input
+t1 *no_init_ptr;
+t2 *init_ptr = 0;
+/* $ FIXME: Assume that an identifier after 'const' is a type name. */
+const t3 * const_no_init_ptr;
+static t4 *static_no_init_ptr;
+/* $ FIXME: Assume that an identifier after 'typedef' is a type name. */
+typedef t5 * typedef_no_init_ptr;
//indent end
-//indent run-equals-input
+//indent run-equals-input -di24
Home |
Main Index |
Thread Index |
Old Index