Module Name: src
Committed By: rillig
Date: Sat Mar 13 13:04:13 UTC 2021
Modified Files:
src/tests/usr.bin/indent: token-preprocessing.0
token-preprocessing.0.stdout
Log Message:
tests/indent: add another test case for preprocessing directives
In process_preprocessing, the variable 'quote' is not used, which makes
the code suspicious of not handling the combination of string literals
and comments properly.
To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/indent/token-preprocessing.0 \
src/tests/usr.bin/indent/token-preprocessing.0.stdout
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/token-preprocessing.0
diff -u src/tests/usr.bin/indent/token-preprocessing.0:1.2 src/tests/usr.bin/indent/token-preprocessing.0:1.3
--- src/tests/usr.bin/indent/token-preprocessing.0:1.2 Fri Mar 12 22:53:18 2021
+++ src/tests/usr.bin/indent/token-preprocessing.0 Sat Mar 13 13:04:13 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: token-preprocessing.0,v 1.2 2021/03/12 22:53:18 rillig Exp $ */
+/* $NetBSD: token-preprocessing.0,v 1.3 2021/03/13 13:04:13 rillig Exp $ */
/* $FreeBSD$ */
/*-
@@ -26,3 +26,11 @@
# else /* inner else comment */
# endif /* inner endif comment */
#endif /* outer endif comment */
+
+#define multi_line_definition /* first line
+ * middle
+ * final line
+ */ actual_value
+
+#define comment_in_string_literal "/* no comment "
+int this_is_an_ordinary_line_again;
Index: src/tests/usr.bin/indent/token-preprocessing.0.stdout
diff -u src/tests/usr.bin/indent/token-preprocessing.0.stdout:1.2 src/tests/usr.bin/indent/token-preprocessing.0.stdout:1.3
--- src/tests/usr.bin/indent/token-preprocessing.0.stdout:1.2 Fri Mar 12 22:53:18 2021
+++ src/tests/usr.bin/indent/token-preprocessing.0.stdout Sat Mar 13 13:04:13 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: token-preprocessing.0.stdout,v 1.2 2021/03/12 22:53:18 rillig Exp $ */
+/* $NetBSD: token-preprocessing.0.stdout,v 1.3 2021/03/13 13:04:13 rillig Exp $ */
/* $FreeBSD$ */
/*-
@@ -27,3 +27,13 @@
#else /* inner else comment */
#endif /* inner endif comment */
#endif /* outer endif comment */
+
+#define multi_line_definition /* first line
+ * middle
+ * final line
+ */ actual_value
+
+#define comment_in_string_literal "/* no comment "
+int this_is_an_ordinary_line_again;
+
+/* $ FIXME: The above empty line is wrong. */