Module Name: src
Committed By: rillig
Date: Mon May 15 17:51:49 UTC 2023
Modified Files:
src/tests/usr.bin/indent: lsym_type_outside_parentheses.c
Log Message:
tests/indent: test type detection
To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \
src/tests/usr.bin/indent/lsym_type_outside_parentheses.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/tests/usr.bin/indent/lsym_type_outside_parentheses.c
diff -u src/tests/usr.bin/indent/lsym_type_outside_parentheses.c:1.3 src/tests/usr.bin/indent/lsym_type_outside_parentheses.c:1.4
--- src/tests/usr.bin/indent/lsym_type_outside_parentheses.c:1.3 Sun Apr 24 09:04:12 2022
+++ src/tests/usr.bin/indent/lsym_type_outside_parentheses.c Mon May 15 17:51:49 2023
@@ -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