summaryrefslogtreecommitdiffstats
path: root/debian/uncrustify-trinity/uncrustify-trinity-0.78.0/tests/input/vala/identifier.vala
blob: 5dee8d3b7f2f1b8d25b4389f66f350bbb86d2ec0 (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
namespace ns
{
// You can omit '@' in trivial 'type func-name' definitions.
void if() {
}
void else() {
}
void foreach() {
}

// Numeric identifiers require '@'.
int @123star() {
}

// Non-primitive return types require '@'.
Foo @while() {
}
}

public static int main()
{
	// You can omit '@' in trivial 'type var;' declarations.
	int for;
	int while = 1;
	int do;

	// Non-primitive types always require '@'.
	Foo @do;

	// Slightly more complex 'type var_list;' require '@'.
	int @if, @else, @for, @do, @while;

	// This will complain about missing '(' etc.
	// int if, else, for, do, while;

	// It is common to omit '@' when accessing methods.
	ns.if();
	ns.else();
	ns.do();
	ns.while();
	ns.foreach();

	// Numeric methods always require '@'.
	ns.@123star();

	return 0;
}