PageRenderTime 18ms CodeModel.GetById 14ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/parsing/d/unittestunit.d

http://github.com/wilkie/djehuty
D | 49 lines | 29 code | 11 blank | 9 comment | 1 complexity | 241538260e55405840b9383ce16e205e MD5 | raw file
 1/*
 2 * expressionunit.d
 3 *
 4 * This module parses expressions.
 5 *
 6 */
 7
 8module parsing.d.unittestunit;
 9
10import parsing.parseunit;
11import parsing.token;
12
13import parsing.d.tokens;
14import parsing.d.nodes;
15
16import parsing.d.functionbodyunit;
17
18import io.console;
19
20import djehuty;
21
22class UnittestUnit : ParseUnit {
23	override bool tokenFound(Token current) {
24		switch (current.type) {
25			// Look for the beginning of a functionbody
26			case DToken.In:
27			case DToken.Out:
28			case DToken.Body:
29			case DToken.LeftCurly:
30				Console.putln("Unittest");
31				lexer.push(current);
32				auto tree = expand!(FunctionBodyUnit)();
33				
34				// Done.
35				return false;
36
37			// Errors otherwise.
38			default:
39				break;
40		}
41		return true;
42	}
43
44protected:
45	string cur_string = "";
46
47	static const string _common_error_msg = "";
48	static const string[] _common_error_usages = null;
49}