Add lowercase strings to Lua enum reverse table

Step one toward compatibility with case-insensitive legacy command
syntax.
This commit is contained in:
Devin J. Pohly
2014-02-23 15:01:34 -05:00
parent 1e04f576d2
commit 5051d85288
+5
View File
@@ -135,6 +135,11 @@ static void Lua##X(lua_State* L) \
lua_pushstring( L, (#X "_")+s ); \
lua_pushnumber( L, i ); /* 0-based */ \
lua_rawset( L, -3 ); \
/* Compatibility with old, case-insensitive values */ \
s.MakeLower(); \
lua_pushstring( L, s ); \
lua_pushnumber( L, i ); /* 0-based */ \
lua_rawset( L, -3 ); \
} \
EnumTraits<X>::StringToEnum.SetFromStack( L ); \
EnumTraits<X>::StringToEnum.PushSelf( L ); \