blob: f20d4e700d29540c6df00ad33eb1e2fcea148d68 (
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
63
64
|
/* $NetBSD: lsym_funcname.c,v 1.7 2023/06/17 22:09:24 rillig Exp $ */
/*
* Tests for the token lsym_funcname, which is the name of a function, but only
* in a function definition, not in a declaration or a call expression.
*
* See also:
* lsym_word.c
*/
//indent input
void
function(void)
{
func();
(func)();
func(1, 2, 3);
}
//indent end
//indent run-equals-input
/*
* The comment after the return type of a function definition is a code
* comment, not a declaration comment.
*/
//indent input
void // comment
function_with_comment(void)
{
}
//indent end
//indent run-equals-input
/*
* The heuristics for telling a function definition and a function declaration
* apart look at the remaining characters in a line but don't tokenize them.
* Due to that, a ');' in a comment influences the heuristics.
*/
//indent input
// $ This ');' in the comment does not mark the end of the declaration.
void heuristics_semicolon_comment(/* ); */) {}
void heuristics_semicolon_no_comm(/* -- */) {}
void heuristics_comma_comment(/* ), */) {}
void heuristics_comma_no_comm(/* -- */) {}
//indent end
//indent run -di0
void heuristics_semicolon_comment(/* ); */) {
}
void
heuristics_semicolon_no_comm(/* -- */)
{
}
void heuristics_comma_comment(/* ), */) {
}
void
heuristics_comma_no_comm(/* -- */)
{
}
//indent end
|