Mercurial > projects > dil
comparison trunk/src/main.d @ 213:b0ebde88d2d4
- Added members trying, errorCount and prev (for debugging) to Parser.
- Fix: try_ didn't save token member.
- Added method parseDeclarationDefinitionsBlock() and replaced some code with calls to this method.
- Fixed case T.Colon in parseDeclarationsBlock().
- Fixed parseNonVoidInitializer().
- Fixed parseFunctionBody().
- Fixes to parseStatement(): going to T.Dot in case T.Identifier; added case T.LBrace.
- Fixed parseReturnStatement().
author | aziz |
---|---|
date | Tue, 24 Jul 2007 20:01:02 +0000 |
parents | 004d98df65af |
children | 32d354584b28 |
comparison
equal
deleted
inserted
replaced
212:c9b9c979a620 | 213:b0ebde88d2d4 |
---|---|
25 } | 25 } |
26 | 26 |
27 void main(char[][] args) | 27 void main(char[][] args) |
28 { | 28 { |
29 auto srctext = cast(char[]) std.file.read(args[1]); | 29 auto srctext = cast(char[]) std.file.read(args[1]); |
30 auto parser = new Parser(srctext, args[1]); | |
31 parser.start(); | |
32 auto decls = parser.parseModule(); | |
33 foreach (error; parser.errors) | |
34 { | |
35 writefln(`%s(%d)P: %s`, parser.lx.fileName, error.loc, error.getMsg); | |
36 } | |
37 std.c.stdlib.exit(0); | |
38 | |
30 auto lx = new Lexer(srctext, args[1]); | 39 auto lx = new Lexer(srctext, args[1]); |
31 | 40 |
32 auto tokens = lx.getTokens(); | 41 auto tokens = lx.getTokens(); |
33 char* end = lx.text.ptr; | 42 char* end = lx.text.ptr; |
34 | 43 |