1
0

Fixed bugs in patched tolua output

This commit is contained in:
Tycho 2014-03-19 12:38:00 -07:00
parent 1635c696de
commit 6a3fe7adcc
10 changed files with 2533 additions and 2213 deletions

View File

@ -20,7 +20,11 @@ if(UNIX)
COMMAND xxd -i lua/function.lua | sed 's/unsigned char/static const unsigned char/g' >function_lua.h
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/src/bin/
DEPENDS ${PROJECT_SOURCE_DIR}/src/bin/lua/function.lua)
set_property(SOURCE src/bin/toluabind.c APPEND PROPERTY OBJECT_DEPENDS ${PROJECT_SOURCE_DIR}/src/bin/enumerate_lua.h ${PROJECT_SOURCE_DIR}/src/bin/basic_lua.h ${PROJECT_SOURCE_DIR}/src/bin/function_lua.h)
add_custom_command(OUTPUT ${PROJECT_SOURCE_DIR}/src/bin/declaration_lua.h
COMMAND xxd -i lua/declaration.lua | sed 's/unsigned char/static const unsigned char/g' >declaration_lua.h
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/src/bin/
DEPENDS ${PROJECT_SOURCE_DIR}/src/bin/lua/declaration.lua)
set_property(SOURCE src/bin/toluabind.c APPEND PROPERTY OBJECT_DEPENDS ${PROJECT_SOURCE_DIR}/src/bin/enumerate_lua.h ${PROJECT_SOURCE_DIR}/src/bin/basic_lua.h ${PROJECT_SOURCE_DIR}/src/bin/function_lua.h ${PROJECT_SOURCE_DIR}/src/bin/declaration_lua.h)
message(hello)
endif()

View File

