Mercurial > projects > dang
view lexer/Keyword.d @ 68:381975d76baf new_gen
A LOT of bug fixing - also implemented implicit casts. If you do a --ast-dump-code on a target with some algebra of differant types, you should now see the type casts being made. Also, Tests are again back with only switches failing...
author | Anders Johnsen <skabet@gmail.com> |
---|---|
date | Thu, 01 May 2008 19:25:49 +0200 |
parents | 4e879f82dd64 |
children | 48bb2287c035 |
line wrap: on
line source
module lexer.Keyword; import lexer.Token; /** A list of keywords in an associative array that link a string representation of the keyword to a Tok */ Tok[char[]] keywords; static this () { keywords = [ // types "byte"[] : Tok.Byte, "ubyte" : Tok.Ubyte, "short" : Tok.Short, "ushort" : Tok.Ushort, "int" : Tok.Int, "uint" : Tok.Uint, "long" : Tok.Long, "ulong" : Tok.Ulong, "bool" : Tok.Bool, "float" : Tok.Float, "double" : Tok.Double, "void" : Tok.Void, // type related "struct" : Tok.Struct, // control flow "if" : Tok.If, "else" : Tok.Else, "while" : Tok.While, "switch" : Tok.Switch, "case" : Tok.Case, "default" : Tok.Default, "return" : Tok.Return, "cast" : Tok.Cast ]; }