blob: e2341cb0dab8928075d103fecf37fb4dc99a6684 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
/* $NetBSD: lex_ident.c,v 1.7 2023/06/04 19:28:54 rillig Exp $ */
/*
* Test lexing of word-like tokens, such as keywords, identifiers, numeric
* constants, character constants, string literals.
*/
/*
* Conceptually, backslash-newline is replaced with nothing, in a very early
* stage of the translation, see C11 5.1.1.2p1, item 2. Indent does not
* preserve these; in most cases, they are simply removed.
*/
//indent input
in\
t \
var\
iable;
int
no_backslash;
// $ Test long identifiers, to cover the code that expands a buffer first to
// $ more than 400 bytes and then to more than 1400 bytes.
struct long_tag_name_to_overflow_the_token_buffer_4567890\
12345678901234567890123456789012345678901234567890\
12345678901234567890123456789012345678901234567890\
12345678901234567890123456789012345678901234567890;
struct long_tag_name_to_overflow_the_token_buffer_4567890\
12345678901234567890123456789012345678901234567890\
12345678901234567890123456789012345678901234567890\
12345678901234567890123456789012345678901234567890\
12345678901234567890123456789012345678901234567890\
12345678901234567890123456789012345678901234567890\
12345678901234567890123456789012345678901234567890\
12345678901234567890123456789012345678901234567890\
12345678901234567890123456789012345678901234567890\
12345678901234567890123456789012345678901234567890\
12345678901234567890123456789012345678901234567890\
12345678901234567890123456789012345678901234567890;
//indent end
//indent run
int variable;
int
no_backslash;
struct long_tag_name_to_overflow_the_token_buffer_4567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890;
struct long_tag_name_to_overflow_the_token_buffer_45678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890;
//indent end
/* This is a syntax error; see lex_word. */
//indent input
int identifier\n;
//indent end
//indent run
int identifier \ n;
//indent end
|