Mercurial > projects > dil
changeset 491:b991f49628a8
Forgot committing Parser.d as well.
author | Aziz K?ksal <aziz.koeksal@gmail.com> |
---|---|
date | Tue, 04 Dec 2007 23:33:13 +0100 |
parents | 47be6bfe39cd |
children | 9c208925a3d4 |
files | trunk/src/dil/Parser.d |
diffstat | 1 files changed, 21 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- a/trunk/src/dil/Parser.d Tue Dec 04 23:31:20 2007 +0100 +++ b/trunk/src/dil/Parser.d Tue Dec 04 23:33:13 2007 +0100 @@ -56,7 +56,7 @@ ImportDeclaration[] imports; - this(char[] srcText, string filePath) + this(char[] srcText, string filePath, InformationManager infoMan = null) { lx = new Lexer(srcText, filePath); } @@ -837,18 +837,26 @@ decl = new PragmaDeclaration(ident, args, decls); break; - // Protection attributes - case T.Private: - case T.Package: - case T.Protected: - case T.Public: - case T.Export: - auto tok = token.type; + default: + // Protection attributes + Protection prot; + switch (token.type) + { + case T.Private: + prot = Protection.Private; break; + case T.Package: + prot = Protection.Package; break; + case T.Protected: + prot = Protection.Protected; break; + case T.Public: + prot = Protection.Public; break; + case T.Export: + prot = Protection.Export; break; + default: + assert(0); + } nT(); - decl = new AttributeDeclaration(tok, parseDeclarationsBlock()); - break; - default: - assert(0); + decl = new ProtectionDeclaration(prot, parseDeclarationsBlock()); } return decl; } @@ -4386,7 +4394,7 @@ ++errorCount; return; } - auto location = Lexer.getLocation(this.token); + auto location = this.token.getLocation(); auto msg = Format(_arguments, _argptr, GetMsg(mid)); errors ~= new Information(InfoType.Parser, mid, location, msg); }