view lexer/Keyword.d @ 11:642c6a998fd9

Support for while statements and fixed scope for if
author Anders Halager <halager@gmail.com>
date Fri, 18 Apr 2008 13:45:39 +0200
parents 2c5a8f4c254a
children 6282db07115f
line wrap: on
line source

module lexer.Keyword;

import lexer.Token;

Tok[char[]] keywords;

static this ()
{
    keywords =
    [
        "byte"[]    : Tok.Byte,
        "ubyte"     : Tok.Ubyte,
        "short"     : Tok.Short,
        "ushort"    : Tok.Ushort,
        "int"       : Tok.Int,
        "uint"      : Tok.Uint,
        "long"      : Tok.Long,
        "ulong"     : Tok.Ulong,

        "float"     : Tok.Float,
        "double"    : Tok.Double,

        "if"        : Tok.If,
        "else"      : Tok.Else,
        "while"     : Tok.While,
        "return"    : Tok.Return
    ];
}