--- a/src/tokens.h Sat Jul 12 23:04:46 2014 +0300 +++ b/src/tokens.h Sun Jul 20 17:25:36 2014 +0300 @@ -33,99 +33,99 @@ #include "macros.h" // ======================================================= -named_enum ETokenType +named_enum Token { // Non-word tokens - TK_LeftShiftAssign, - TK_RightShiftAssign, - TK_Equals, - TK_NotEquals, - TK_AddAssign, - TK_SubAssign, - TK_MultiplyAssign, - TK_DivideAssign, - TK_ModulusAssign, - TK_LeftShift, - TK_RightShift, - TK_AtLeast, - TK_AtMost, - TK_DoubleAmperstand, - TK_DoubleBar, - TK_DoublePlus, - TK_DoubleMinus, - TK_SingleQuote, - TK_DollarSign, - TK_ParenStart, - TK_ParenEnd, - TK_BracketStart, - TK_BracketEnd, - TK_BraceStart, - TK_BraceEnd, - TK_Assign, - TK_Plus, - TK_Minus, - TK_Multiply, - TK_Divide, - TK_Modulus, - TK_Comma, - TK_Lesser, - TK_Greater, - TK_Dot, - TK_Colon, - TK_Semicolon, - TK_Hash, - TK_ExclamationMark, - TK_Amperstand, - TK_Bar, - TK_Caret, - TK_QuestionMark, - TK_Arrow, + LeftShiftAssign, + RightShiftAssign, + Equals, + NotEquals, + AddAssign, + SubAssign, + MultiplyAssign, + DivideAssign, + ModulusAssign, + LeftShift, + RightShift, + AtLeast, + AtMost, + DoubleAmperstand, + DoubleBar, + DoublePlus, + DoubleMinus, + SingleQuote, + DollarSign, + ParenStart, + ParenEnd, + BracketStart, + BracketEnd, + BraceStart, + BraceEnd, + Assign, + Plus, + Minus, + Multiply, + Divide, + Modulus, + Comma, + Lesser, + Greater, + Dot, + Colon, + Semicolon, + Hash, + ExclamationMark, + Amperstand, + Bar, + Caret, + QuestionMark, + Arrow, // -------------- // Named tokens - TK_Bool, - TK_Break, - TK_Case, - TK_Continue, - TK_Const, - TK_Constexpr, - TK_Default, - TK_Do, - TK_Else, - TK_Event, - TK_Eventdef, - TK_For, - TK_Funcdef, - TK_If, - TK_Int, - TK_Mainloop, - TK_Onenter, - TK_Onexit, - TK_State, - TK_Switch, - TK_Str, - TK_Using, - TK_Var, - TK_Void, - TK_While, - TK_True, - TK_False, + Bool, + Break, + Case, + Continue, + Const, + Constexpr, + Default, + Do, + Else, + Event, + Eventdef, + For, + Funcdef, + If, + Int, + Mainloop, + Onenter, + Onexit, + State, + Switch, + Str, + Using, + Var, + Void, + While, + True, + False, // These ones aren't implemented yet but I plan to do so, thus they are // reserved. Also serves as a to-do list of sorts for me. >:F - TK_Enum, - TK_Func, - TK_Return, + Enum, + Func, + Return, // -------------- // Generic tokens - TK_Symbol, - TK_Number, - TK_String, - TK_Any, + Symbol, + Number, + String, + Any, + + FirstNamedToken = Bool, + LastNamedToken = Token (int (Symbol) - 1) }; -static const int gFirstNamedToken = TK_Bool; -static const int gLastNamedToken = (int) TK_Symbol - 1; - #endif