# HG changeset patch # User Aziz K?ksal # Date 1199577140 -3600 # Node ID 041eae272362c349169f60c19b7cc380bb1c87b7 # Parent c4cdea3a65ba7b887836b97ab3425e4655aef947 Moved dil.Identifier to dil.lexer.Identifier. diff -r c4cdea3a65ba -r 041eae272362 trunk/src/dil/IdTable.d --- a/trunk/src/dil/IdTable.d Sun Jan 06 00:45:53 2008 +0100 +++ b/trunk/src/dil/IdTable.d Sun Jan 06 00:52:20 2008 +0100 @@ -9,7 +9,7 @@ import dil.lexer.Keywords; import common; -public import dil.Identifier; +public import dil.lexer.Identifier; public import dil.IdentsEnum; struct Ident diff -r c4cdea3a65ba -r 041eae272362 trunk/src/dil/Identifier.d --- a/trunk/src/dil/Identifier.d Sun Jan 06 00:45:53 2008 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +0,0 @@ -/++ - Author: Aziz Köksal - License: GPL3 -+/ -module dil.Identifier; - -import dil.lexer.TokensEnum; -import dil.IdentsEnum; -import common; - -align(1) -struct Identifier -{ - string str; - TOK type; - ID identID; - - static Identifier* opCall(string str, TOK type) - { - auto id = new Identifier; - id.str = str; - id.type = type; - return id; - } - - static Identifier* opCall(string str, TOK type, ID identID) - { - auto id = new Identifier; - id.str = str; - id.type = type; - id.identID = identID; - return id; - } - - uint toHash() - { - uint hash; - foreach(c; str) { - hash *= 9; - hash += c; - } - return hash; - } -} -// pragma(msg, Identifier.sizeof.stringof); diff -r c4cdea3a65ba -r 041eae272362 trunk/src/dil/ast/Expressions.d --- a/trunk/src/dil/ast/Expressions.d Sun Jan 06 00:45:53 2008 +0100 +++ b/trunk/src/dil/ast/Expressions.d Sun Jan 06 00:52:20 2008 +0100 @@ -8,7 +8,7 @@ import dil.ast.Types; import dil.ast.Declarations; import dil.ast.Statements; -import dil.Identifier; +import dil.lexer.Identifier; import dil.semantic.Scope; import dil.semantic.Types; import common; diff -r c4cdea3a65ba -r 041eae272362 trunk/src/dil/ast/Types.d --- a/trunk/src/dil/ast/Types.d Sun Jan 06 00:45:53 2008 +0100 +++ b/trunk/src/dil/ast/Types.d Sun Jan 06 00:52:20 2008 +0100 @@ -6,8 +6,8 @@ import dil.ast.Node; import dil.ast.Expressions; +import dil.lexer.Identifier; import dil.Enums; -import dil.Identifier; import dil.semantic.Scope; import dil.semantic.Types; diff -r c4cdea3a65ba -r 041eae272362 trunk/src/dil/lexer/Identifier.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/trunk/src/dil/lexer/Identifier.d Sun Jan 06 00:52:20 2008 +0100 @@ -0,0 +1,45 @@ +/++ + Author: Aziz Köksal + License: GPL3 ++/ +module dil.lexer.Identifier; + +import dil.lexer.TokensEnum; +import dil.IdentsEnum; +import common; + +align(1) +struct Identifier +{ + string str; + TOK type; + ID identID; + + static Identifier* opCall(string str, TOK type) + { + auto id = new Identifier; + id.str = str; + id.type = type; + return id; + } + + static Identifier* opCall(string str, TOK type, ID identID) + { + auto id = new Identifier; + id.str = str; + id.type = type; + id.identID = identID; + return id; + } + + uint toHash() + { + uint hash; + foreach(c; str) { + hash *= 9; + hash += c; + } + return hash; + } +} +// pragma(msg, Identifier.sizeof.stringof); diff -r c4cdea3a65ba -r 041eae272362 trunk/src/dil/lexer/Keywords.d --- a/trunk/src/dil/lexer/Keywords.d Sun Jan 06 00:45:53 2008 +0100 +++ b/trunk/src/dil/lexer/Keywords.d Sun Jan 06 00:52:20 2008 +0100 @@ -5,7 +5,7 @@ module dil.lexer.Keywords; import dil.lexer.Token; -import dil.Identifier; +import dil.lexer.Identifier; /// Table of reserved identifiers. static const Identifier[] keywords = [ diff -r c4cdea3a65ba -r 041eae272362 trunk/src/dil/lexer/Lexer.d --- a/trunk/src/dil/lexer/Lexer.d Sun Jan 06 00:45:53 2008 +0100 +++ b/trunk/src/dil/lexer/Lexer.d Sun Jan 06 00:52:20 2008 +0100 @@ -6,7 +6,7 @@ import dil.lexer.Token; import dil.lexer.Keywords; -import dil.Identifier; +import dil.lexer.Identifier; import dil.Information; import dil.Messages; import dil.HtmlEntities; diff -r c4cdea3a65ba -r 041eae272362 trunk/src/dil/lexer/Token.d --- a/trunk/src/dil/lexer/Token.d Sun Jan 06 00:45:53 2008 +0100 +++ b/trunk/src/dil/lexer/Token.d Sun Jan 06 00:52:20 2008 +0100 @@ -4,9 +4,9 @@ +/ module dil.lexer.Token; +import dil.lexer.Identifier; +import dil.lexer.Funcs; import dil.Location; -import dil.Identifier; -import dil.lexer.Funcs; import tango.stdc.stdlib : malloc, free; import tango.core.Exception; import common; diff -r c4cdea3a65ba -r 041eae272362 trunk/src/dil/semantic/SymbolTable.d --- a/trunk/src/dil/semantic/SymbolTable.d Sun Jan 06 00:45:53 2008 +0100 +++ b/trunk/src/dil/semantic/SymbolTable.d Sun Jan 06 00:52:20 2008 +0100 @@ -5,7 +5,7 @@ module dil.semantic.SymbolTable; import dil.semantic.Symbol; -import dil.Identifier; +import dil.lexer.Identifier; import common; /++ diff -r c4cdea3a65ba -r 041eae272362 trunk/src/dil/semantic/Symbols.d --- a/trunk/src/dil/semantic/Symbols.d Sun Jan 06 00:45:53 2008 +0100 +++ b/trunk/src/dil/semantic/Symbols.d Sun Jan 06 00:52:20 2008 +0100 @@ -6,10 +6,10 @@ import dil.semantic.Symbol; import dil.semantic.SymbolTable; +import dil.semantic.Types; import dil.ast.Node; +import dil.lexer.Identifier; import dil.Enums; -import dil.semantic.Types; -import dil.Identifier; import common; /// A symbol that has its own scope with a symbol table. diff -r c4cdea3a65ba -r 041eae272362 trunk/src/dil/semantic/Types.d --- a/trunk/src/dil/semantic/Types.d Sun Jan 06 00:45:53 2008 +0100 +++ b/trunk/src/dil/semantic/Types.d Sun Jan 06 00:52:20 2008 +0100 @@ -6,8 +6,8 @@ import dil.semantic.Symbol; import dil.semantic.TypesEnum; +import dil.lexer.Identifier; import dil.CompilerInfo; -import dil.Identifier; abstract class Type : Symbol {