# HG changeset patch # User Anders Johnsen # Date 1210236869 -7200 # Node ID 09b4d74cb3f54840d976af27525d50f548f17f09 # Parent cd066f3b539afcb59052c247c9128f74ccf28946 Parsing char, wchar and dchar as basic types. diff -r cd066f3b539a -r 09b4d74cb3f5 lexer/Keyword.d --- a/lexer/Keyword.d Thu May 08 10:32:41 2008 +0200 +++ b/lexer/Keyword.d Thu May 08 10:54:29 2008 +0200 @@ -22,6 +22,10 @@ "long" : Tok.Long, "ulong" : Tok.Ulong, + "char" : Tok.Char, + "wchar" : Tok.Wchar, + "dchar" : Tok.Dchar, + "bool" : Tok.Bool, "float" : Tok.Float, diff -r cd066f3b539a -r 09b4d74cb3f5 lexer/Token.d --- a/lexer/Token.d Thu May 08 10:32:41 2008 +0200 +++ b/lexer/Token.d Thu May 08 10:54:29 2008 +0200 @@ -121,6 +121,8 @@ Int, Uint, Long, Ulong, + Char, Wchar, Dchar, + Float, Double, Bool, @@ -155,6 +157,9 @@ Tok.Short:"Short", Tok.Int:"Int", Tok.Long:"Long", + Tok.Char:"Char", + Tok.Wchar:"Wchar", + Tok.Dchar:"Dchar", Tok.Bool:"Bool", Tok.Void:"Void", Tok.Eq:"Eq", diff -r cd066f3b539a -r 09b4d74cb3f5 sema/DType.d --- a/sema/DType.d Thu May 08 10:32:41 2008 +0200 +++ b/sema/DType.d Thu May 08 10:54:29 2008 +0200 @@ -121,7 +121,8 @@ static DInteger Bool, Byte, UByte, Short, UShort, - Int, UInt, Long, ULong; + Int, UInt, Long, ULong, + Char, WChar, DChar; static DType Void; @@ -138,6 +139,9 @@ UInt = new DInteger("uint", 32, true); Long = new DInteger("long", 64, false); ULong = new DInteger("ulong", 64, true); + Char = new DInteger("char", 8, true); + WChar = new DInteger("wchar", 16, true); + DChar = new DInteger("dchar", 32, true); } } diff -r cd066f3b539a -r 09b4d74cb3f5 sema/ScopeBuilder.d --- a/sema/ScopeBuilder.d Thu May 08 10:32:41 2008 +0200 +++ b/sema/ScopeBuilder.d Thu May 08 10:54:29 2008 +0200 @@ -100,6 +100,9 @@ table[table.length-1].types["uint"] = DType.UInt; table[table.length-1].types["long"] = DType.Long; table[table.length-1].types["ulong"] = DType.ULong; + table[table.length-1].types["char"] = DType.Char; + table[table.length-1].types["wchar"] = DType.WChar; + table[table.length-1].types["dchar"] = DType.DChar; current().inModule = m; current().mHandle = mHandle; diff -r cd066f3b539a -r 09b4d74cb3f5 tests/parser/basic_type_char_1.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/parser/basic_type_char_1.d Thu May 08 10:54:29 2008 +0200 @@ -0,0 +1,10 @@ + + +int main() +{ + char c; + wchar w; + dchar d; + + return 0; +}