File: syntax.nice

package info (click to toggle)
nice 0.9.12-2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 7,220 kB
  • ctags: 6,894
  • sloc: java: 42,767; xml: 3,508; lisp: 1,079; sh: 736; makefile: 673; cpp: 21; awk: 3
file content (39 lines) | stat: -rw-r--r-- 705 bytes parent folder | download | duplicates (4)
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
package regtest.basic;

// Some bizare syntactic constructs that should be accepted

void syntaxTest()
{
  // While with empty body
  while(1 == 2)
    {}

  // For with empty body
  for (;1 == 2;)
    {}

  // If with empty body
  if (true)
    {}

  // Anonymous functions with empty body
  ()->void f = ()=> {};
  f = ()=> { {} };

  // [] is the empty array
  if ([] == null)
    throw new Error();
}

// check that classes in current package have higher priority for lookup

// hide java.lang.Character
class Character { int dummy; }
int get(Character other) = other.dummy;




// We put a comment on the last line, without a trailing newline.
// Local Variables: ***
// require-final-newline:nil ***