Mercurial > projects > dang
annotate lexer/Keyword.d @ 22:e331e4e816e4
now handling structs to some extend
author | johnsen@johnsen-laptop |
---|---|
date | Fri, 18 Apr 2008 23:45:45 +0200 |
parents | 6282db07115f |
children | ce17bea8e9bd |
rev | line source |
---|---|
1 | 1 module lexer.Keyword; |
2 | |
3 import lexer.Token; | |
4 | |
5 Tok[char[]] keywords; | |
6 | |
7 static this () | |
8 { | |
9 keywords = | |
10 [ | |
11 "byte"[] : Tok.Byte, | |
12 "ubyte" : Tok.Ubyte, | |
13 "short" : Tok.Short, | |
14 "ushort" : Tok.Ushort, | |
15 "int" : Tok.Int, | |
16 "uint" : Tok.Uint, | |
17 "long" : Tok.Long, | |
18 "ulong" : Tok.Ulong, | |
19 | |
12
6282db07115f
Added some ekstra tests, and allowed bool as a type
Anders Halager <halager@gmail.com>
parents:
11
diff
changeset
|
20 "bool" : Tok.Bool, |
6282db07115f
Added some ekstra tests, and allowed bool as a type
Anders Halager <halager@gmail.com>
parents:
11
diff
changeset
|
21 |
1 | 22 "float" : Tok.Float, |
23 "double" : Tok.Double, | |
24 | |
5
2c5a8f4c254a
Added very simple if support.
Anders Halager <halager@gmail.com>
parents:
1
diff
changeset
|
25 "if" : Tok.If, |
11
642c6a998fd9
Support for while statements and fixed scope for if
Anders Halager <halager@gmail.com>
parents:
5
diff
changeset
|
26 "else" : Tok.Else, |
642c6a998fd9
Support for while statements and fixed scope for if
Anders Halager <halager@gmail.com>
parents:
5
diff
changeset
|
27 "while" : Tok.While, |
22 | 28 "return" : Tok.Return, |
29 "struct" : Tok.Struct | |
1 | 30 ]; |
31 } |