PageRenderTime 19ms CodeModel.GetById 11ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/parsing/d/staticunit.d

http://github.com/wilkie/djehuty
D | 50 lines | 27 code | 9 blank | 14 comment | 1 complexity | be0405d4798bc473e4fa29d0da073c90 MD5 | raw file
 1/*
 2 * staticunit.d
 3 *
 4 */
 5
 6module parsing.d.staticunit;
 7
 8import parsing.parseunit;
 9import parsing.token;
10
11import parsing.d.tokens;
12import parsing.d.nodes;
13
14import parsing.d.staticifunit;
15import parsing.d.staticassertunit;
16
17import djehuty;
18
19class StaticUnit : ParseUnit {
20	override bool tokenFound(Token current) {
21		switch (current.type) {
22			case DToken.If:
23				// Static If (Compile-time condition)
24				// static if ...
25				auto tree = expand!(StaticIfUnit)();
26				break;
27			case DToken.Assert:
28				// Static Assert (Compile-time assert)
29
30				// static assert ...
31				auto tree = expand!(StaticAssertUnit)();
32				break;
33			case DToken.This:
34				// Static Constructor
35
36				// static this ...
37				break;
38			case DToken.Cat:
39				// Static Destructor
40
41				// static ~ this ...
42				break;
43			default:
44				// Attribute Specifier
45				// static Type
46				break;
47		}
48		return true;
49	}
50}