@ -282,17 +282,18 @@ static const unsigned char lua_basic_lua[] = {
0x65, 0x5b, 0x74, 0x79, 0x70, 0x65, 0x5d, 0x20, 0x3d, 0x20, 0x74, 0x79,
0x70, 0x65, 0x0a, 0x09, 0x09, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20,
0x74, 0x79, 0x70, 0x65, 0x0a, 0x09, 0x65, 0x6e, 0x64, 0x0a, 0x65, 0x6e,
0x64, 0x0a, 0x0a, 0x2d, 0x2d, 0x20, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x20,
0x69, 0x66, 0x20, 0x62, 0x61, 0x73, 0x69, 0x63, 0x20, 0x74, 0x79, 0x70,
0x65, 0x0a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69,
0x73, 0x62, 0x61, 0x73, 0x69, 0x63, 0x20, 0x28, 0x74, 0x79, 0x70, 0x65,
0x29, 0x0a, 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x74, 0x20, 0x3d,
0x20, 0x67, 0x73, 0x75, 0x62, 0x28, 0x74, 0x79, 0x70, 0x65, 0x2c, 0x27,
0x63, 0x6f, 0x6e, 0x73, 0x74, 0x20, 0x27, 0x2c, 0x27, 0x27, 0x29, 0x0a,
0x20, 0x69, 0x66, 0x20, 0x5f, 0x65, 0x6e, 0x75, 0x6d, 0x5f, 0x69, 0x73,
0x5f, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x5b, 0x74,
0x5d, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x20, 0x09, 0x72, 0x65, 0x74,
0x75, 0x72, 0x6e, 0x20, 0x6e, 0x69, 0x6c, 0x0a, 0x20, 0x65, 0x6e, 0x64,
0x64, 0x0a, 0x0a, 0x2d, 0x2d, 0x20, 0x69, 0x73, 0x20, 0x65, 0x6e, 0x75,
0x6d, 0x0a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69,
0x73, 0x65, 0x6e, 0x75, 0x6d, 0x20, 0x28, 0x74, 0x79, 0x70, 0x65, 0x29,
0x0a, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x5f, 0x65,
0x6e, 0x75, 0x6d, 0x73, 0x5b, 0x74, 0x79, 0x70, 0x65, 0x5d, 0x0a, 0x65,
0x6e, 0x64, 0x0a, 0x0a, 0x2d, 0x2d, 0x20, 0x63, 0x68, 0x65, 0x63, 0x6b,
0x20, 0x69, 0x66, 0x20, 0x62, 0x61, 0x73, 0x69, 0x63, 0x20, 0x74, 0x79,
0x70, 0x65, 0x0a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20,
0x69, 0x73, 0x62, 0x61, 0x73, 0x69, 0x63, 0x20, 0x28, 0x74, 0x79, 0x70,
0x65, 0x29, 0x0a, 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x74, 0x20,
0x3d, 0x20, 0x67, 0x73, 0x75, 0x62, 0x28, 0x74, 0x79, 0x70, 0x65, 0x2c,
0x27, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x20, 0x27, 0x2c, 0x27, 0x27, 0x29,
0x0a, 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x6d, 0x2c, 0x74, 0x20,
0x3d, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x74, 0x79, 0x70, 0x65, 0x64,
0x65, 0x66, 0x28, 0x27, 0x27, 0x2c, 0x20, 0x74, 0x29, 0x0a, 0x20, 0x6c,
@ -690,8 +691,7 @@ static const unsigned char lua_basic_lua[] = {
0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x3d, 0x20,
0x7b, 0x7d, 0x0a, 0x5f, 0x69, 0x73, 0x5f, 0x66, 0x75, 0x6e, 0x63, 0x74,
0x69, 0x6f, 0x6e, 0x73, 0x20, 0x3d, 0x20, 0x7b, 0x7d, 0x0a, 0x5f, 0x65,
0x6e, 0x75, 0x6d, 0x5f, 0x69, 0x73, 0x5f, 0x66, 0x75, 0x6e, 0x63, 0x74,
0x69, 0x6f, 0x6e, 0x73, 0x20, 0x3d, 0x20, 0x7b, 0x7d, 0x0a, 0x5f, 0x74,
0x6e, 0x75, 0x6d, 0x73, 0x20, 0x3d, 0x20, 0x7b, 0x7d, 0x0a, 0x5f, 0x74,
0x6f, 0x5f, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20,
0x3d, 0x20, 0x7b, 0x7d, 0x0a, 0x0a, 0x5f, 0x62, 0x61, 0x73, 0x65, 0x5f,
0x70, 0x75, 0x73, 0x68, 0x5f, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f,
@ -740,9 +740,11 @@ static const unsigned char lua_basic_lua[] = {
0x70, 0x65, 0x22, 0x0a, 0x65, 0x6e, 0x64, 0x0a, 0x0a, 0x66, 0x75, 0x6e,
0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x67, 0x65, 0x74, 0x5f, 0x69, 0x73,
0x5f, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x74, 0x29,
0x0a, 0x09, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x5f, 0x65, 0x6e,
0x75, 0x6d, 0x5f, 0x69, 0x73, 0x5f, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
0x6f, 0x6e, 0x73, 0x5b, 0x74, 0x5d, 0x20, 0x6f, 0x72, 0x20, 0x5f, 0x69,
0x0a, 0x09, 0x69, 0x66, 0x20, 0x5f, 0x65, 0x6e, 0x75, 0x6d, 0x73, 0x5b,
0x74, 0x5d, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x09, 0x09, 0x72, 0x65,
0x74, 0x75, 0x72, 0x6e, 0x20, 0x22, 0x74, 0x6f, 0x6c, 0x75, 0x61, 0x5f,
0x69, 0x73, 0x22, 0x20, 0x2e, 0x2e, 0x20, 0x74, 0x0a, 0x09, 0x65, 0x6e,
0x64, 0x0a, 0x09, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x5f, 0x69,
0x73, 0x5f, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x5b,
0x74, 0x5d, 0x20, 0x6f, 0x72, 0x20, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68,
0x5f, 0x62, 0x61, 0x73, 0x65, 0x28, 0x74, 0x2c, 0x20, 0x5f, 0x62, 0x61,
@ -751,4 +753,4 @@ static const unsigned char lua_basic_lua[] = {
0x75, 0x61, 0x5f, 0x69, 0x73, 0x75, 0x73, 0x65, 0x72, 0x74, 0x79, 0x70,
0x65, 0x22, 0x0a, 0x65, 0x6e, 0x64, 0x0a
};
unsigned int lua_basic_lua_len = 9007;
unsigned int lua_basic_lua_len = 9031;

File diff suppressed because it is too large Load Diff

View File

@ -103,6 +103,20 @@ static const unsigned char lua_enumerate_lua[] = {
0x0a, 0x20, 0x65, 0x6e, 0x64, 0x0a, 0x20, 0x70, 0x72, 0x69, 0x6e, 0x74,
0x28, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x2e, 0x2e, 0x22, 0x7d, 0x22, 0x2e,
0x2e, 0x63, 0x6c, 0x6f, 0x73, 0x65, 0x29, 0x0a, 0x65, 0x6e, 0x64, 0x0a,
0x0a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x65, 0x6d,
0x69, 0x74, 0x65, 0x6e, 0x75, 0x6d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x74,
0x79, 0x70, 0x65, 0x28, 0x74, 0x79, 0x70, 0x65, 0x29, 0x0a, 0x20, 0x6f,
0x75, 0x74, 0x70, 0x75, 0x74, 0x28, 0x22, 0x69, 0x6e, 0x74, 0x20, 0x74,
0x6f, 0x6c, 0x75, 0x61, 0x5f, 0x69, 0x73, 0x22, 0x20, 0x2e, 0x2e, 0x20,
0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x67, 0x73, 0x75, 0x62, 0x28,
0x74, 0x79, 0x70, 0x65, 0x2c, 0x22, 0x3a, 0x3a, 0x22, 0x2c, 0x22, 0x5f,
0x22, 0x29, 0x20, 0x2e, 0x2e, 0x20, 0x22, 0x20, 0x28, 0x6c, 0x75, 0x61,
0x5f, 0x53, 0x74, 0x61, 0x74, 0x65, 0x2a, 0x20, 0x4c, 0x2c, 0x20, 0x69,
0x6e, 0x74, 0x20, 0x6c, 0x6f, 0x2c, 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x74,
0x20, 0x63, 0x68, 0x61, 0x72, 0x20, 0x2a, 0x20, 0x74, 0x79, 0x70, 0x65,
0x2c, 0x20, 0x69, 0x6e, 0x74, 0x20, 0x64, 0x65, 0x66, 0x2c, 0x20, 0x74,
0x6f, 0x6c, 0x75, 0x61, 0x5f, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x2a, 0x20,
0x65, 0x72, 0x72, 0x29, 0x3b, 0x22, 0x29, 0x0a, 0x65, 0x6e, 0x64, 0x0a,
0x0a, 0x5f, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x5f, 0x6f, 0x75, 0x74,
0x70, 0x75, 0x74, 0x5f, 0x65, 0x6e, 0x75, 0x6d, 0x73, 0x20, 0x3d, 0x20,
0x7b, 0x7d, 0x0a, 0x0a, 0x2d, 0x2d, 0x20, 0x77, 0x72, 0x69, 0x74, 0x65,
@ -118,166 +132,166 @@ static const unsigned char lua_enumerate_lua[] = {
0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x65, 0x6e, 0x75, 0x6d, 0x73, 0x5b,
0x73, 0x65, 0x6c, 0x66, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x5d, 0x20, 0x3d,
0x20, 0x31, 0x0a, 0x09, 0x09, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x28,
0x22, 0x6c, 0x75, 0x61, 0x5f, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x20,
0x74, 0x6f, 0x6c, 0x75, 0x61, 0x5f, 0x69, 0x73, 0x22, 0x20, 0x2e, 0x2e,
0x20, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e,
0x2e, 0x20, 0x22, 0x20, 0x28, 0x6c, 0x75, 0x61, 0x5f, 0x53, 0x74, 0x61,
0x74, 0x65, 0x2a, 0x20, 0x4c, 0x2c, 0x20, 0x69, 0x6e, 0x74, 0x20, 0x6c,
0x6f, 0x2c, 0x20, 0x69, 0x6e, 0x74, 0x20, 0x64, 0x65, 0x66, 0x2c, 0x20,
0x74, 0x6f, 0x6c, 0x75, 0x61, 0x5f, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x2a,
0x20, 0x65, 0x72, 0x72, 0x29, 0x22, 0x29, 0x0a, 0x09, 0x09, 0x6f, 0x75,
0x74, 0x70, 0x75, 0x74, 0x28, 0x22, 0x7b, 0x22, 0x29, 0x0a, 0x09, 0x09,
0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x28, 0x22, 0x69, 0x66, 0x20, 0x28,
0x21, 0x74, 0x6f, 0x6c, 0x75, 0x61, 0x5f, 0x69, 0x73, 0x6e, 0x75, 0x6d,
0x62, 0x65, 0x72, 0x28, 0x4c, 0x2c, 0x6c, 0x6f, 0x2c, 0x64, 0x65, 0x66,
0x2c, 0x65, 0x72, 0x72, 0x29, 0x29, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72,
0x6e, 0x20, 0x30, 0x3b, 0x22, 0x29, 0x0a, 0x09, 0x09, 0x6f, 0x75, 0x74,
0x70, 0x75, 0x74, 0x28, 0x22, 0x6c, 0x75, 0x61, 0x5f, 0x4e, 0x75, 0x6d,
0x62, 0x65, 0x72, 0x20, 0x76, 0x61, 0x6c, 0x20, 0x3d, 0x20, 0x74, 0x6f,
0x6c, 0x75, 0x61, 0x5f, 0x74, 0x6f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72,
0x28, 0x4c, 0x2c, 0x6c, 0x6f, 0x2c, 0x64, 0x65, 0x66, 0x29, 0x3b, 0x22,
0x29, 0x0a, 0x09, 0x09, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x28, 0x22,
0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x76, 0x61, 0x6c, 0x20, 0x3e,
0x3d, 0x20, 0x22, 0x20, 0x2e, 0x2e, 0x20, 0x73, 0x65, 0x6c, 0x66, 0x2e,
0x6d, 0x69, 0x6e, 0x20, 0x2e, 0x2e, 0x20, 0x22, 0x2e, 0x30, 0x20, 0x26,
0x26, 0x20, 0x76, 0x61, 0x6c, 0x20, 0x3c, 0x3d, 0x20, 0x22, 0x20, 0x2e,
0x2e, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x6d, 0x61, 0x78, 0x20, 0x2e, 0x2e,
0x20, 0x22, 0x2e, 0x30, 0x3b, 0x22, 0x29, 0x0a, 0x09, 0x09, 0x6f, 0x75,
0x74, 0x70, 0x75, 0x74, 0x28, 0x22, 0x7d, 0x22, 0x29, 0x0a, 0x09, 0x65,
0x6e, 0x64, 0x0a, 0x65, 0x6e, 0x64, 0x0a, 0x0a, 0x2d, 0x2d, 0x20, 0x49,
0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x20, 0x63, 0x6f, 0x6e, 0x73,
0x74, 0x72, 0x75, 0x63, 0x74, 0x6f, 0x72, 0x0a, 0x66, 0x75, 0x6e, 0x63,
0x74, 0x69, 0x6f, 0x6e, 0x20, 0x5f, 0x45, 0x6e, 0x75, 0x6d, 0x65, 0x72,
0x61, 0x74, 0x65, 0x20, 0x28, 0x74, 0x2c, 0x76, 0x61, 0x72, 0x6e, 0x61,
0x6d, 0x65, 0x29, 0x0a, 0x20, 0x73, 0x65, 0x74, 0x6d, 0x65, 0x74, 0x61,
0x74, 0x61, 0x62, 0x6c, 0x65, 0x28, 0x74, 0x2c, 0x63, 0x6c, 0x61, 0x73,
0x73, 0x45, 0x6e, 0x75, 0x6d, 0x65, 0x72, 0x61, 0x74, 0x65, 0x29, 0x0a,
0x20, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x28, 0x74, 0x29, 0x0a, 0x20,
0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x75, 0x6d, 0x28, 0x74,
0x29, 0x0a, 0x09, 0x20, 0x69, 0x66, 0x20, 0x76, 0x61, 0x72, 0x6e, 0x61,
0x6d, 0x65, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x76, 0x61, 0x72, 0x6e, 0x61,
0x6d, 0x65, 0x20, 0x7e, 0x3d, 0x20, 0x22, 0x22, 0x20, 0x74, 0x68, 0x65,
0x6e, 0x0a, 0x09, 0x09, 0x69, 0x66, 0x20, 0x74, 0x2e, 0x6e, 0x61, 0x6d,
0x65, 0x20, 0x7e, 0x3d, 0x20, 0x22, 0x22, 0x20, 0x74, 0x68, 0x65, 0x6e,
0x0a, 0x09, 0x09, 0x09, 0x56, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65,
0x28, 0x74, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x2e, 0x2e, 0x22, 0x20, 0x22,
0x2e, 0x2e, 0x76, 0x61, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x29, 0x0a, 0x09,
0x09, 0x65, 0x6c, 0x73, 0x65, 0x0a, 0x09, 0x09, 0x09, 0x6c, 0x6f, 0x63,
0x61, 0x6c, 0x20, 0x6e, 0x73, 0x20, 0x3d, 0x20, 0x67, 0x65, 0x74, 0x63,
0x75, 0x72, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65,
0x28, 0x29, 0x0a, 0x09, 0x09, 0x09, 0x77, 0x61, 0x72, 0x6e, 0x69, 0x6e,
0x67, 0x28, 0x22, 0x56, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x20,
0x22, 0x2e, 0x2e, 0x6e, 0x73, 0x2e, 0x2e, 0x76, 0x61, 0x72, 0x6e, 0x61,
0x6d, 0x65, 0x2e, 0x2e, 0x22, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x79, 0x70,
0x65, 0x20, 0x3c, 0x61, 0x6e, 0x6f, 0x6e, 0x79, 0x6d, 0x6f, 0x75, 0x73,
0x20, 0x65, 0x6e, 0x75, 0x6d, 0x3e, 0x20, 0x69, 0x73, 0x20, 0x64, 0x65,
0x63, 0x6c, 0x61, 0x72, 0x65, 0x64, 0x20, 0x61, 0x73, 0x20, 0x72, 0x65,
0x61, 0x64, 0x2d, 0x6f, 0x6e, 0x6c, 0x79, 0x22, 0x29, 0x0a, 0x09, 0x09,
0x09, 0x56, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x28, 0x22, 0x74,
0x6f, 0x6c, 0x75, 0x61, 0x5f, 0x72, 0x65, 0x61, 0x64, 0x6f, 0x6e, 0x6c,
0x79, 0x20, 0x69, 0x6e, 0x74, 0x20, 0x22, 0x2e, 0x2e, 0x76, 0x61, 0x72,
0x6e, 0x61, 0x6d, 0x65, 0x29, 0x0a, 0x09, 0x09, 0x65, 0x6e, 0x64, 0x0a,
0x09, 0x65, 0x6e, 0x64, 0x0a, 0x09, 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x6c,
0x20, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x20, 0x3d, 0x20, 0x63, 0x6c,
0x61, 0x73, 0x73, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72,
0x2e, 0x63, 0x75, 0x72, 0x72, 0x0a, 0x09, 0x20, 0x69, 0x66, 0x20, 0x70,
0x61, 0x72, 0x65, 0x6e, 0x74, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x09,
0x09, 0x74, 0x2e, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x20, 0x3d, 0x20,
0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x2e, 0x63, 0x75, 0x72, 0x72, 0x5f,
0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x5f, 0x61, 0x63, 0x63, 0x65, 0x73,
0x73, 0x0a, 0x09, 0x09, 0x74, 0x2e, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c,
0x5f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x20, 0x3d, 0x20, 0x74, 0x3a,
0x63, 0x68, 0x65, 0x63, 0x6b, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63,
0x5f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x28, 0x29, 0x0a, 0x09, 0x20,
0x65, 0x6e, 0x64, 0x0a, 0x09, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20,
0x74, 0x0a, 0x65, 0x6e, 0x64, 0x0a, 0x0a, 0x2d, 0x2d, 0x20, 0x43, 0x6f,
0x6e, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x6f, 0x72, 0x0a, 0x2d, 0x2d,
0x20, 0x45, 0x78, 0x70, 0x65, 0x63, 0x74, 0x73, 0x20, 0x61, 0x20, 0x73,
0x74, 0x72, 0x69, 0x6e, 0x67, 0x20, 0x72, 0x65, 0x70, 0x72, 0x65, 0x73,
0x65, 0x6e, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x68, 0x65, 0x20, 0x65,
0x6e, 0x75, 0x6d, 0x65, 0x72, 0x61, 0x74, 0x65, 0x20, 0x62, 0x6f, 0x64,
0x79, 0x0a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x45,
0x6e, 0x75, 0x6d, 0x65, 0x72, 0x61, 0x74, 0x65, 0x20, 0x28, 0x6e, 0x2c,
0x62, 0x2c, 0x76, 0x61, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x29, 0x0a, 0x09,
0x62, 0x20, 0x3d, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x67,
0x73, 0x75, 0x62, 0x28, 0x62, 0x2c, 0x20, 0x22, 0x2c, 0x5b, 0x25, 0x73,
0x5c, 0x6e, 0x5d, 0x2a, 0x7d, 0x22, 0x2c, 0x20, 0x22, 0x5c, 0x6e, 0x7d,
0x22, 0x29, 0x20, 0x2d, 0x2d, 0x20, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x6e,
0x61, 0x74, 0x65, 0x20, 0x6c, 0x61, 0x73, 0x74, 0x20, 0x27, 0x2c, 0x27,
0x0a, 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x74, 0x20, 0x3d, 0x20,
0x73, 0x70, 0x6c, 0x69, 0x74, 0x28, 0x73, 0x74, 0x72, 0x73, 0x75, 0x62,
0x28, 0x62, 0x2c, 0x32, 0x2c, 0x2d, 0x32, 0x29, 0x2c, 0x27, 0x2c, 0x27,
0x29, 0x20, 0x2d, 0x2d, 0x20, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x6e, 0x61,
0x74, 0x65, 0x20, 0x62, 0x72, 0x61, 0x63, 0x65, 0x73, 0x0a, 0x09, 0x6c,
0x6f, 0x63, 0x61, 0x6c, 0x20, 0x69, 0x20, 0x3d, 0x20, 0x31, 0x0a, 0x09,
0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x65, 0x20, 0x3d, 0x20, 0x7b, 0x6e,
0x3d, 0x30, 0x7d, 0x0a, 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x76,
0x61, 0x6c, 0x75, 0x65, 0x20, 0x3d, 0x20, 0x30, 0x0a, 0x09, 0x6c, 0x6f,
0x63, 0x61, 0x6c, 0x20, 0x6d, 0x69, 0x6e, 0x20, 0x3d, 0x20, 0x30, 0x0a,
0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x6d, 0x61, 0x78, 0x20, 0x3d,
0x20, 0x30, 0x0a, 0x09, 0x77, 0x68, 0x69, 0x6c, 0x65, 0x20, 0x74, 0x5b,
0x69, 0x5d, 0x20, 0x64, 0x6f, 0x0a, 0x09, 0x09, 0x6c, 0x6f, 0x63, 0x61,
0x6c, 0x20, 0x74, 0x74, 0x20, 0x3d, 0x20, 0x73, 0x70, 0x6c, 0x69, 0x74,
0x28, 0x74, 0x5b, 0x69, 0x5d, 0x2c, 0x27, 0x3d, 0x27, 0x29, 0x20, 0x20,
0x2d, 0x2d, 0x20, 0x64, 0x69, 0x73, 0x63, 0x61, 0x72, 0x64, 0x20, 0x69,
0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65,
0x0a, 0x09, 0x09, 0x65, 0x2e, 0x6e, 0x20, 0x3d, 0x20, 0x65, 0x2e, 0x6e,
0x20, 0x2b, 0x20, 0x31, 0x0a, 0x09, 0x09, 0x65, 0x5b, 0x65, 0x2e, 0x6e,
0x5d, 0x20, 0x3d, 0x20, 0x74, 0x74, 0x5b, 0x31, 0x5d, 0x0a, 0x09, 0x09,
0x74, 0x74, 0x5b, 0x32, 0x5d, 0x20, 0x3d, 0x20, 0x74, 0x6f, 0x6e, 0x75,
0x6d, 0x62, 0x65, 0x72, 0x28, 0x74, 0x74, 0x5b, 0x32, 0x5d, 0x29, 0x0a,
0x09, 0x09, 0x69, 0x66, 0x20, 0x74, 0x74, 0x5b, 0x32, 0x5d, 0x20, 0x3d,
0x3d, 0x20, 0x6e, 0x69, 0x6c, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x09,
0x09, 0x09, 0x74, 0x74, 0x5b, 0x32, 0x5d, 0x20, 0x3d, 0x20, 0x76, 0x61,
0x6c, 0x75, 0x65, 0x0a, 0x09, 0x09, 0x65, 0x6e, 0x64, 0x20, 0x0a, 0x20,
0x20, 0x09, 0x09, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x20, 0x3d, 0x20, 0x74,
0x74, 0x5b, 0x32, 0x5d, 0x20, 0x2b, 0x20, 0x31, 0x20, 0x2d, 0x2d, 0x20,
0x61, 0x64, 0x76, 0x61, 0x6e, 0x63, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20,
0x73, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x65, 0x64, 0x20, 0x76, 0x61, 0x6c,
0x75, 0x65, 0x0a, 0x09, 0x09, 0x69, 0x66, 0x20, 0x74, 0x74, 0x5b, 0x32,
0x5d, 0x20, 0x3e, 0x20, 0x6d, 0x61, 0x78, 0x20, 0x74, 0x68, 0x65, 0x6e,
0x0a, 0x09, 0x09, 0x09, 0x6d, 0x61, 0x78, 0x20, 0x3d, 0x20, 0x74, 0x74,
0x5b, 0x32, 0x5d, 0x0a, 0x09, 0x09, 0x65, 0x6e, 0x64, 0x0a, 0x09, 0x09,
0x69, 0x66, 0x20, 0x74, 0x74, 0x5b, 0x32, 0x5d, 0x20, 0x3c, 0x20, 0x6d,
0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x09, 0x09, 0x09, 0x6d,
0x69, 0x6e, 0x20, 0x3d, 0x20, 0x74, 0x74, 0x5b, 0x32, 0x5d, 0x0a, 0x09,
0x09, 0x65, 0x6e, 0x64, 0x0a, 0x09, 0x09, 0x69, 0x20, 0x3d, 0x20, 0x69,
0x2b, 0x31, 0x0a, 0x09, 0x65, 0x6e, 0x64, 0x0a, 0x09, 0x2d, 0x2d, 0x20,
0x73, 0x65, 0x74, 0x20, 0x6c, 0x75, 0x61, 0x20, 0x6e, 0x61, 0x6d, 0x65,
0x73, 0x0a, 0x09, 0x69, 0x20, 0x20, 0x3d, 0x20, 0x31, 0x0a, 0x09, 0x65,
0x2e, 0x6c, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x20, 0x3d, 0x20, 0x7b, 0x7d,
0x0a, 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x6e, 0x73, 0x20, 0x3d,
0x20, 0x67, 0x65, 0x74, 0x63, 0x75, 0x72, 0x72, 0x6e, 0x61, 0x6d, 0x65,
0x73, 0x70, 0x61, 0x63, 0x65, 0x28, 0x29, 0x0a, 0x09, 0x77, 0x68, 0x69,
0x6c, 0x65, 0x20, 0x65, 0x5b, 0x69, 0x5d, 0x20, 0x64, 0x6f, 0x0a, 0x09,
0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x74, 0x20, 0x3d, 0x20, 0x73,
0x70, 0x6c, 0x69, 0x74, 0x28, 0x65, 0x5b, 0x69, 0x5d, 0x2c, 0x27, 0x40,
0x27, 0x29, 0x0a, 0x09, 0x09, 0x65, 0x5b, 0x69, 0x5d, 0x20, 0x3d, 0x20,
0x74, 0x5b, 0x31, 0x5d, 0x0a, 0x09, 0x09, 0x69, 0x66, 0x20, 0x6e, 0x6f,
0x74, 0x20, 0x74, 0x5b, 0x32, 0x5d, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a,
0x09, 0x09, 0x09, 0x74, 0x5b, 0x32, 0x5d, 0x20, 0x3d, 0x20, 0x61, 0x70,
0x70, 0x6c, 0x79, 0x72, 0x65, 0x6e, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x28,
0x74, 0x5b, 0x31, 0x5d, 0x29, 0x0a, 0x09, 0x09, 0x65, 0x6e, 0x64, 0x0a,
0x09, 0x09, 0x65, 0x2e, 0x6c, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x5b, 0x69,
0x5d, 0x20, 0x3d, 0x20, 0x74, 0x5b, 0x32, 0x5d, 0x20, 0x6f, 0x72, 0x20,
0x74, 0x5b, 0x31, 0x5d, 0x0a, 0x09, 0x09, 0x5f, 0x67, 0x6c, 0x6f, 0x62,
0x61, 0x6c, 0x5f, 0x65, 0x6e, 0x75, 0x6d, 0x73, 0x5b, 0x20, 0x6e, 0x73,
0x2e, 0x2e, 0x65, 0x5b, 0x69, 0x5d, 0x20, 0x5d, 0x20, 0x3d, 0x20, 0x28,
0x6e, 0x73, 0x2e, 0x2e, 0x65, 0x5b, 0x69, 0x5d, 0x29, 0x0a, 0x09, 0x09,
0x69, 0x20, 0x3d, 0x20, 0x69, 0x2b, 0x31, 0x0a, 0x09, 0x65, 0x6e, 0x64,
0x0a, 0x09, 0x65, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x3d, 0x20, 0x6e,
0x0a, 0x09, 0x65, 0x2e, 0x6d, 0x69, 0x6e, 0x20, 0x3d, 0x20, 0x6d, 0x69,
0x6e, 0x0a, 0x09, 0x65, 0x2e, 0x6d, 0x61, 0x78, 0x20, 0x3d, 0x20, 0x6d,
0x61, 0x78, 0x0a, 0x09, 0x69, 0x66, 0x20, 0x6e, 0x20, 0x7e, 0x3d, 0x20,
0x22, 0x22, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x09, 0x09, 0x5f, 0x65,
0x6e, 0x75, 0x6d, 0x5f, 0x69, 0x73, 0x5f, 0x66, 0x75, 0x6e, 0x63, 0x74,
0x69, 0x6f, 0x6e, 0x73, 0x5b, 0x6e, 0x5d, 0x20, 0x3d, 0x20, 0x28, 0x22,
0x74, 0x6f, 0x6c, 0x75, 0x61, 0x5f, 0x69, 0x73, 0x22, 0x20, 0x2e, 0x2e,
0x20, 0x6e, 0x29, 0x0a, 0x09, 0x09, 0x54, 0x79, 0x70, 0x65, 0x64, 0x65,
0x66, 0x28, 0x22, 0x69, 0x6e, 0x74, 0x20, 0x22, 0x2e, 0x2e, 0x6e, 0x29,
0x0a, 0x09, 0x65, 0x6e, 0x64, 0x0a, 0x09, 0x72, 0x65, 0x74, 0x75, 0x72,
0x6e, 0x20, 0x5f, 0x45, 0x6e, 0x75, 0x6d, 0x65, 0x72, 0x61, 0x74, 0x65,
0x28, 0x65, 0x2c, 0x20, 0x76, 0x61, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x29,
0x0a, 0x65, 0x6e, 0x64, 0x0a, 0x0a
0x22, 0x69, 0x6e, 0x74, 0x20, 0x74, 0x6f, 0x6c, 0x75, 0x61, 0x5f, 0x69,
0x73, 0x22, 0x20, 0x2e, 0x2e, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67,
0x2e, 0x67, 0x73, 0x75, 0x62, 0x28, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x6e,
0x61, 0x6d, 0x65, 0x2c, 0x22, 0x3a, 0x3a, 0x22, 0x2c, 0x22, 0x5f, 0x22,
0x29, 0x20, 0x2e, 0x2e, 0x20, 0x22, 0x20, 0x28, 0x6c, 0x75, 0x61, 0x5f,
0x53, 0x74, 0x61, 0x74, 0x65, 0x2a, 0x20, 0x4c, 0x2c, 0x20, 0x69, 0x6e,
0x74, 0x20, 0x6c, 0x6f, 0x2c, 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x20,
0x63, 0x68, 0x61, 0x72, 0x20, 0x2a, 0x20, 0x74, 0x79, 0x70, 0x65, 0x2c,
0x20, 0x69, 0x6e, 0x74, 0x20, 0x64, 0x65, 0x66, 0x2c, 0x20, 0x74, 0x6f,
0x6c, 0x75, 0x61, 0x5f, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x2a, 0x20, 0x65,
0x72, 0x72, 0x29, 0x22, 0x29, 0x0a, 0x09, 0x09, 0x6f, 0x75, 0x74, 0x70,
0x75, 0x74, 0x28, 0x22, 0x7b, 0x22, 0x29, 0x0a, 0x09, 0x09, 0x6f, 0x75,
0x74, 0x70, 0x75, 0x74, 0x28, 0x22, 0x69, 0x66, 0x20, 0x28, 0x21, 0x74,
0x6f, 0x6c, 0x75, 0x61, 0x5f, 0x69, 0x73, 0x6e, 0x75, 0x6d, 0x62, 0x65,
0x72, 0x28, 0x4c, 0x2c, 0x6c, 0x6f, 0x2c, 0x64, 0x65, 0x66, 0x2c, 0x65,
0x72, 0x72, 0x29, 0x29, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20,
0x30, 0x3b, 0x22, 0x29, 0x0a, 0x09, 0x09, 0x6f, 0x75, 0x74, 0x70, 0x75,
0x74, 0x28, 0x22, 0x6c, 0x75, 0x61, 0x5f, 0x4e, 0x75, 0x6d, 0x62, 0x65,
0x72, 0x20, 0x76, 0x61, 0x6c, 0x20, 0x3d, 0x20, 0x74, 0x6f, 0x6c, 0x75,
0x61, 0x5f, 0x74, 0x6f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x28, 0x4c,
0x2c, 0x6c, 0x6f, 0x2c, 0x64, 0x65, 0x66, 0x29, 0x3b, 0x22, 0x29, 0x0a,
0x09, 0x09, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x28, 0x22, 0x72, 0x65,
0x74, 0x75, 0x72, 0x6e, 0x20, 0x76, 0x61, 0x6c, 0x20, 0x3e, 0x3d, 0x20,
0x22, 0x20, 0x2e, 0x2e, 0x20, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x6d, 0x69,
0x6e, 0x20, 0x2e, 0x2e, 0x20, 0x22, 0x2e, 0x30, 0x20, 0x26, 0x26, 0x20,
0x76, 0x61, 0x6c, 0x20, 0x3c, 0x3d, 0x20, 0x22, 0x20, 0x2e, 0x2e, 0x73,
0x65, 0x6c, 0x66, 0x2e, 0x6d, 0x61, 0x78, 0x20, 0x2e, 0x2e, 0x20, 0x22,
0x2e, 0x30, 0x3b, 0x22, 0x29, 0x0a, 0x09, 0x09, 0x6f, 0x75, 0x74, 0x70,
0x75, 0x74, 0x28, 0x22, 0x7d, 0x22, 0x29, 0x0a, 0x09, 0x65, 0x6e, 0x64,
0x0a, 0x65, 0x6e, 0x64, 0x0a, 0x0a, 0x2d, 0x2d, 0x20, 0x49, 0x6e, 0x74,
0x65, 0x72, 0x6e, 0x61, 0x6c, 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x72,
0x75, 0x63, 0x74, 0x6f, 0x72, 0x0a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
0x6f, 0x6e, 0x20, 0x5f, 0x45, 0x6e, 0x75, 0x6d, 0x65, 0x72, 0x61, 0x74,
0x65, 0x20, 0x28, 0x74, 0x2c, 0x76, 0x61, 0x72, 0x6e, 0x61, 0x6d, 0x65,
0x29, 0x0a, 0x20, 0x73, 0x65, 0x74, 0x6d, 0x65, 0x74, 0x61, 0x74, 0x61,
0x62, 0x6c, 0x65, 0x28, 0x74, 0x2c, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x45,
0x6e, 0x75, 0x6d, 0x65, 0x72, 0x61, 0x74, 0x65, 0x29, 0x0a, 0x20, 0x61,
0x70, 0x70, 0x65, 0x6e, 0x64, 0x28, 0x74, 0x29, 0x0a, 0x20, 0x61, 0x70,
0x70, 0x65, 0x6e, 0x64, 0x65, 0x6e, 0x75, 0x6d, 0x28, 0x74, 0x29, 0x0a,
0x09, 0x20, 0x69, 0x66, 0x20, 0x76, 0x61, 0x72, 0x6e, 0x61, 0x6d, 0x65,
0x20, 0x61, 0x6e, 0x64, 0x20, 0x76, 0x61, 0x72, 0x6e, 0x61, 0x6d, 0x65,
0x20, 0x7e, 0x3d, 0x20, 0x22, 0x22, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a,
0x09, 0x09, 0x69, 0x66, 0x20, 0x74, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x20,
0x7e, 0x3d, 0x20, 0x22, 0x22, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x09,
0x09, 0x09, 0x56, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x28, 0x74,
0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x2e, 0x2e, 0x22, 0x20, 0x22, 0x2e, 0x2e,
0x76, 0x61, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x29, 0x0a, 0x09, 0x09, 0x65,
0x6c, 0x73, 0x65, 0x0a, 0x09, 0x09, 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c,
0x20, 0x6e, 0x73, 0x20, 0x3d, 0x20, 0x67, 0x65, 0x74, 0x63, 0x75, 0x72,
0x72, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x28, 0x29,
0x0a, 0x09, 0x09, 0x09, 0x77, 0x61, 0x72, 0x6e, 0x69, 0x6e, 0x67, 0x28,
0x22, 0x56, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x20, 0x22, 0x2e,
0x2e, 0x6e, 0x73, 0x2e, 0x2e, 0x76, 0x61, 0x72, 0x6e, 0x61, 0x6d, 0x65,
0x2e, 0x2e, 0x22, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x79, 0x70, 0x65, 0x20,
0x3c, 0x61, 0x6e, 0x6f, 0x6e, 0x79, 0x6d, 0x6f, 0x75, 0x73, 0x20, 0x65,
0x6e, 0x75, 0x6d, 0x3e, 0x20, 0x69, 0x73, 0x20, 0x64, 0x65, 0x63, 0x6c,
0x61, 0x72, 0x65, 0x64, 0x20, 0x61, 0x73, 0x20, 0x72, 0x65, 0x61, 0x64,
0x2d, 0x6f, 0x6e, 0x6c, 0x79, 0x22, 0x29, 0x0a, 0x09, 0x09, 0x09, 0x56,
0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x28, 0x22, 0x74, 0x6f, 0x6c,
0x75, 0x61, 0x5f, 0x72, 0x65, 0x61, 0x64, 0x6f, 0x6e, 0x6c, 0x79, 0x20,
0x69, 0x6e, 0x74, 0x20, 0x22, 0x2e, 0x2e, 0x76, 0x61, 0x72, 0x6e, 0x61,
0x6d, 0x65, 0x29, 0x0a, 0x09, 0x09, 0x65, 0x6e, 0x64, 0x0a, 0x09, 0x65,
0x6e, 0x64, 0x0a, 0x09, 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x70,
0x61, 0x72, 0x65, 0x6e, 0x74, 0x20, 0x3d, 0x20, 0x63, 0x6c, 0x61, 0x73,
0x73, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x2e, 0x63,
0x75, 0x72, 0x72, 0x0a, 0x09, 0x20, 0x69, 0x66, 0x20, 0x70, 0x61, 0x72,
0x65, 0x6e, 0x74, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x09, 0x09, 0x74,
0x2e, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x20, 0x3d, 0x20, 0x70, 0x61,
0x72, 0x65, 0x6e, 0x74, 0x2e, 0x63, 0x75, 0x72, 0x72, 0x5f, 0x6d, 0x65,
0x6d, 0x62, 0x65, 0x72, 0x5f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x0a,
0x09, 0x09, 0x74, 0x2e, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x5f, 0x61,
0x63, 0x63, 0x65, 0x73, 0x73, 0x20, 0x3d, 0x20, 0x74, 0x3a, 0x63, 0x68,
0x65, 0x63, 0x6b, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x61,
0x63, 0x63, 0x65, 0x73, 0x73, 0x28, 0x29, 0x0a, 0x09, 0x20, 0x65, 0x6e,
0x64, 0x0a, 0x09, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x74, 0x0a,
0x65, 0x6e, 0x64, 0x0a, 0x0a, 0x2d, 0x2d, 0x20, 0x43, 0x6f, 0x6e, 0x73,
0x74, 0x72, 0x75, 0x63, 0x74, 0x6f, 0x72, 0x0a, 0x2d, 0x2d, 0x20, 0x45,
0x78, 0x70, 0x65, 0x63, 0x74, 0x73, 0x20, 0x61, 0x20, 0x73, 0x74, 0x72,
0x69, 0x6e, 0x67, 0x20, 0x72, 0x65, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e,
0x74, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x68, 0x65, 0x20, 0x65, 0x6e, 0x75,
0x6d, 0x65, 0x72, 0x61, 0x74, 0x65, 0x20, 0x62, 0x6f, 0x64, 0x79, 0x0a,
0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x45, 0x6e, 0x75,
0x6d, 0x65, 0x72, 0x61, 0x74, 0x65, 0x20, 0x28, 0x6e, 0x2c, 0x62, 0x2c,
0x76, 0x61, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x29, 0x0a, 0x09, 0x62, 0x20,
0x3d, 0x20, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x2e, 0x67, 0x73, 0x75,
0x62, 0x28, 0x62, 0x2c, 0x20, 0x22, 0x2c, 0x5b, 0x25, 0x73, 0x5c, 0x6e,
0x5d, 0x2a, 0x7d, 0x22, 0x2c, 0x20, 0x22, 0x5c, 0x6e, 0x7d, 0x22, 0x29,
0x20, 0x2d, 0x2d, 0x20, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x6e, 0x61, 0x74,
0x65, 0x20, 0x6c, 0x61, 0x73, 0x74, 0x20, 0x27, 0x2c, 0x27, 0x0a, 0x09,
0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x74, 0x20, 0x3d, 0x20, 0x73, 0x70,
0x6c, 0x69, 0x74, 0x28, 0x73, 0x74, 0x72, 0x73, 0x75, 0x62, 0x28, 0x62,
0x2c, 0x32, 0x2c, 0x2d, 0x32, 0x29, 0x2c, 0x27, 0x2c, 0x27, 0x29, 0x20,
0x2d, 0x2d, 0x20, 0x65, 0x6c, 0x69, 0x6d, 0x69, 0x6e, 0x61, 0x74, 0x65,
0x20, 0x62, 0x72, 0x61, 0x63, 0x65, 0x73, 0x0a, 0x09, 0x6c, 0x6f, 0x63,
0x61, 0x6c, 0x20, 0x69, 0x20, 0x3d, 0x20, 0x31, 0x0a, 0x09, 0x6c, 0x6f,
0x63, 0x61, 0x6c, 0x20, 0x65, 0x20, 0x3d, 0x20, 0x7b, 0x6e, 0x3d, 0x30,
0x7d, 0x0a, 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x76, 0x61, 0x6c,
0x75, 0x65, 0x20, 0x3d, 0x20, 0x30, 0x0a, 0x09, 0x6c, 0x6f, 0x63, 0x61,
0x6c, 0x20, 0x6d, 0x69, 0x6e, 0x20, 0x3d, 0x20, 0x30, 0x0a, 0x09, 0x6c,
0x6f, 0x63, 0x61, 0x6c, 0x20, 0x6d, 0x61, 0x78, 0x20, 0x3d, 0x20, 0x30,
0x0a, 0x09, 0x77, 0x68, 0x69, 0x6c, 0x65, 0x20, 0x74, 0x5b, 0x69, 0x5d,
0x20, 0x64, 0x6f, 0x0a, 0x09, 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20,
0x74, 0x74, 0x20, 0x3d, 0x20, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x28, 0x74,
0x5b, 0x69, 0x5d, 0x2c, 0x27, 0x3d, 0x27, 0x29, 0x20, 0x20, 0x2d, 0x2d,
0x20, 0x64, 0x69, 0x73, 0x63, 0x61, 0x72, 0x64, 0x20, 0x69, 0x6e, 0x69,
0x74, 0x69, 0x61, 0x6c, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x0a, 0x09,
0x09, 0x65, 0x2e, 0x6e, 0x20, 0x3d, 0x20, 0x65, 0x2e, 0x6e, 0x20, 0x2b,
0x20, 0x31, 0x0a, 0x09, 0x09, 0x65, 0x5b, 0x65, 0x2e, 0x6e, 0x5d, 0x20,
0x3d, 0x20, 0x74, 0x74, 0x5b, 0x31, 0x5d, 0x0a, 0x09, 0x09, 0x74, 0x74,
0x5b, 0x32, 0x5d, 0x20, 0x3d, 0x20, 0x74, 0x6f, 0x6e, 0x75, 0x6d, 0x62,
0x65, 0x72, 0x28, 0x74, 0x74, 0x5b, 0x32, 0x5d, 0x29, 0x0a, 0x09, 0x09,
0x69, 0x66, 0x20, 0x74, 0x74, 0x5b, 0x32, 0x5d, 0x20, 0x3d, 0x3d, 0x20,
0x6e, 0x69, 0x6c, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x09, 0x09, 0x09,
0x74, 0x74, 0x5b, 0x32, 0x5d, 0x20, 0x3d, 0x20, 0x76, 0x61, 0x6c, 0x75,
0x65, 0x0a, 0x09, 0x09, 0x65, 0x6e, 0x64, 0x20, 0x0a, 0x20, 0x20, 0x09,
0x09, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x20, 0x3d, 0x20, 0x74, 0x74, 0x5b,
0x32, 0x5d, 0x20, 0x2b, 0x20, 0x31, 0x20, 0x2d, 0x2d, 0x20, 0x61, 0x64,
0x76, 0x61, 0x6e, 0x63, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x65,
0x6c, 0x65, 0x63, 0x74, 0x65, 0x64, 0x20, 0x76, 0x61, 0x6c, 0x75, 0x65,
0x0a, 0x09, 0x09, 0x69, 0x66, 0x20, 0x74, 0x74, 0x5b, 0x32, 0x5d, 0x20,
0x3e, 0x20, 0x6d, 0x61, 0x78, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x09,
0x09, 0x09, 0x6d, 0x61, 0x78, 0x20, 0x3d, 0x20, 0x74, 0x74, 0x5b, 0x32,
0x5d, 0x0a, 0x09, 0x09, 0x65, 0x6e, 0x64, 0x0a, 0x09, 0x09, 0x69, 0x66,
0x20, 0x74, 0x74, 0x5b, 0x32, 0x5d, 0x20, 0x3c, 0x20, 0x6d, 0x69, 0x6e,
0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x09, 0x09, 0x09, 0x6d, 0x69, 0x6e,
0x20, 0x3d, 0x20, 0x74, 0x74, 0x5b, 0x32, 0x5d, 0x0a, 0x09, 0x09, 0x65,
0x6e, 0x64, 0x0a, 0x09, 0x09, 0x69, 0x20, 0x3d, 0x20, 0x69, 0x2b, 0x31,
0x0a, 0x09, 0x65, 0x6e, 0x64, 0x0a, 0x09, 0x2d, 0x2d, 0x20, 0x73, 0x65,
0x74, 0x20, 0x6c, 0x75, 0x61, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x0a,
0x09, 0x69, 0x20, 0x20, 0x3d, 0x20, 0x31, 0x0a, 0x09, 0x65, 0x2e, 0x6c,
0x6e, 0x61, 0x6d, 0x65, 0x73, 0x20, 0x3d, 0x20, 0x7b, 0x7d, 0x0a, 0x09,
0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x6e, 0x73, 0x20, 0x3d, 0x20, 0x67,
0x65, 0x74, 0x63, 0x75, 0x72, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70,
0x61, 0x63, 0x65, 0x28, 0x29, 0x0a, 0x09, 0x77, 0x68, 0x69, 0x6c, 0x65,
0x20, 0x65, 0x5b, 0x69, 0x5d, 0x20, 0x64, 0x6f, 0x0a, 0x09, 0x09, 0x6c,
0x6f, 0x63, 0x61, 0x6c, 0x20, 0x74, 0x20, 0x3d, 0x20, 0x73, 0x70, 0x6c,
0x69, 0x74, 0x28, 0x65, 0x5b, 0x69, 0x5d, 0x2c, 0x27, 0x40, 0x27, 0x29,
0x0a, 0x09, 0x09, 0x65, 0x5b, 0x69, 0x5d, 0x20, 0x3d, 0x20, 0x74, 0x5b,
0x31, 0x5d, 0x0a, 0x09, 0x09, 0x69, 0x66, 0x20, 0x6e, 0x6f, 0x74, 0x20,
0x74, 0x5b, 0x32, 0x5d, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x09, 0x09,
0x09, 0x74, 0x5b, 0x32, 0x5d, 0x20, 0x3d, 0x20, 0x61, 0x70, 0x70, 0x6c,
0x79, 0x72, 0x65, 0x6e, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x28, 0x74, 0x5b,
0x31, 0x5d, 0x29, 0x0a, 0x09, 0x09, 0x65, 0x6e, 0x64, 0x0a, 0x09, 0x09,
0x65, 0x2e, 0x6c, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x5b, 0x69, 0x5d, 0x20,
0x3d, 0x20, 0x74, 0x5b, 0x32, 0x5d, 0x20, 0x6f, 0x72, 0x20, 0x74, 0x5b,
0x31, 0x5d, 0x0a, 0x09, 0x09, 0x5f, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c,
0x5f, 0x65, 0x6e, 0x75, 0x6d, 0x73, 0x5b, 0x20, 0x6e, 0x73, 0x2e, 0x2e,
0x65, 0x5b, 0x69, 0x5d, 0x20, 0x5d, 0x20, 0x3d, 0x20, 0x28, 0x6e, 0x73,
0x2e, 0x2e, 0x65, 0x5b, 0x69, 0x5d, 0x29, 0x0a, 0x09, 0x09, 0x69, 0x20,
0x3d, 0x20, 0x69, 0x2b, 0x31, 0x0a, 0x09, 0x65, 0x6e, 0x64, 0x0a, 0x09,
0x65, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x3d, 0x20, 0x6e, 0x0a, 0x09,
0x65, 0x2e, 0x6d, 0x69, 0x6e, 0x20, 0x3d, 0x20, 0x6d, 0x69, 0x6e, 0x0a,
0x09, 0x65, 0x2e, 0x6d, 0x61, 0x78, 0x20, 0x3d, 0x20, 0x6d, 0x61, 0x78,
0x0a, 0x09, 0x69, 0x66, 0x20, 0x6e, 0x20, 0x7e, 0x3d, 0x20, 0x22, 0x22,
0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x09, 0x09, 0x5f, 0x65, 0x6e, 0x75,
0x6d, 0x73, 0x5b, 0x6e, 0x5d, 0x20, 0x3d, 0x20, 0x31, 0x0a, 0x09, 0x09,
0x54, 0x79, 0x70, 0x65, 0x64, 0x65, 0x66, 0x28, 0x22, 0x69, 0x6e, 0x74,
0x20, 0x22, 0x2e, 0x2e, 0x6e, 0x29, 0x0a, 0x09, 0x65, 0x6e, 0x64, 0x0a,
0x09, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x5f, 0x45, 0x6e, 0x75,
0x6d, 0x65, 0x72, 0x61, 0x74, 0x65, 0x28, 0x65, 0x2c, 0x20, 0x76, 0x61,
0x72, 0x6e, 0x61, 0x6d, 0x65, 0x29, 0x0a, 0x65, 0x6e, 0x64, 0x0a, 0x0a
};
unsigned int lua_enumerate_lua_len = 3354;
unsigned int lua_enumerate_lua_len = 3528;

File diff suppressed because it is too large Load Diff

View File

@ -145,12 +145,14 @@ function typevar(type)
end
end
-- is enum
function isenum (type)
return _enums[type]
end
-- check if basic type
function isbasic (type)
local t = gsub(type,'const ','')
if _enum_is_functions[t] then
return nil
end
local m,t = applytypedef('', t)
local b = _basic[t]
if b then
@ -385,7 +387,7 @@ end
_push_functions = {}
_is_functions = {}
_enum_is_functions = {}
_enums = {}
_to_functions = {}
_base_push_functions = {}
@ -414,5 +416,8 @@ function get_to_function(t)
end
function get_is_function(t)
return _enum_is_functions[t] or _is_functions[t] or search_base(t, _base_is_functions) or "tolua_isusertype"
if _enums[t] then
return "tolua_is" .. t
end
return _is_functions[t] or search_base(t, _base_is_functions) or "tolua_isusertype"
end

View File

@ -229,6 +229,8 @@ function classDeclaration:outchecktype (narg)
--end
elseif t then
return '!tolua_is'..t..'(tolua_S,'..narg..','..def..',&tolua_err)'
elseif isenum(self.type) then
return '!tolua_is'..self.type..'(tolua_S,'..narg..','..def..',&tolua_err)'
else
local is_func = get_is_function(self.type)
if self.ptr == '&' or self.ptr == '' then

View File

@ -48,13 +48,17 @@ function classEnumerate:print (ident,close)
print(ident.."}"..close)
end
function emitenumprototype(type)
output("int tolua_is" .. string.gsub(type,"::","_") .. " (lua_State* L, int lo, const char * type, int def, tolua_Error* err);")
end
_global_output_enums = {}
-- write support code
function classEnumerate:supcode ()
if _global_output_enums[self.name] == nil then
_global_output_enums[self.name] = 1
output("lua_Number tolua_is" .. self.name .. " (lua_State* L, int lo, int def, tolua_Error* err)")
output("int tolua_is" .. string.gsub(self.name,"::","_") .. " (lua_State* L, int lo, const char * type, int def, tolua_Error* err)")
output("{")
output("if (!tolua_isnumber(L,lo,def,err)) return 0;")
output("lua_Number val = tolua_tonumber(L,lo,def);")
@ -130,7 +134,7 @@ function Enumerate (n,b,varname)
e.min = min
e.max = max
if n ~= "" then
_enum_is_functions[n] = ("tolua_is" .. n)
_enums[n] = 1
Typedef("int "..n)
end
return _Enumerate(e, varname)

View File

@ -54,6 +54,16 @@ function classFunction:supcode (local_constructor)
local nret = 0 -- number of returned values
local class = self:inclass()
local _,_,static = strfind(self.mod,'^%s*(static)')
-- prototypes for enum functions
if self.args[1].type ~= 'void' then
local i=1
while self.args[i] do
if isenum(self.args[i].type) then
emitenumprototype(self.args[i].type)
end
i = i+1
end
end
if class then
if self.name == 'new' and self.parent.flags.pure_virtual then

File diff suppressed because it is too large Load Diff