xref: /netbsd-src/tests/usr.bin/indent/lsym_preprocessing.c (revision 53b02e147d4ed531c0d2a5ca9b3e8026ba3e99b5)
1 /* $NetBSD: lsym_preprocessing.c,v 1.2 2021/11/20 16:54:17 rillig Exp $ */
2 /* $FreeBSD$ */
3 
4 /*
5  * Tests for the token lsym_preprocessing, which represents a '#' that starts
6  * a preprocessing line.
7  *
8  * The whole preprocessing line is processed separately from the main source
9  * code, without much tokenizing or parsing.
10  */
11 
12 // TODO: test '#' in the middle of a non-preprocessing line
13 // TODO: test stringify '#'
14 // TODO: test token paste '##'
15 
16 #indent input
17 // TODO: add input
18 #indent end
19 
20 #indent run-equals-input
21 
22 
23 /*
24  * Whitespace in the following preprocessing directives is preserved.
25  */
26 #indent input
27 #define space ' '		/* the 'define' is followed by a space */
28 #define	tab '\t'		/* the 'define' is followed by a tab */
29 #if   0				/* 3 spaces */
30 #elif		0		/* 2 tabs */
31 #elif	0	>	1	/* tabs between the tokens */
32 #endif
33 #indent end
34 
35 #indent run-equals-input
36 
37 // TODO: #define unfinished_string "...
38 // TODO: #define unfinished_char '...
39 // TODO: # 123 "file.h"
40 // TODO: backslash-newline
41 // TODO: block comment
42 // TODO: line comment
43