dub 0.3.0 → 0.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of dub might be problematic. Click here for more details.
- data/.gitignore +8 -0
 - data/History.txt +37 -0
 - data/LICENSE +20 -0
 - data/README.rdoc +48 -0
 - data/Rakefile +58 -0
 - data/dub.gemspec +197 -0
 - data/lib/dub/argument.rb +275 -0
 - data/lib/dub/entities_unescape.rb +16 -0
 - data/lib/dub/function.rb +163 -0
 - data/lib/dub/function_group.rb +72 -0
 - data/lib/dub/generator.rb +15 -0
 - data/lib/dub/group.rb +24 -0
 - data/lib/dub/klass.rb +232 -0
 - data/lib/dub/lua/class.cpp.erb +83 -0
 - data/lib/dub/lua/class_gen.rb +97 -0
 - data/lib/dub/lua/function.cpp.erb +18 -0
 - data/lib/dub/lua/function_gen.rb +258 -0
 - data/lib/dub/lua/group.cpp.erb +9 -0
 - data/lib/dub/lua/lua_cpp_helper.h +141 -0
 - data/lib/dub/lua/namespace.cpp.erb +40 -0
 - data/lib/dub/lua/namespace_gen.rb +88 -0
 - data/lib/dub/lua.rb +24 -0
 - data/lib/dub/member_extraction.rb +92 -0
 - data/lib/dub/namespace.rb +277 -0
 - data/lib/dub/parser.rb +46 -0
 - data/lib/dub/templates/lua_template.erb +21 -0
 - data/lib/dub/version.rb +3 -0
 - data/lib/dub.rb +23 -24
 - data/test/argument_test.rb +547 -0
 - data/test/fixtures/app/CMakeLists.txt +54 -0
 - data/test/fixtures/app/Doxyfile +1600 -0
 - data/test/fixtures/app/bindings/all_lua.cpp +299 -0
 - data/test/fixtures/app/include/matrix.h +153 -0
 - data/test/fixtures/app/make_lua_bindings.rb +13 -0
 - data/test/fixtures/app/vendor/lua/CMakeLists.txt +25 -0
 - data/test/fixtures/app/vendor/lua/COPYRIGHT +34 -0
 - data/test/fixtures/app/vendor/lua/HISTORY +183 -0
 - data/test/fixtures/app/vendor/lua/INSTALL +99 -0
 - data/test/fixtures/app/vendor/lua/Makefile +183 -0
 - data/test/fixtures/app/vendor/lua/README +37 -0
 - data/test/fixtures/app/vendor/lua/lapi.c +1080 -0
 - data/test/fixtures/app/vendor/lua/lapi.h +16 -0
 - data/test/fixtures/app/vendor/lua/lauxlib.c +653 -0
 - data/test/fixtures/app/vendor/lua/lauxlib.h +174 -0
 - data/test/fixtures/app/vendor/lua/lbaselib.c +643 -0
 - data/test/fixtures/app/vendor/lua/lcode.c +839 -0
 - data/test/fixtures/app/vendor/lua/lcode.h +76 -0
 - data/test/fixtures/app/vendor/lua/ldblib.c +397 -0
 - data/test/fixtures/app/vendor/lua/ldebug.c +622 -0
 - data/test/fixtures/app/vendor/lua/ldebug.h +33 -0
 - data/test/fixtures/app/vendor/lua/ldo.c +516 -0
 - data/test/fixtures/app/vendor/lua/ldo.h +57 -0
 - data/test/fixtures/app/vendor/lua/ldump.c +164 -0
 - data/test/fixtures/app/vendor/lua/lfunc.c +174 -0
 - data/test/fixtures/app/vendor/lua/lfunc.h +34 -0
 - data/test/fixtures/app/vendor/lua/lgc.c +711 -0
 - data/test/fixtures/app/vendor/lua/lgc.h +110 -0
 - data/test/fixtures/app/vendor/lua/liblua.a +0 -0
 - data/test/fixtures/app/vendor/lua/linit.c +38 -0
 - data/test/fixtures/app/vendor/lua/liolib.c +532 -0
 - data/test/fixtures/app/vendor/lua/llex.c +461 -0
 - data/test/fixtures/app/vendor/lua/llex.h +81 -0
 - data/test/fixtures/app/vendor/lua/llimits.h +128 -0
 - data/test/fixtures/app/vendor/lua/lmathlib.c +263 -0
 - data/test/fixtures/app/vendor/lua/lmem.c +86 -0
 - data/test/fixtures/app/vendor/lua/lmem.h +49 -0
 - data/test/fixtures/app/vendor/lua/loadlib.c +664 -0
 - data/test/fixtures/app/vendor/lua/lobject.c +214 -0
 - data/test/fixtures/app/vendor/lua/lobject.h +381 -0
 - data/test/fixtures/app/vendor/lua/lopcodes.c +102 -0
 - data/test/fixtures/app/vendor/lua/lopcodes.h +268 -0
 - data/test/fixtures/app/vendor/lua/loslib.c +244 -0
 - data/test/fixtures/app/vendor/lua/lparser.c +1337 -0
 - data/test/fixtures/app/vendor/lua/lparser.h +82 -0
 - data/test/fixtures/app/vendor/lua/lstate.c +214 -0
 - data/test/fixtures/app/vendor/lua/lstate.h +168 -0
 - data/test/fixtures/app/vendor/lua/lstring.c +111 -0
 - data/test/fixtures/app/vendor/lua/lstring.h +31 -0
 - data/test/fixtures/app/vendor/lua/lstrlib.c +868 -0
 - data/test/fixtures/app/vendor/lua/ltable.c +588 -0
 - data/test/fixtures/app/vendor/lua/ltable.h +40 -0
 - data/test/fixtures/app/vendor/lua/ltablib.c +278 -0
 - data/test/fixtures/app/vendor/lua/ltm.c +75 -0
 - data/test/fixtures/app/vendor/lua/ltm.h +54 -0
 - data/test/fixtures/app/vendor/lua/lua.c +695 -0
 - data/test/fixtures/app/vendor/lua/lua.h +385 -0
 - data/test/fixtures/app/vendor/lua/lua_dub_helper.h +77 -0
 - data/test/fixtures/app/vendor/lua/luac +0 -0
 - data/test/fixtures/app/vendor/lua/luac.c +200 -0
 - data/test/fixtures/app/vendor/lua/luaconf.h +762 -0
 - data/test/fixtures/app/vendor/lua/lualib.h +53 -0
 - data/test/fixtures/app/vendor/lua/lundump.c +223 -0
 - data/test/fixtures/app/vendor/lua/lundump.h +36 -0
 - data/test/fixtures/app/vendor/lua/lvm.c +765 -0
 - data/test/fixtures/app/vendor/lua/lvm.h +36 -0
 - data/test/fixtures/app/vendor/lua/lzio.c +82 -0
 - data/test/fixtures/app/vendor/lua/lzio.h +67 -0
 - data/test/fixtures/app/vendor/lua/matrix.h +102 -0
 - data/test/fixtures/app/vendor/lua/print.c +227 -0
 - data/test/fixtures/app/vendor/lua/test/README +26 -0
 - data/test/fixtures/app/vendor/lua/test/bisect.lua +27 -0
 - data/test/fixtures/app/vendor/lua/test/cf.lua +16 -0
 - data/test/fixtures/app/vendor/lua/test/echo.lua +5 -0
 - data/test/fixtures/app/vendor/lua/test/env.lua +7 -0
 - data/test/fixtures/app/vendor/lua/test/factorial.lua +32 -0
 - data/test/fixtures/app/vendor/lua/test/fib.lua +40 -0
 - data/test/fixtures/app/vendor/lua/test/fibfor.lua +13 -0
 - data/test/fixtures/app/vendor/lua/test/globals.lua +13 -0
 - data/test/fixtures/app/vendor/lua/test/hello.lua +3 -0
 - data/test/fixtures/app/vendor/lua/test/life.lua +111 -0
 - data/test/fixtures/app/vendor/lua/test/luac.lua +7 -0
 - data/test/fixtures/app/vendor/lua/test/printf.lua +7 -0
 - data/test/fixtures/app/vendor/lua/test/readonly.lua +12 -0
 - data/test/fixtures/app/vendor/lua/test/sieve.lua +29 -0
 - data/test/fixtures/app/vendor/lua/test/sort.lua +66 -0
 - data/test/fixtures/app/vendor/lua/test/table.lua +12 -0
 - data/test/fixtures/app/vendor/lua/test/trace-calls.lua +32 -0
 - data/test/fixtures/app/vendor/lua/test/trace-globals.lua +38 -0
 - data/test/fixtures/app/vendor/lua/test/xd.lua +14 -0
 - data/test/fixtures/app/xml/classdub_1_1_matrix.xml +313 -0
 - data/test/fixtures/app/xml/classdub_1_1_t_mat.xml +252 -0
 - data/test/fixtures/app/xml/combine.xslt +15 -0
 - data/test/fixtures/app/xml/compound.xsd +814 -0
 - data/test/fixtures/app/xml/dir_53661a2bdeb1d55e60581a7e15deb763.xml +12 -0
 - data/test/fixtures/app/xml/index.xml +47 -0
 - data/test/fixtures/app/xml/index.xsd +66 -0
 - data/test/fixtures/app/xml/matrix_8h.xml +175 -0
 - data/test/fixtures/app/xml/namespacedub.xml +41 -0
 - data/test/fixtures/classcv_1_1_mat.xml +1996 -0
 - data/test/fixtures/classcv_1_1_point__.xml +341 -0
 - data/test/fixtures/classcv_1_1_scalar__.xml +269 -0
 - data/test/fixtures/classcv_1_1_size__.xml +270 -0
 - data/test/fixtures/dummy_class.cpp.erb +1 -0
 - data/test/fixtures/dummy_function.cpp.erb +1 -0
 - data/test/fixtures/group___magic_type.xml +406 -0
 - data/test/fixtures/namespacecv.xml +12659 -0
 - data/test/function_group_test.rb +24 -0
 - data/test/function_test.rb +395 -0
 - data/test/group_test.rb +155 -0
 - data/test/helper.rb +34 -0
 - data/test/klass_test.rb +395 -0
 - data/test/lua_function_gen_test.rb +195 -0
 - data/test/namespace_test.rb +220 -0
 - data/test/parser_test.rb +36 -0
 - metadata +211 -458
 - checksums.yaml +0 -7
 - data/lib/crystalline/metadata_fields.rb +0 -163
 - data/lib/crystalline/t.rb +0 -59
 - data/lib/crystalline/utils.rb +0 -65
 - data/lib/crystalline.rb +0 -12
 - data/lib/open_api_sdk/analytics.rb +0 -154
 - data/lib/open_api_sdk/commissions.rb +0 -298
 - data/lib/open_api_sdk/customers.rb +0 -709
 - data/lib/open_api_sdk/domains.rb +0 -839
 - data/lib/open_api_sdk/dub.rb +0 -99
 - data/lib/open_api_sdk/embed_tokens.rb +0 -163
 - data/lib/open_api_sdk/events.rb +0 -154
 - data/lib/open_api_sdk/folders.rb +0 -570
 - data/lib/open_api_sdk/links.rb +0 -1377
 - data/lib/open_api_sdk/models/operations/accesslevel.rb +0 -18
 - data/lib/open_api_sdk/models/operations/bulkcreatelinks_response.rb +0 -60
 - data/lib/open_api_sdk/models/operations/bulkcreatelinks_testvariants.rb +0 -27
 - data/lib/open_api_sdk/models/operations/bulkdeletelinks_request.rb +0 -24
 - data/lib/open_api_sdk/models/operations/bulkdeletelinks_response.rb +0 -60
 - data/lib/open_api_sdk/models/operations/bulkdeletelinks_responsebody.rb +0 -24
 - data/lib/open_api_sdk/models/operations/bulkupdatelinks_requestbody.rb +0 -30
 - data/lib/open_api_sdk/models/operations/bulkupdatelinks_response.rb +0 -60
 - data/lib/open_api_sdk/models/operations/bulkupdatelinks_testvariants.rb +0 -27
 - data/lib/open_api_sdk/models/operations/checkdomainstatus_request.rb +0 -24
 - data/lib/open_api_sdk/models/operations/checkdomainstatus_response.rb +0 -60
 - data/lib/open_api_sdk/models/operations/click.rb +0 -24
 - data/lib/open_api_sdk/models/operations/color.rb +0 -23
 - data/lib/open_api_sdk/models/operations/country.rb +0 -266
 - data/lib/open_api_sdk/models/operations/createcustomer_discount.rb +0 -48
 - data/lib/open_api_sdk/models/operations/createcustomer_link.rb +0 -39
 - data/lib/open_api_sdk/models/operations/createcustomer_partner.rb +0 -33
 - data/lib/open_api_sdk/models/operations/createcustomer_requestbody.rb +0 -33
 - data/lib/open_api_sdk/models/operations/createcustomer_response.rb +0 -60
 - data/lib/open_api_sdk/models/operations/createcustomer_responsebody.rb +0 -60
 - data/lib/open_api_sdk/models/operations/createcustomer_type.rb +0 -18
 - data/lib/open_api_sdk/models/operations/createdomain_requestbody.rb +0 -45
 - data/lib/open_api_sdk/models/operations/createdomain_response.rb +0 -60
 - data/lib/open_api_sdk/models/operations/createfolder_requestbody.rb +0 -27
 - data/lib/open_api_sdk/models/operations/createfolder_response.rb +0 -60
 - data/lib/open_api_sdk/models/operations/createlink_requestbody.rb +0 -145
 - data/lib/open_api_sdk/models/operations/createlink_response.rb +0 -60
 - data/lib/open_api_sdk/models/operations/createpartner_link.rb +0 -48
 - data/lib/open_api_sdk/models/operations/createpartner_requestbody.rb +0 -45
 - data/lib/open_api_sdk/models/operations/createpartner_response.rb +0 -60
 - data/lib/open_api_sdk/models/operations/createpartner_responsebody.rb +0 -104
 - data/lib/open_api_sdk/models/operations/createpartner_status.rb +0 -23
 - data/lib/open_api_sdk/models/operations/createpartner_testvariants.rb +0 -27
 - data/lib/open_api_sdk/models/operations/createpartnerlink_linkprops.rb +0 -111
 - data/lib/open_api_sdk/models/operations/createpartnerlink_requestbody.rb +0 -39
 - data/lib/open_api_sdk/models/operations/createpartnerlink_response.rb +0 -60
 - data/lib/open_api_sdk/models/operations/createpartnerlink_testvariants.rb +0 -27
 - data/lib/open_api_sdk/models/operations/createreferralsembedtoken_country.rb +0 -266
 - data/lib/open_api_sdk/models/operations/createreferralsembedtoken_linkprops.rb +0 -111
 - data/lib/open_api_sdk/models/operations/createreferralsembedtoken_requestbody.rb +0 -30
 - data/lib/open_api_sdk/models/operations/createreferralsembedtoken_response.rb +0 -60
 - data/lib/open_api_sdk/models/operations/createreferralsembedtoken_responsebody.rb +0 -27
 - data/lib/open_api_sdk/models/operations/createreferralsembedtoken_testvariants.rb +0 -27
 - data/lib/open_api_sdk/models/operations/createtag_requestbody.rb +0 -32
 - data/lib/open_api_sdk/models/operations/createtag_response.rb +0 -60
 - data/lib/open_api_sdk/models/operations/customer.rb +0 -33
 - data/lib/open_api_sdk/models/operations/data.rb +0 -130
 - data/lib/open_api_sdk/models/operations/deletecustomer_request.rb +0 -24
 - data/lib/open_api_sdk/models/operations/deletecustomer_response.rb +0 -60
 - data/lib/open_api_sdk/models/operations/deletecustomer_responsebody.rb +0 -24
 - data/lib/open_api_sdk/models/operations/deletedomain_request.rb +0 -24
 - data/lib/open_api_sdk/models/operations/deletedomain_response.rb +0 -60
 - data/lib/open_api_sdk/models/operations/deletedomain_responsebody.rb +0 -24
 - data/lib/open_api_sdk/models/operations/deletefolder_request.rb +0 -24
 - data/lib/open_api_sdk/models/operations/deletefolder_response.rb +0 -60
 - data/lib/open_api_sdk/models/operations/deletefolder_responsebody.rb +0 -24
 - data/lib/open_api_sdk/models/operations/deletelink_request.rb +0 -24
 - data/lib/open_api_sdk/models/operations/deletelink_response.rb +0 -60
 - data/lib/open_api_sdk/models/operations/deletelink_responsebody.rb +0 -24
 - data/lib/open_api_sdk/models/operations/deletetag_request.rb +0 -24
 - data/lib/open_api_sdk/models/operations/deletetag_response.rb +0 -60
 - data/lib/open_api_sdk/models/operations/deletetag_responsebody.rb +0 -24
 - data/lib/open_api_sdk/models/operations/discount.rb +0 -48
 - data/lib/open_api_sdk/models/operations/event.rb +0 -20
 - data/lib/open_api_sdk/models/operations/getcustomer_discount.rb +0 -48
 - data/lib/open_api_sdk/models/operations/getcustomer_link.rb +0 -39
 - data/lib/open_api_sdk/models/operations/getcustomer_partner.rb +0 -33
 - data/lib/open_api_sdk/models/operations/getcustomer_request.rb +0 -27
 - data/lib/open_api_sdk/models/operations/getcustomer_response.rb +0 -60
 - data/lib/open_api_sdk/models/operations/getcustomer_responsebody.rb +0 -60
 - data/lib/open_api_sdk/models/operations/getcustomer_type.rb +0 -18
 - data/lib/open_api_sdk/models/operations/getcustomers_link.rb +0 -39
 - data/lib/open_api_sdk/models/operations/getcustomers_partner.rb +0 -33
 - data/lib/open_api_sdk/models/operations/getcustomers_queryparam_sortby.rb +0 -18
 - data/lib/open_api_sdk/models/operations/getcustomers_queryparam_sortorder.rb +0 -18
 - data/lib/open_api_sdk/models/operations/getcustomers_request.rb +0 -51
 - data/lib/open_api_sdk/models/operations/getcustomers_response.rb +0 -60
 - data/lib/open_api_sdk/models/operations/getcustomers_responsebody.rb +0 -60
 - data/lib/open_api_sdk/models/operations/getcustomers_type.rb +0 -18
 - data/lib/open_api_sdk/models/operations/getlinkinfo_request.rb +0 -33
 - data/lib/open_api_sdk/models/operations/getlinkinfo_response.rb +0 -60
 - data/lib/open_api_sdk/models/operations/getlinks_request.rb +0 -66
 - data/lib/open_api_sdk/models/operations/getlinks_response.rb +0 -60
 - data/lib/open_api_sdk/models/operations/getlinkscount_request.rb +0 -54
 - data/lib/open_api_sdk/models/operations/getlinkscount_response.rb +0 -60
 - data/lib/open_api_sdk/models/operations/getqrcode_request.rb +0 -48
 - data/lib/open_api_sdk/models/operations/getqrcode_response.rb +0 -60
 - data/lib/open_api_sdk/models/operations/gettags_queryparam_sortby.rb +0 -18
 - data/lib/open_api_sdk/models/operations/gettags_queryparam_sortorder.rb +0 -18
 - data/lib/open_api_sdk/models/operations/gettags_request.rb +0 -39
 - data/lib/open_api_sdk/models/operations/gettags_response.rb +0 -60
 - data/lib/open_api_sdk/models/operations/getworkspace_request.rb +0 -24
 - data/lib/open_api_sdk/models/operations/getworkspace_response.rb +0 -60
 - data/lib/open_api_sdk/models/operations/groupby.rb +0 -37
 - data/lib/open_api_sdk/models/operations/interval.rb +0 -25
 - data/lib/open_api_sdk/models/operations/level.rb +0 -20
 - data/lib/open_api_sdk/models/operations/link.rb +0 -48
 - data/lib/open_api_sdk/models/operations/linkprops.rb +0 -111
 - data/lib/open_api_sdk/models/operations/listcommissions_queryparam_interval.rb +0 -25
 - data/lib/open_api_sdk/models/operations/listcommissions_queryparam_sortby.rb +0 -18
 - data/lib/open_api_sdk/models/operations/listcommissions_queryparam_sortorder.rb +0 -18
 - data/lib/open_api_sdk/models/operations/listcommissions_request.rb +0 -60
 - data/lib/open_api_sdk/models/operations/listcommissions_response.rb +0 -60
 - data/lib/open_api_sdk/models/operations/listcommissions_responsebody.rb +0 -51
 - data/lib/open_api_sdk/models/operations/listcommissions_status.rb +0 -23
 - data/lib/open_api_sdk/models/operations/listcommissions_type.rb +0 -20
 - data/lib/open_api_sdk/models/operations/listdomains_request.rb +0 -33
 - data/lib/open_api_sdk/models/operations/listdomains_response.rb +0 -60
 - data/lib/open_api_sdk/models/operations/listevents_request.rb +0 -138
 - data/lib/open_api_sdk/models/operations/listevents_response.rb +0 -60
 - data/lib/open_api_sdk/models/operations/listfolders_request.rb +0 -30
 - data/lib/open_api_sdk/models/operations/listfolders_response.rb +0 -60
 - data/lib/open_api_sdk/models/operations/mode.rb +0 -18
 - data/lib/open_api_sdk/models/operations/order.rb +0 -20
 - data/lib/open_api_sdk/models/operations/partner.rb +0 -45
 - data/lib/open_api_sdk/models/operations/paymentprocessor.rb +0 -21
 - data/lib/open_api_sdk/models/operations/queryparam_event.rb +0 -19
 - data/lib/open_api_sdk/models/operations/queryparam_groupby.rb +0 -19
 - data/lib/open_api_sdk/models/operations/queryparam_interval.rb +0 -25
 - data/lib/open_api_sdk/models/operations/queryparam_sortby.rb +0 -17
 - data/lib/open_api_sdk/models/operations/queryparam_sortorder.rb +0 -18
 - data/lib/open_api_sdk/models/operations/queryparam_status.rb +0 -23
 - data/lib/open_api_sdk/models/operations/queryparam_trigger.rb +0 -18
 - data/lib/open_api_sdk/models/operations/registerdomain_requestbody.rb +0 -24
 - data/lib/open_api_sdk/models/operations/registerdomain_response.rb +0 -60
 - data/lib/open_api_sdk/models/operations/registerdomain_responsebody.rb +0 -30
 - data/lib/open_api_sdk/models/operations/requestbody.rb +0 -145
 - data/lib/open_api_sdk/models/operations/responsebody.rb +0 -33
 - data/lib/open_api_sdk/models/operations/retrieveanalytics_request.rb +0 -126
 - data/lib/open_api_sdk/models/operations/retrieveanalytics_response.rb +0 -60
 - data/lib/open_api_sdk/models/operations/retrievelinks_request.rb +0 -27
 - data/lib/open_api_sdk/models/operations/retrievelinks_response.rb +0 -60
 - data/lib/open_api_sdk/models/operations/retrievepartneranalytics_queryparam_interval.rb +0 -25
 - data/lib/open_api_sdk/models/operations/retrievepartneranalytics_request.rb +0 -42
 - data/lib/open_api_sdk/models/operations/retrievepartneranalytics_response.rb +0 -60
 - data/lib/open_api_sdk/models/operations/sale.rb +0 -36
 - data/lib/open_api_sdk/models/operations/sort.rb +0 -22
 - data/lib/open_api_sdk/models/operations/sortby.rb +0 -20
 - data/lib/open_api_sdk/models/operations/sortorder.rb +0 -18
 - data/lib/open_api_sdk/models/operations/status.rb +0 -20
 - data/lib/open_api_sdk/models/operations/testvariants.rb +0 -27
 - data/lib/open_api_sdk/models/operations/tracklead_requestbody.rb +0 -48
 - data/lib/open_api_sdk/models/operations/tracklead_response.rb +0 -60
 - data/lib/open_api_sdk/models/operations/tracklead_responsebody.rb +0 -27
 - data/lib/open_api_sdk/models/operations/tracksale_customer.rb +0 -36
 - data/lib/open_api_sdk/models/operations/tracksale_requestbody.rb +0 -45
 - data/lib/open_api_sdk/models/operations/tracksale_response.rb +0 -60
 - data/lib/open_api_sdk/models/operations/tracksale_responsebody.rb +0 -30
 - data/lib/open_api_sdk/models/operations/trigger.rb +0 -18
 - data/lib/open_api_sdk/models/operations/type.rb +0 -20
 - data/lib/open_api_sdk/models/operations/updatecommission_request.rb +0 -27
 - data/lib/open_api_sdk/models/operations/updatecommission_requestbody.rb +0 -33
 - data/lib/open_api_sdk/models/operations/updatecommission_response.rb +0 -60
 - data/lib/open_api_sdk/models/operations/updatecommission_responsebody.rb +0 -51
 - data/lib/open_api_sdk/models/operations/updatecommission_status.rb +0 -23
 - data/lib/open_api_sdk/models/operations/updatecommission_type.rb +0 -20
 - data/lib/open_api_sdk/models/operations/updatecustomer_discount.rb +0 -48
 - data/lib/open_api_sdk/models/operations/updatecustomer_link.rb +0 -39
 - data/lib/open_api_sdk/models/operations/updatecustomer_partner.rb +0 -33
 - data/lib/open_api_sdk/models/operations/updatecustomer_request.rb +0 -30
 - data/lib/open_api_sdk/models/operations/updatecustomer_requestbody.rb +0 -33
 - data/lib/open_api_sdk/models/operations/updatecustomer_response.rb +0 -60
 - data/lib/open_api_sdk/models/operations/updatecustomer_responsebody.rb +0 -60
 - data/lib/open_api_sdk/models/operations/updatecustomer_type.rb +0 -18
 - data/lib/open_api_sdk/models/operations/updatedomain_request.rb +0 -27
 - data/lib/open_api_sdk/models/operations/updatedomain_requestbody.rb +0 -45
 - data/lib/open_api_sdk/models/operations/updatedomain_response.rb +0 -60
 - data/lib/open_api_sdk/models/operations/updatefolder_accesslevel.rb +0 -18
 - data/lib/open_api_sdk/models/operations/updatefolder_request.rb +0 -27
 - data/lib/open_api_sdk/models/operations/updatefolder_requestbody.rb +0 -27
 - data/lib/open_api_sdk/models/operations/updatefolder_response.rb +0 -60
 - data/lib/open_api_sdk/models/operations/updatelink_request.rb +0 -27
 - data/lib/open_api_sdk/models/operations/updatelink_requestbody.rb +0 -139
 - data/lib/open_api_sdk/models/operations/updatelink_response.rb +0 -60
 - data/lib/open_api_sdk/models/operations/updatelink_testvariants.rb +0 -27
 - data/lib/open_api_sdk/models/operations/updatetag_color.rb +0 -23
 - data/lib/open_api_sdk/models/operations/updatetag_request.rb +0 -27
 - data/lib/open_api_sdk/models/operations/updatetag_requestbody.rb +0 -32
 - data/lib/open_api_sdk/models/operations/updatetag_response.rb +0 -60
 - data/lib/open_api_sdk/models/operations/updateworkspace_request.rb +0 -27
 - data/lib/open_api_sdk/models/operations/updateworkspace_requestbody.rb +0 -36
 - data/lib/open_api_sdk/models/operations/updateworkspace_response.rb +0 -60
 - data/lib/open_api_sdk/models/operations/upsertlink_requestbody.rb +0 -145
 - data/lib/open_api_sdk/models/operations/upsertlink_response.rb +0 -60
 - data/lib/open_api_sdk/models/operations/upsertlink_testvariants.rb +0 -27
 - data/lib/open_api_sdk/models/operations/upsertpartnerlink_linkprops.rb +0 -111
 - data/lib/open_api_sdk/models/operations/upsertpartnerlink_requestbody.rb +0 -39
 - data/lib/open_api_sdk/models/operations/upsertpartnerlink_response.rb +0 -60
 - data/lib/open_api_sdk/models/operations/upsertpartnerlink_testvariants.rb +0 -27
 - data/lib/open_api_sdk/models/operations.rb +0 -198
 - data/lib/open_api_sdk/models/shared/accesslevel.rb +0 -18
 - data/lib/open_api_sdk/models/shared/badrequest.rb +0 -24
 - data/lib/open_api_sdk/models/shared/code.rb +0 -17
 - data/lib/open_api_sdk/models/shared/color.rb +0 -23
 - data/lib/open_api_sdk/models/shared/conflict.rb +0 -24
 - data/lib/open_api_sdk/models/shared/conflict_code.rb +0 -17
 - data/lib/open_api_sdk/models/shared/conflict_error.rb +0 -30
 - data/lib/open_api_sdk/models/shared/continentcode.rb +0 -23
 - data/lib/open_api_sdk/models/shared/countrycode.rb +0 -266
 - data/lib/open_api_sdk/models/shared/domains.rb +0 -30
 - data/lib/open_api_sdk/models/shared/domainschema.rb +0 -63
 - data/lib/open_api_sdk/models/shared/error.rb +0 -30
 - data/lib/open_api_sdk/models/shared/folderschema.rb +0 -39
 - data/lib/open_api_sdk/models/shared/forbidden.rb +0 -24
 - data/lib/open_api_sdk/models/shared/forbidden_code.rb +0 -17
 - data/lib/open_api_sdk/models/shared/forbidden_error.rb +0 -30
 - data/lib/open_api_sdk/models/shared/geo.rb +0 -771
 - data/lib/open_api_sdk/models/shared/internalservererror.rb +0 -24
 - data/lib/open_api_sdk/models/shared/internalservererror_code.rb +0 -17
 - data/lib/open_api_sdk/models/shared/internalservererror_error.rb +0 -30
 - data/lib/open_api_sdk/models/shared/inviteexpired.rb +0 -24
 - data/lib/open_api_sdk/models/shared/inviteexpired_code.rb +0 -17
 - data/lib/open_api_sdk/models/shared/inviteexpired_error.rb +0 -30
 - data/lib/open_api_sdk/models/shared/linkgeotargeting.rb +0 -771
 - data/lib/open_api_sdk/models/shared/linkschema.rb +0 -172
 - data/lib/open_api_sdk/models/shared/notfound.rb +0 -24
 - data/lib/open_api_sdk/models/shared/notfound_code.rb +0 -17
 - data/lib/open_api_sdk/models/shared/notfound_error.rb +0 -30
 - data/lib/open_api_sdk/models/shared/plan.rb +0 -24
 - data/lib/open_api_sdk/models/shared/ratelimitexceeded.rb +0 -24
 - data/lib/open_api_sdk/models/shared/ratelimitexceeded_code.rb +0 -17
 - data/lib/open_api_sdk/models/shared/ratelimitexceeded_error.rb +0 -30
 - data/lib/open_api_sdk/models/shared/registereddomain.rb +0 -30
 - data/lib/open_api_sdk/models/shared/role.rb +0 -18
 - data/lib/open_api_sdk/models/shared/security.rb +0 -24
 - data/lib/open_api_sdk/models/shared/tagschema.rb +0 -30
 - data/lib/open_api_sdk/models/shared/testvariants.rb +0 -27
 - data/lib/open_api_sdk/models/shared/type.rb +0 -18
 - data/lib/open_api_sdk/models/shared/unauthorized.rb +0 -24
 - data/lib/open_api_sdk/models/shared/unauthorized_code.rb +0 -17
 - data/lib/open_api_sdk/models/shared/unauthorized_error.rb +0 -30
 - data/lib/open_api_sdk/models/shared/unprocessableentity.rb +0 -24
 - data/lib/open_api_sdk/models/shared/unprocessableentity_code.rb +0 -17
 - data/lib/open_api_sdk/models/shared/unprocessableentity_error.rb +0 -30
 - data/lib/open_api_sdk/models/shared/users.rb +0 -27
 - data/lib/open_api_sdk/models/shared/workspaceschema.rb +0 -123
 - data/lib/open_api_sdk/models/shared.rb +0 -55
 - data/lib/open_api_sdk/partners.rb +0 -701
 - data/lib/open_api_sdk/qr_codes.rb +0 -151
 - data/lib/open_api_sdk/sdk_hooks/hooks.rb +0 -103
 - data/lib/open_api_sdk/sdk_hooks/registration.rb +0 -35
 - data/lib/open_api_sdk/sdk_hooks/types.rb +0 -152
 - data/lib/open_api_sdk/sdkconfiguration.rb +0 -75
 - data/lib/open_api_sdk/tags.rb +0 -570
 - data/lib/open_api_sdk/track.rb +0 -302
 - data/lib/open_api_sdk/utils/retries.rb +0 -95
 - data/lib/open_api_sdk/utils/utils.rb +0 -738
 - data/lib/open_api_sdk/workspaces.rb +0 -301
 
| 
         @@ -0,0 +1,622 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            /*
         
     | 
| 
      
 2 
     | 
    
         
            +
            ** $Id: ldebug.c,v 2.29a 2005/12/22 16:19:56 roberto Exp $
         
     | 
| 
      
 3 
     | 
    
         
            +
            ** Debug Interface
         
     | 
| 
      
 4 
     | 
    
         
            +
            ** See Copyright Notice in lua.h
         
     | 
| 
      
 5 
     | 
    
         
            +
            */
         
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
      
 7 
     | 
    
         
            +
             
     | 
| 
      
 8 
     | 
    
         
            +
            #include <stdarg.h>
         
     | 
| 
      
 9 
     | 
    
         
            +
            #include <stddef.h>
         
     | 
| 
      
 10 
     | 
    
         
            +
            #include <string.h>
         
     | 
| 
      
 11 
     | 
    
         
            +
             
     | 
| 
      
 12 
     | 
    
         
            +
             
     | 
| 
      
 13 
     | 
    
         
            +
            #define ldebug_c
         
     | 
| 
      
 14 
     | 
    
         
            +
            #define LUA_CORE
         
     | 
| 
      
 15 
     | 
    
         
            +
             
     | 
| 
      
 16 
     | 
    
         
            +
            #include "lua.h"
         
     | 
| 
      
 17 
     | 
    
         
            +
             
     | 
| 
      
 18 
     | 
    
         
            +
            #include "lapi.h"
         
     | 
| 
      
 19 
     | 
    
         
            +
            #include "lcode.h"
         
     | 
| 
      
 20 
     | 
    
         
            +
            #include "ldebug.h"
         
     | 
| 
      
 21 
     | 
    
         
            +
            #include "ldo.h"
         
     | 
| 
      
 22 
     | 
    
         
            +
            #include "lfunc.h"
         
     | 
| 
      
 23 
     | 
    
         
            +
            #include "lobject.h"
         
     | 
| 
      
 24 
     | 
    
         
            +
            #include "lopcodes.h"
         
     | 
| 
      
 25 
     | 
    
         
            +
            #include "lstate.h"
         
     | 
| 
      
 26 
     | 
    
         
            +
            #include "lstring.h"
         
     | 
| 
      
 27 
     | 
    
         
            +
            #include "ltable.h"
         
     | 
| 
      
 28 
     | 
    
         
            +
            #include "ltm.h"
         
     | 
| 
      
 29 
     | 
    
         
            +
            #include "lvm.h"
         
     | 
| 
      
 30 
     | 
    
         
            +
             
     | 
| 
      
 31 
     | 
    
         
            +
             
     | 
| 
      
 32 
     | 
    
         
            +
             
     | 
| 
      
 33 
     | 
    
         
            +
            static const char *getfuncname (lua_State *L, CallInfo *ci, const char **name);
         
     | 
| 
      
 34 
     | 
    
         
            +
             
     | 
| 
      
 35 
     | 
    
         
            +
             
     | 
| 
      
 36 
     | 
    
         
            +
            static int currentpc (lua_State *L, CallInfo *ci) {
         
     | 
| 
      
 37 
     | 
    
         
            +
              if (!isLua(ci)) return -1;  /* function is not a Lua function? */
         
     | 
| 
      
 38 
     | 
    
         
            +
              if (ci == L->ci)
         
     | 
| 
      
 39 
     | 
    
         
            +
                ci->savedpc = L->savedpc;
         
     | 
| 
      
 40 
     | 
    
         
            +
              return pcRel(ci->savedpc, ci_func(ci)->l.p);
         
     | 
| 
      
 41 
     | 
    
         
            +
            }
         
     | 
| 
      
 42 
     | 
    
         
            +
             
     | 
| 
      
 43 
     | 
    
         
            +
             
     | 
| 
      
 44 
     | 
    
         
            +
            static int currentline (lua_State *L, CallInfo *ci) {
         
     | 
| 
      
 45 
     | 
    
         
            +
              int pc = currentpc(L, ci);
         
     | 
| 
      
 46 
     | 
    
         
            +
              if (pc < 0)
         
     | 
| 
      
 47 
     | 
    
         
            +
                return -1;  /* only active lua functions have current-line information */
         
     | 
| 
      
 48 
     | 
    
         
            +
              else
         
     | 
| 
      
 49 
     | 
    
         
            +
                return getline(ci_func(ci)->l.p, pc);
         
     | 
| 
      
 50 
     | 
    
         
            +
            }
         
     | 
| 
      
 51 
     | 
    
         
            +
             
     | 
| 
      
 52 
     | 
    
         
            +
             
     | 
| 
      
 53 
     | 
    
         
            +
            /*
         
     | 
| 
      
 54 
     | 
    
         
            +
            ** this function can be called asynchronous (e.g. during a signal)
         
     | 
| 
      
 55 
     | 
    
         
            +
            */
         
     | 
| 
      
 56 
     | 
    
         
            +
            LUA_API int lua_sethook (lua_State *L, lua_Hook func, int mask, int count) {
         
     | 
| 
      
 57 
     | 
    
         
            +
              if (func == NULL || mask == 0) {  /* turn off hooks? */
         
     | 
| 
      
 58 
     | 
    
         
            +
                mask = 0;
         
     | 
| 
      
 59 
     | 
    
         
            +
                func = NULL;
         
     | 
| 
      
 60 
     | 
    
         
            +
              }
         
     | 
| 
      
 61 
     | 
    
         
            +
              L->hook = func;
         
     | 
| 
      
 62 
     | 
    
         
            +
              L->basehookcount = count;
         
     | 
| 
      
 63 
     | 
    
         
            +
              resethookcount(L);
         
     | 
| 
      
 64 
     | 
    
         
            +
              L->hookmask = cast_byte(mask);
         
     | 
| 
      
 65 
     | 
    
         
            +
              return 1;
         
     | 
| 
      
 66 
     | 
    
         
            +
            }
         
     | 
| 
      
 67 
     | 
    
         
            +
             
     | 
| 
      
 68 
     | 
    
         
            +
             
     | 
| 
      
 69 
     | 
    
         
            +
            LUA_API lua_Hook lua_gethook (lua_State *L) {
         
     | 
| 
      
 70 
     | 
    
         
            +
              return L->hook;
         
     | 
| 
      
 71 
     | 
    
         
            +
            }
         
     | 
| 
      
 72 
     | 
    
         
            +
             
     | 
| 
      
 73 
     | 
    
         
            +
             
     | 
| 
      
 74 
     | 
    
         
            +
            LUA_API int lua_gethookmask (lua_State *L) {
         
     | 
| 
      
 75 
     | 
    
         
            +
              return L->hookmask;
         
     | 
| 
      
 76 
     | 
    
         
            +
            }
         
     | 
| 
      
 77 
     | 
    
         
            +
             
     | 
| 
      
 78 
     | 
    
         
            +
             
     | 
| 
      
 79 
     | 
    
         
            +
            LUA_API int lua_gethookcount (lua_State *L) {
         
     | 
| 
      
 80 
     | 
    
         
            +
              return L->basehookcount;
         
     | 
| 
      
 81 
     | 
    
         
            +
            }
         
     | 
| 
      
 82 
     | 
    
         
            +
             
     | 
| 
      
 83 
     | 
    
         
            +
             
     | 
| 
      
 84 
     | 
    
         
            +
            LUA_API int lua_getstack (lua_State *L, int level, lua_Debug *ar) {
         
     | 
| 
      
 85 
     | 
    
         
            +
              int status;
         
     | 
| 
      
 86 
     | 
    
         
            +
              CallInfo *ci;
         
     | 
| 
      
 87 
     | 
    
         
            +
              lua_lock(L);
         
     | 
| 
      
 88 
     | 
    
         
            +
              for (ci = L->ci; level > 0 && ci > L->base_ci; ci--) {
         
     | 
| 
      
 89 
     | 
    
         
            +
                level--;
         
     | 
| 
      
 90 
     | 
    
         
            +
                if (f_isLua(ci))  /* Lua function? */
         
     | 
| 
      
 91 
     | 
    
         
            +
                  level -= ci->tailcalls;  /* skip lost tail calls */
         
     | 
| 
      
 92 
     | 
    
         
            +
              }
         
     | 
| 
      
 93 
     | 
    
         
            +
              if (level == 0 && ci > L->base_ci) {  /* level found? */
         
     | 
| 
      
 94 
     | 
    
         
            +
                status = 1;
         
     | 
| 
      
 95 
     | 
    
         
            +
                ar->i_ci = cast_int(ci - L->base_ci);
         
     | 
| 
      
 96 
     | 
    
         
            +
              }
         
     | 
| 
      
 97 
     | 
    
         
            +
              else if (level < 0) {  /* level is of a lost tail call? */
         
     | 
| 
      
 98 
     | 
    
         
            +
                status = 1;
         
     | 
| 
      
 99 
     | 
    
         
            +
                ar->i_ci = 0;
         
     | 
| 
      
 100 
     | 
    
         
            +
              }
         
     | 
| 
      
 101 
     | 
    
         
            +
              else status = 0;  /* no such level */
         
     | 
| 
      
 102 
     | 
    
         
            +
              lua_unlock(L);
         
     | 
| 
      
 103 
     | 
    
         
            +
              return status;
         
     | 
| 
      
 104 
     | 
    
         
            +
            }
         
     | 
| 
      
 105 
     | 
    
         
            +
             
     | 
| 
      
 106 
     | 
    
         
            +
             
     | 
| 
      
 107 
     | 
    
         
            +
            static Proto *getluaproto (CallInfo *ci) {
         
     | 
| 
      
 108 
     | 
    
         
            +
              return (isLua(ci) ? ci_func(ci)->l.p : NULL);
         
     | 
| 
      
 109 
     | 
    
         
            +
            }
         
     | 
| 
      
 110 
     | 
    
         
            +
             
     | 
| 
      
 111 
     | 
    
         
            +
             
     | 
| 
      
 112 
     | 
    
         
            +
            static const char *findlocal (lua_State *L, CallInfo *ci, int n) {
         
     | 
| 
      
 113 
     | 
    
         
            +
              const char *name;
         
     | 
| 
      
 114 
     | 
    
         
            +
              Proto *fp = getluaproto(ci);
         
     | 
| 
      
 115 
     | 
    
         
            +
              if (fp && (name = luaF_getlocalname(fp, n, currentpc(L, ci))) != NULL)
         
     | 
| 
      
 116 
     | 
    
         
            +
                return name;  /* is a local variable in a Lua function */
         
     | 
| 
      
 117 
     | 
    
         
            +
              else {
         
     | 
| 
      
 118 
     | 
    
         
            +
                StkId limit = (ci == L->ci) ? L->top : (ci+1)->func;
         
     | 
| 
      
 119 
     | 
    
         
            +
                if (limit - ci->base >= n && n > 0)  /* is 'n' inside 'ci' stack? */
         
     | 
| 
      
 120 
     | 
    
         
            +
                  return "(*temporary)";
         
     | 
| 
      
 121 
     | 
    
         
            +
                else
         
     | 
| 
      
 122 
     | 
    
         
            +
                  return NULL;
         
     | 
| 
      
 123 
     | 
    
         
            +
              }
         
     | 
| 
      
 124 
     | 
    
         
            +
            }
         
     | 
| 
      
 125 
     | 
    
         
            +
             
     | 
| 
      
 126 
     | 
    
         
            +
             
     | 
| 
      
 127 
     | 
    
         
            +
            LUA_API const char *lua_getlocal (lua_State *L, const lua_Debug *ar, int n) {
         
     | 
| 
      
 128 
     | 
    
         
            +
              CallInfo *ci = L->base_ci + ar->i_ci;
         
     | 
| 
      
 129 
     | 
    
         
            +
              const char *name = findlocal(L, ci, n);
         
     | 
| 
      
 130 
     | 
    
         
            +
              lua_lock(L);
         
     | 
| 
      
 131 
     | 
    
         
            +
              if (name)
         
     | 
| 
      
 132 
     | 
    
         
            +
                  luaA_pushobject(L, ci->base + (n - 1));
         
     | 
| 
      
 133 
     | 
    
         
            +
              lua_unlock(L);
         
     | 
| 
      
 134 
     | 
    
         
            +
              return name;
         
     | 
| 
      
 135 
     | 
    
         
            +
            }
         
     | 
| 
      
 136 
     | 
    
         
            +
             
     | 
| 
      
 137 
     | 
    
         
            +
             
     | 
| 
      
 138 
     | 
    
         
            +
            LUA_API const char *lua_setlocal (lua_State *L, const lua_Debug *ar, int n) {
         
     | 
| 
      
 139 
     | 
    
         
            +
              CallInfo *ci = L->base_ci + ar->i_ci;
         
     | 
| 
      
 140 
     | 
    
         
            +
              const char *name = findlocal(L, ci, n);
         
     | 
| 
      
 141 
     | 
    
         
            +
              lua_lock(L);
         
     | 
| 
      
 142 
     | 
    
         
            +
              if (name)
         
     | 
| 
      
 143 
     | 
    
         
            +
                  setobjs2s(L, ci->base + (n - 1), L->top - 1);
         
     | 
| 
      
 144 
     | 
    
         
            +
              L->top--;  /* pop value */
         
     | 
| 
      
 145 
     | 
    
         
            +
              lua_unlock(L);
         
     | 
| 
      
 146 
     | 
    
         
            +
              return name;
         
     | 
| 
      
 147 
     | 
    
         
            +
            }
         
     | 
| 
      
 148 
     | 
    
         
            +
             
     | 
| 
      
 149 
     | 
    
         
            +
             
     | 
| 
      
 150 
     | 
    
         
            +
            static void funcinfo (lua_Debug *ar, Closure *cl) {
         
     | 
| 
      
 151 
     | 
    
         
            +
              if (cl->c.isC) {
         
     | 
| 
      
 152 
     | 
    
         
            +
                ar->source = "=[C]";
         
     | 
| 
      
 153 
     | 
    
         
            +
                ar->linedefined = -1;
         
     | 
| 
      
 154 
     | 
    
         
            +
                ar->lastlinedefined = -1;
         
     | 
| 
      
 155 
     | 
    
         
            +
                ar->what = "C";
         
     | 
| 
      
 156 
     | 
    
         
            +
              }
         
     | 
| 
      
 157 
     | 
    
         
            +
              else {
         
     | 
| 
      
 158 
     | 
    
         
            +
                ar->source = getstr(cl->l.p->source);
         
     | 
| 
      
 159 
     | 
    
         
            +
                ar->linedefined = cl->l.p->linedefined;
         
     | 
| 
      
 160 
     | 
    
         
            +
                ar->lastlinedefined = cl->l.p->lastlinedefined;
         
     | 
| 
      
 161 
     | 
    
         
            +
                ar->what = (ar->linedefined == 0) ? "main" : "Lua";
         
     | 
| 
      
 162 
     | 
    
         
            +
              }
         
     | 
| 
      
 163 
     | 
    
         
            +
              luaO_chunkid(ar->short_src, ar->source, LUA_IDSIZE);
         
     | 
| 
      
 164 
     | 
    
         
            +
            }
         
     | 
| 
      
 165 
     | 
    
         
            +
             
     | 
| 
      
 166 
     | 
    
         
            +
             
     | 
| 
      
 167 
     | 
    
         
            +
            static void info_tailcall (lua_Debug *ar) {
         
     | 
| 
      
 168 
     | 
    
         
            +
              ar->name = ar->namewhat = "";
         
     | 
| 
      
 169 
     | 
    
         
            +
              ar->what = "tail";
         
     | 
| 
      
 170 
     | 
    
         
            +
              ar->lastlinedefined = ar->linedefined = ar->currentline = -1;
         
     | 
| 
      
 171 
     | 
    
         
            +
              ar->source = "=(tail call)";
         
     | 
| 
      
 172 
     | 
    
         
            +
              luaO_chunkid(ar->short_src, ar->source, LUA_IDSIZE);
         
     | 
| 
      
 173 
     | 
    
         
            +
              ar->nups = 0;
         
     | 
| 
      
 174 
     | 
    
         
            +
            }
         
     | 
| 
      
 175 
     | 
    
         
            +
             
     | 
| 
      
 176 
     | 
    
         
            +
             
     | 
| 
      
 177 
     | 
    
         
            +
            static void collectvalidlines (lua_State *L, Closure *f) {
         
     | 
| 
      
 178 
     | 
    
         
            +
              if (f == NULL || f->c.isC) {
         
     | 
| 
      
 179 
     | 
    
         
            +
                setnilvalue(L->top);
         
     | 
| 
      
 180 
     | 
    
         
            +
              }
         
     | 
| 
      
 181 
     | 
    
         
            +
              else {
         
     | 
| 
      
 182 
     | 
    
         
            +
                Table *t = luaH_new(L, 0, 0);
         
     | 
| 
      
 183 
     | 
    
         
            +
                int *lineinfo = f->l.p->lineinfo;
         
     | 
| 
      
 184 
     | 
    
         
            +
                int i;
         
     | 
| 
      
 185 
     | 
    
         
            +
                for (i=0; i<f->l.p->sizelineinfo; i++)
         
     | 
| 
      
 186 
     | 
    
         
            +
                  setbvalue(luaH_setnum(L, t, lineinfo[i]), 1);
         
     | 
| 
      
 187 
     | 
    
         
            +
                sethvalue(L, L->top, t); 
         
     | 
| 
      
 188 
     | 
    
         
            +
              }
         
     | 
| 
      
 189 
     | 
    
         
            +
              incr_top(L);
         
     | 
| 
      
 190 
     | 
    
         
            +
            }
         
     | 
| 
      
 191 
     | 
    
         
            +
             
     | 
| 
      
 192 
     | 
    
         
            +
             
     | 
| 
      
 193 
     | 
    
         
            +
            static int auxgetinfo (lua_State *L, const char *what, lua_Debug *ar,
         
     | 
| 
      
 194 
     | 
    
         
            +
                                Closure *f, CallInfo *ci) {
         
     | 
| 
      
 195 
     | 
    
         
            +
              int status = 1;
         
     | 
| 
      
 196 
     | 
    
         
            +
              if (f == NULL) {
         
     | 
| 
      
 197 
     | 
    
         
            +
                info_tailcall(ar);
         
     | 
| 
      
 198 
     | 
    
         
            +
                return status;
         
     | 
| 
      
 199 
     | 
    
         
            +
              }
         
     | 
| 
      
 200 
     | 
    
         
            +
              for (; *what; what++) {
         
     | 
| 
      
 201 
     | 
    
         
            +
                switch (*what) {
         
     | 
| 
      
 202 
     | 
    
         
            +
                  case 'S': {
         
     | 
| 
      
 203 
     | 
    
         
            +
                    funcinfo(ar, f);
         
     | 
| 
      
 204 
     | 
    
         
            +
                    break;
         
     | 
| 
      
 205 
     | 
    
         
            +
                  }
         
     | 
| 
      
 206 
     | 
    
         
            +
                  case 'l': {
         
     | 
| 
      
 207 
     | 
    
         
            +
                    ar->currentline = (ci) ? currentline(L, ci) : -1;
         
     | 
| 
      
 208 
     | 
    
         
            +
                    break;
         
     | 
| 
      
 209 
     | 
    
         
            +
                  }
         
     | 
| 
      
 210 
     | 
    
         
            +
                  case 'u': {
         
     | 
| 
      
 211 
     | 
    
         
            +
                    ar->nups = f->c.nupvalues;
         
     | 
| 
      
 212 
     | 
    
         
            +
                    break;
         
     | 
| 
      
 213 
     | 
    
         
            +
                  }
         
     | 
| 
      
 214 
     | 
    
         
            +
                  case 'n': {
         
     | 
| 
      
 215 
     | 
    
         
            +
                    ar->namewhat = (ci) ? getfuncname(L, ci, &ar->name) : NULL;
         
     | 
| 
      
 216 
     | 
    
         
            +
                    if (ar->namewhat == NULL) {
         
     | 
| 
      
 217 
     | 
    
         
            +
                      ar->namewhat = "";  /* not found */
         
     | 
| 
      
 218 
     | 
    
         
            +
                      ar->name = NULL;
         
     | 
| 
      
 219 
     | 
    
         
            +
                    }
         
     | 
| 
      
 220 
     | 
    
         
            +
                    break;
         
     | 
| 
      
 221 
     | 
    
         
            +
                  }
         
     | 
| 
      
 222 
     | 
    
         
            +
                  case 'L':
         
     | 
| 
      
 223 
     | 
    
         
            +
                  case 'f':  /* handled by lua_getinfo */
         
     | 
| 
      
 224 
     | 
    
         
            +
                    break;
         
     | 
| 
      
 225 
     | 
    
         
            +
                  default: status = 0;  /* invalid option */
         
     | 
| 
      
 226 
     | 
    
         
            +
                }
         
     | 
| 
      
 227 
     | 
    
         
            +
              }
         
     | 
| 
      
 228 
     | 
    
         
            +
              return status;
         
     | 
| 
      
 229 
     | 
    
         
            +
            }
         
     | 
| 
      
 230 
     | 
    
         
            +
             
     | 
| 
      
 231 
     | 
    
         
            +
             
     | 
| 
      
 232 
     | 
    
         
            +
            LUA_API int lua_getinfo (lua_State *L, const char *what, lua_Debug *ar) {
         
     | 
| 
      
 233 
     | 
    
         
            +
              int status;
         
     | 
| 
      
 234 
     | 
    
         
            +
              Closure *f = NULL;
         
     | 
| 
      
 235 
     | 
    
         
            +
              CallInfo *ci = NULL;
         
     | 
| 
      
 236 
     | 
    
         
            +
              lua_lock(L);
         
     | 
| 
      
 237 
     | 
    
         
            +
              if (*what == '>') {
         
     | 
| 
      
 238 
     | 
    
         
            +
                StkId func = L->top - 1;
         
     | 
| 
      
 239 
     | 
    
         
            +
                luai_apicheck(L, ttisfunction(func));
         
     | 
| 
      
 240 
     | 
    
         
            +
                what++;  /* skip the '>' */
         
     | 
| 
      
 241 
     | 
    
         
            +
                f = clvalue(func);
         
     | 
| 
      
 242 
     | 
    
         
            +
                L->top--;  /* pop function */
         
     | 
| 
      
 243 
     | 
    
         
            +
              }
         
     | 
| 
      
 244 
     | 
    
         
            +
              else if (ar->i_ci != 0) {  /* no tail call? */
         
     | 
| 
      
 245 
     | 
    
         
            +
                ci = L->base_ci + ar->i_ci;
         
     | 
| 
      
 246 
     | 
    
         
            +
                lua_assert(ttisfunction(ci->func));
         
     | 
| 
      
 247 
     | 
    
         
            +
                f = clvalue(ci->func);
         
     | 
| 
      
 248 
     | 
    
         
            +
              }
         
     | 
| 
      
 249 
     | 
    
         
            +
              status = auxgetinfo(L, what, ar, f, ci);
         
     | 
| 
      
 250 
     | 
    
         
            +
              if (strchr(what, 'f')) {
         
     | 
| 
      
 251 
     | 
    
         
            +
                if (f == NULL) setnilvalue(L->top);
         
     | 
| 
      
 252 
     | 
    
         
            +
                else setclvalue(L, L->top, f);
         
     | 
| 
      
 253 
     | 
    
         
            +
                incr_top(L);
         
     | 
| 
      
 254 
     | 
    
         
            +
              }
         
     | 
| 
      
 255 
     | 
    
         
            +
              if (strchr(what, 'L'))
         
     | 
| 
      
 256 
     | 
    
         
            +
                collectvalidlines(L, f);
         
     | 
| 
      
 257 
     | 
    
         
            +
              lua_unlock(L);
         
     | 
| 
      
 258 
     | 
    
         
            +
              return status;
         
     | 
| 
      
 259 
     | 
    
         
            +
            }
         
     | 
| 
      
 260 
     | 
    
         
            +
             
     | 
| 
      
 261 
     | 
    
         
            +
             
     | 
| 
      
 262 
     | 
    
         
            +
            /*
         
     | 
| 
      
 263 
     | 
    
         
            +
            ** {======================================================
         
     | 
| 
      
 264 
     | 
    
         
            +
            ** Symbolic Execution and code checker
         
     | 
| 
      
 265 
     | 
    
         
            +
            ** =======================================================
         
     | 
| 
      
 266 
     | 
    
         
            +
            */
         
     | 
| 
      
 267 
     | 
    
         
            +
             
     | 
| 
      
 268 
     | 
    
         
            +
            #define check(x)		if (!(x)) return 0;
         
     | 
| 
      
 269 
     | 
    
         
            +
             
     | 
| 
      
 270 
     | 
    
         
            +
            #define checkjump(pt,pc)	check(0 <= pc && pc < pt->sizecode)
         
     | 
| 
      
 271 
     | 
    
         
            +
             
     | 
| 
      
 272 
     | 
    
         
            +
            #define checkreg(pt,reg)	check((reg) < (pt)->maxstacksize)
         
     | 
| 
      
 273 
     | 
    
         
            +
             
     | 
| 
      
 274 
     | 
    
         
            +
             
     | 
| 
      
 275 
     | 
    
         
            +
             
     | 
| 
      
 276 
     | 
    
         
            +
            static int precheck (const Proto *pt) {
         
     | 
| 
      
 277 
     | 
    
         
            +
              check(pt->maxstacksize <= MAXSTACK);
         
     | 
| 
      
 278 
     | 
    
         
            +
              lua_assert(pt->numparams+(pt->is_vararg & VARARG_HASARG) <= pt->maxstacksize);
         
     | 
| 
      
 279 
     | 
    
         
            +
              lua_assert(!(pt->is_vararg & VARARG_NEEDSARG) ||
         
     | 
| 
      
 280 
     | 
    
         
            +
                          (pt->is_vararg & VARARG_HASARG));
         
     | 
| 
      
 281 
     | 
    
         
            +
              check(pt->sizeupvalues <= pt->nups);
         
     | 
| 
      
 282 
     | 
    
         
            +
              check(pt->sizelineinfo == pt->sizecode || pt->sizelineinfo == 0);
         
     | 
| 
      
 283 
     | 
    
         
            +
              check(GET_OPCODE(pt->code[pt->sizecode-1]) == OP_RETURN);
         
     | 
| 
      
 284 
     | 
    
         
            +
              return 1;
         
     | 
| 
      
 285 
     | 
    
         
            +
            }
         
     | 
| 
      
 286 
     | 
    
         
            +
             
     | 
| 
      
 287 
     | 
    
         
            +
             
     | 
| 
      
 288 
     | 
    
         
            +
            #define checkopenop(pt,pc)	luaG_checkopenop((pt)->code[(pc)+1])
         
     | 
| 
      
 289 
     | 
    
         
            +
             
     | 
| 
      
 290 
     | 
    
         
            +
            int luaG_checkopenop (Instruction i) {
         
     | 
| 
      
 291 
     | 
    
         
            +
              switch (GET_OPCODE(i)) {
         
     | 
| 
      
 292 
     | 
    
         
            +
                case OP_CALL:
         
     | 
| 
      
 293 
     | 
    
         
            +
                case OP_TAILCALL:
         
     | 
| 
      
 294 
     | 
    
         
            +
                case OP_RETURN:
         
     | 
| 
      
 295 
     | 
    
         
            +
                case OP_SETLIST: {
         
     | 
| 
      
 296 
     | 
    
         
            +
                  check(GETARG_B(i) == 0);
         
     | 
| 
      
 297 
     | 
    
         
            +
                  return 1;
         
     | 
| 
      
 298 
     | 
    
         
            +
                }
         
     | 
| 
      
 299 
     | 
    
         
            +
                default: return 0;  /* invalid instruction after an open call */
         
     | 
| 
      
 300 
     | 
    
         
            +
              }
         
     | 
| 
      
 301 
     | 
    
         
            +
            }
         
     | 
| 
      
 302 
     | 
    
         
            +
             
     | 
| 
      
 303 
     | 
    
         
            +
             
     | 
| 
      
 304 
     | 
    
         
            +
            static int checkArgMode (const Proto *pt, int r, enum OpArgMask mode) {
         
     | 
| 
      
 305 
     | 
    
         
            +
              switch (mode) {
         
     | 
| 
      
 306 
     | 
    
         
            +
                case OpArgN: check(r == 0); break;
         
     | 
| 
      
 307 
     | 
    
         
            +
                case OpArgU: break;
         
     | 
| 
      
 308 
     | 
    
         
            +
                case OpArgR: checkreg(pt, r); break;
         
     | 
| 
      
 309 
     | 
    
         
            +
                case OpArgK:
         
     | 
| 
      
 310 
     | 
    
         
            +
                  check(ISK(r) ? INDEXK(r) < pt->sizek : r < pt->maxstacksize);
         
     | 
| 
      
 311 
     | 
    
         
            +
                  break;
         
     | 
| 
      
 312 
     | 
    
         
            +
              }
         
     | 
| 
      
 313 
     | 
    
         
            +
              return 1;
         
     | 
| 
      
 314 
     | 
    
         
            +
            }
         
     | 
| 
      
 315 
     | 
    
         
            +
             
     | 
| 
      
 316 
     | 
    
         
            +
             
     | 
| 
      
 317 
     | 
    
         
            +
            static Instruction symbexec (const Proto *pt, int lastpc, int reg) {
         
     | 
| 
      
 318 
     | 
    
         
            +
              int pc;
         
     | 
| 
      
 319 
     | 
    
         
            +
              int last;  /* stores position of last instruction that changed `reg' */
         
     | 
| 
      
 320 
     | 
    
         
            +
              last = pt->sizecode-1;  /* points to final return (a `neutral' instruction) */
         
     | 
| 
      
 321 
     | 
    
         
            +
              check(precheck(pt));
         
     | 
| 
      
 322 
     | 
    
         
            +
              for (pc = 0; pc < lastpc; pc++) {
         
     | 
| 
      
 323 
     | 
    
         
            +
                Instruction i = pt->code[pc];
         
     | 
| 
      
 324 
     | 
    
         
            +
                OpCode op = GET_OPCODE(i);
         
     | 
| 
      
 325 
     | 
    
         
            +
                int a = GETARG_A(i);
         
     | 
| 
      
 326 
     | 
    
         
            +
                int b = 0;
         
     | 
| 
      
 327 
     | 
    
         
            +
                int c = 0;
         
     | 
| 
      
 328 
     | 
    
         
            +
                check(op < NUM_OPCODES);
         
     | 
| 
      
 329 
     | 
    
         
            +
                checkreg(pt, a);
         
     | 
| 
      
 330 
     | 
    
         
            +
                switch (getOpMode(op)) {
         
     | 
| 
      
 331 
     | 
    
         
            +
                  case iABC: {
         
     | 
| 
      
 332 
     | 
    
         
            +
                    b = GETARG_B(i);
         
     | 
| 
      
 333 
     | 
    
         
            +
                    c = GETARG_C(i);
         
     | 
| 
      
 334 
     | 
    
         
            +
                    check(checkArgMode(pt, b, getBMode(op)));
         
     | 
| 
      
 335 
     | 
    
         
            +
                    check(checkArgMode(pt, c, getCMode(op)));
         
     | 
| 
      
 336 
     | 
    
         
            +
                    break;
         
     | 
| 
      
 337 
     | 
    
         
            +
                  }
         
     | 
| 
      
 338 
     | 
    
         
            +
                  case iABx: {
         
     | 
| 
      
 339 
     | 
    
         
            +
                    b = GETARG_Bx(i);
         
     | 
| 
      
 340 
     | 
    
         
            +
                    if (getBMode(op) == OpArgK) check(b < pt->sizek);
         
     | 
| 
      
 341 
     | 
    
         
            +
                    break;
         
     | 
| 
      
 342 
     | 
    
         
            +
                  }
         
     | 
| 
      
 343 
     | 
    
         
            +
                  case iAsBx: {
         
     | 
| 
      
 344 
     | 
    
         
            +
                    b = GETARG_sBx(i);
         
     | 
| 
      
 345 
     | 
    
         
            +
                    if (getBMode(op) == OpArgR) {
         
     | 
| 
      
 346 
     | 
    
         
            +
                      int dest = pc+1+b;
         
     | 
| 
      
 347 
     | 
    
         
            +
                      check(0 <= dest && dest < pt->sizecode);
         
     | 
| 
      
 348 
     | 
    
         
            +
                      if (dest > 0) {
         
     | 
| 
      
 349 
     | 
    
         
            +
                        /* cannot jump to a setlist count */
         
     | 
| 
      
 350 
     | 
    
         
            +
                        Instruction d = pt->code[dest-1];
         
     | 
| 
      
 351 
     | 
    
         
            +
                        check(!(GET_OPCODE(d) == OP_SETLIST && GETARG_C(d) == 0));
         
     | 
| 
      
 352 
     | 
    
         
            +
                      }
         
     | 
| 
      
 353 
     | 
    
         
            +
                    }
         
     | 
| 
      
 354 
     | 
    
         
            +
                    break;
         
     | 
| 
      
 355 
     | 
    
         
            +
                  }
         
     | 
| 
      
 356 
     | 
    
         
            +
                }
         
     | 
| 
      
 357 
     | 
    
         
            +
                if (testAMode(op)) {
         
     | 
| 
      
 358 
     | 
    
         
            +
                  if (a == reg) last = pc;  /* change register `a' */
         
     | 
| 
      
 359 
     | 
    
         
            +
                }
         
     | 
| 
      
 360 
     | 
    
         
            +
                if (testTMode(op)) {
         
     | 
| 
      
 361 
     | 
    
         
            +
                  check(pc+2 < pt->sizecode);  /* check skip */
         
     | 
| 
      
 362 
     | 
    
         
            +
                  check(GET_OPCODE(pt->code[pc+1]) == OP_JMP);
         
     | 
| 
      
 363 
     | 
    
         
            +
                }
         
     | 
| 
      
 364 
     | 
    
         
            +
                switch (op) {
         
     | 
| 
      
 365 
     | 
    
         
            +
                  case OP_LOADBOOL: {
         
     | 
| 
      
 366 
     | 
    
         
            +
                    check(c == 0 || pc+2 < pt->sizecode);  /* check its jump */
         
     | 
| 
      
 367 
     | 
    
         
            +
                    break;
         
     | 
| 
      
 368 
     | 
    
         
            +
                  }
         
     | 
| 
      
 369 
     | 
    
         
            +
                  case OP_LOADNIL: {
         
     | 
| 
      
 370 
     | 
    
         
            +
                    if (a <= reg && reg <= b)
         
     | 
| 
      
 371 
     | 
    
         
            +
                      last = pc;  /* set registers from `a' to `b' */
         
     | 
| 
      
 372 
     | 
    
         
            +
                    break;
         
     | 
| 
      
 373 
     | 
    
         
            +
                  }
         
     | 
| 
      
 374 
     | 
    
         
            +
                  case OP_GETUPVAL:
         
     | 
| 
      
 375 
     | 
    
         
            +
                  case OP_SETUPVAL: {
         
     | 
| 
      
 376 
     | 
    
         
            +
                    check(b < pt->nups);
         
     | 
| 
      
 377 
     | 
    
         
            +
                    break;
         
     | 
| 
      
 378 
     | 
    
         
            +
                  }
         
     | 
| 
      
 379 
     | 
    
         
            +
                  case OP_GETGLOBAL:
         
     | 
| 
      
 380 
     | 
    
         
            +
                  case OP_SETGLOBAL: {
         
     | 
| 
      
 381 
     | 
    
         
            +
                    check(ttisstring(&pt->k[b]));
         
     | 
| 
      
 382 
     | 
    
         
            +
                    break;
         
     | 
| 
      
 383 
     | 
    
         
            +
                  }
         
     | 
| 
      
 384 
     | 
    
         
            +
                  case OP_SELF: {
         
     | 
| 
      
 385 
     | 
    
         
            +
                    checkreg(pt, a+1);
         
     | 
| 
      
 386 
     | 
    
         
            +
                    if (reg == a+1) last = pc;
         
     | 
| 
      
 387 
     | 
    
         
            +
                    break;
         
     | 
| 
      
 388 
     | 
    
         
            +
                  }
         
     | 
| 
      
 389 
     | 
    
         
            +
                  case OP_CONCAT: {
         
     | 
| 
      
 390 
     | 
    
         
            +
                    check(b < c);  /* at least two operands */
         
     | 
| 
      
 391 
     | 
    
         
            +
                    break;
         
     | 
| 
      
 392 
     | 
    
         
            +
                  }
         
     | 
| 
      
 393 
     | 
    
         
            +
                  case OP_TFORLOOP: {
         
     | 
| 
      
 394 
     | 
    
         
            +
                    check(c >= 1);  /* at least one result (control variable) */
         
     | 
| 
      
 395 
     | 
    
         
            +
                    checkreg(pt, a+2+c);  /* space for results */
         
     | 
| 
      
 396 
     | 
    
         
            +
                    if (reg >= a+2) last = pc;  /* affect all regs above its base */
         
     | 
| 
      
 397 
     | 
    
         
            +
                    break;
         
     | 
| 
      
 398 
     | 
    
         
            +
                  }
         
     | 
| 
      
 399 
     | 
    
         
            +
                  case OP_FORLOOP:
         
     | 
| 
      
 400 
     | 
    
         
            +
                  case OP_FORPREP:
         
     | 
| 
      
 401 
     | 
    
         
            +
                    checkreg(pt, a+3);
         
     | 
| 
      
 402 
     | 
    
         
            +
                    /* go through */
         
     | 
| 
      
 403 
     | 
    
         
            +
                  case OP_JMP: {
         
     | 
| 
      
 404 
     | 
    
         
            +
                    int dest = pc+1+b;
         
     | 
| 
      
 405 
     | 
    
         
            +
                    /* not full check and jump is forward and do not skip `lastpc'? */
         
     | 
| 
      
 406 
     | 
    
         
            +
                    if (reg != NO_REG && pc < dest && dest <= lastpc)
         
     | 
| 
      
 407 
     | 
    
         
            +
                      pc += b;  /* do the jump */
         
     | 
| 
      
 408 
     | 
    
         
            +
                    break;
         
     | 
| 
      
 409 
     | 
    
         
            +
                  }
         
     | 
| 
      
 410 
     | 
    
         
            +
                  case OP_CALL:
         
     | 
| 
      
 411 
     | 
    
         
            +
                  case OP_TAILCALL: {
         
     | 
| 
      
 412 
     | 
    
         
            +
                    if (b != 0) {
         
     | 
| 
      
 413 
     | 
    
         
            +
                      checkreg(pt, a+b-1);
         
     | 
| 
      
 414 
     | 
    
         
            +
                    }
         
     | 
| 
      
 415 
     | 
    
         
            +
                    c--;  /* c = num. returns */
         
     | 
| 
      
 416 
     | 
    
         
            +
                    if (c == LUA_MULTRET) {
         
     | 
| 
      
 417 
     | 
    
         
            +
                      check(checkopenop(pt, pc));
         
     | 
| 
      
 418 
     | 
    
         
            +
                    }
         
     | 
| 
      
 419 
     | 
    
         
            +
                    else if (c != 0)
         
     | 
| 
      
 420 
     | 
    
         
            +
                      checkreg(pt, a+c-1);
         
     | 
| 
      
 421 
     | 
    
         
            +
                    if (reg >= a) last = pc;  /* affect all registers above base */
         
     | 
| 
      
 422 
     | 
    
         
            +
                    break;
         
     | 
| 
      
 423 
     | 
    
         
            +
                  }
         
     | 
| 
      
 424 
     | 
    
         
            +
                  case OP_RETURN: {
         
     | 
| 
      
 425 
     | 
    
         
            +
                    b--;  /* b = num. returns */
         
     | 
| 
      
 426 
     | 
    
         
            +
                    if (b > 0) checkreg(pt, a+b-1);
         
     | 
| 
      
 427 
     | 
    
         
            +
                    break;
         
     | 
| 
      
 428 
     | 
    
         
            +
                  }
         
     | 
| 
      
 429 
     | 
    
         
            +
                  case OP_SETLIST: {
         
     | 
| 
      
 430 
     | 
    
         
            +
                    if (b > 0) checkreg(pt, a + b);
         
     | 
| 
      
 431 
     | 
    
         
            +
                    if (c == 0) pc++;
         
     | 
| 
      
 432 
     | 
    
         
            +
                    break;
         
     | 
| 
      
 433 
     | 
    
         
            +
                  }
         
     | 
| 
      
 434 
     | 
    
         
            +
                  case OP_CLOSURE: {
         
     | 
| 
      
 435 
     | 
    
         
            +
                    int nup, j;
         
     | 
| 
      
 436 
     | 
    
         
            +
                    check(b < pt->sizep);
         
     | 
| 
      
 437 
     | 
    
         
            +
                    nup = pt->p[b]->nups;
         
     | 
| 
      
 438 
     | 
    
         
            +
                    check(pc + nup < pt->sizecode);
         
     | 
| 
      
 439 
     | 
    
         
            +
                    for (j = 1; j <= nup; j++) {
         
     | 
| 
      
 440 
     | 
    
         
            +
                      OpCode op1 = GET_OPCODE(pt->code[pc + j]);
         
     | 
| 
      
 441 
     | 
    
         
            +
                      check(op1 == OP_GETUPVAL || op1 == OP_MOVE);
         
     | 
| 
      
 442 
     | 
    
         
            +
                    }
         
     | 
| 
      
 443 
     | 
    
         
            +
                    if (reg != NO_REG)  /* tracing? */
         
     | 
| 
      
 444 
     | 
    
         
            +
                      pc += nup;  /* do not 'execute' these pseudo-instructions */
         
     | 
| 
      
 445 
     | 
    
         
            +
                    break;
         
     | 
| 
      
 446 
     | 
    
         
            +
                  }
         
     | 
| 
      
 447 
     | 
    
         
            +
                  case OP_VARARG: {
         
     | 
| 
      
 448 
     | 
    
         
            +
                    check((pt->is_vararg & VARARG_ISVARARG) &&
         
     | 
| 
      
 449 
     | 
    
         
            +
                         !(pt->is_vararg & VARARG_NEEDSARG));
         
     | 
| 
      
 450 
     | 
    
         
            +
                    b--;
         
     | 
| 
      
 451 
     | 
    
         
            +
                    if (b == LUA_MULTRET) check(checkopenop(pt, pc));
         
     | 
| 
      
 452 
     | 
    
         
            +
                    checkreg(pt, a+b-1);
         
     | 
| 
      
 453 
     | 
    
         
            +
                    break;
         
     | 
| 
      
 454 
     | 
    
         
            +
                  }
         
     | 
| 
      
 455 
     | 
    
         
            +
                  default: break;
         
     | 
| 
      
 456 
     | 
    
         
            +
                }
         
     | 
| 
      
 457 
     | 
    
         
            +
              }
         
     | 
| 
      
 458 
     | 
    
         
            +
              return pt->code[last];
         
     | 
| 
      
 459 
     | 
    
         
            +
            }
         
     | 
| 
      
 460 
     | 
    
         
            +
             
     | 
| 
      
 461 
     | 
    
         
            +
            #undef check
         
     | 
| 
      
 462 
     | 
    
         
            +
            #undef checkjump
         
     | 
| 
      
 463 
     | 
    
         
            +
            #undef checkreg
         
     | 
| 
      
 464 
     | 
    
         
            +
             
     | 
| 
      
 465 
     | 
    
         
            +
            /* }====================================================== */
         
     | 
| 
      
 466 
     | 
    
         
            +
             
     | 
| 
      
 467 
     | 
    
         
            +
             
     | 
| 
      
 468 
     | 
    
         
            +
            int luaG_checkcode (const Proto *pt) {
         
     | 
| 
      
 469 
     | 
    
         
            +
              return (symbexec(pt, pt->sizecode, NO_REG) != 0);
         
     | 
| 
      
 470 
     | 
    
         
            +
            }
         
     | 
| 
      
 471 
     | 
    
         
            +
             
     | 
| 
      
 472 
     | 
    
         
            +
             
     | 
| 
      
 473 
     | 
    
         
            +
            static const char *kname (Proto *p, int c) {
         
     | 
| 
      
 474 
     | 
    
         
            +
              if (ISK(c) && ttisstring(&p->k[INDEXK(c)]))
         
     | 
| 
      
 475 
     | 
    
         
            +
                return svalue(&p->k[INDEXK(c)]);
         
     | 
| 
      
 476 
     | 
    
         
            +
              else
         
     | 
| 
      
 477 
     | 
    
         
            +
                return "?";
         
     | 
| 
      
 478 
     | 
    
         
            +
            }
         
     | 
| 
      
 479 
     | 
    
         
            +
             
     | 
| 
      
 480 
     | 
    
         
            +
             
     | 
| 
      
 481 
     | 
    
         
            +
            static const char *getobjname (lua_State *L, CallInfo *ci, int stackpos,
         
     | 
| 
      
 482 
     | 
    
         
            +
                                           const char **name) {
         
     | 
| 
      
 483 
     | 
    
         
            +
              if (isLua(ci)) {  /* a Lua function? */
         
     | 
| 
      
 484 
     | 
    
         
            +
                Proto *p = ci_func(ci)->l.p;
         
     | 
| 
      
 485 
     | 
    
         
            +
                int pc = currentpc(L, ci);
         
     | 
| 
      
 486 
     | 
    
         
            +
                Instruction i;
         
     | 
| 
      
 487 
     | 
    
         
            +
                *name = luaF_getlocalname(p, stackpos+1, pc);
         
     | 
| 
      
 488 
     | 
    
         
            +
                if (*name)  /* is a local? */
         
     | 
| 
      
 489 
     | 
    
         
            +
                  return "local";
         
     | 
| 
      
 490 
     | 
    
         
            +
                i = symbexec(p, pc, stackpos);  /* try symbolic execution */
         
     | 
| 
      
 491 
     | 
    
         
            +
                lua_assert(pc != -1);
         
     | 
| 
      
 492 
     | 
    
         
            +
                switch (GET_OPCODE(i)) {
         
     | 
| 
      
 493 
     | 
    
         
            +
                  case OP_GETGLOBAL: {
         
     | 
| 
      
 494 
     | 
    
         
            +
                    int g = GETARG_Bx(i);  /* global index */
         
     | 
| 
      
 495 
     | 
    
         
            +
                    lua_assert(ttisstring(&p->k[g]));
         
     | 
| 
      
 496 
     | 
    
         
            +
                    *name = svalue(&p->k[g]);
         
     | 
| 
      
 497 
     | 
    
         
            +
                    return "global";
         
     | 
| 
      
 498 
     | 
    
         
            +
                  }
         
     | 
| 
      
 499 
     | 
    
         
            +
                  case OP_MOVE: {
         
     | 
| 
      
 500 
     | 
    
         
            +
                    int a = GETARG_A(i);
         
     | 
| 
      
 501 
     | 
    
         
            +
                    int b = GETARG_B(i);  /* move from `b' to `a' */
         
     | 
| 
      
 502 
     | 
    
         
            +
                    if (b < a)
         
     | 
| 
      
 503 
     | 
    
         
            +
                      return getobjname(L, ci, b, name);  /* get name for `b' */
         
     | 
| 
      
 504 
     | 
    
         
            +
                    break;
         
     | 
| 
      
 505 
     | 
    
         
            +
                  }
         
     | 
| 
      
 506 
     | 
    
         
            +
                  case OP_GETTABLE: {
         
     | 
| 
      
 507 
     | 
    
         
            +
                    int k = GETARG_C(i);  /* key index */
         
     | 
| 
      
 508 
     | 
    
         
            +
                    *name = kname(p, k);
         
     | 
| 
      
 509 
     | 
    
         
            +
                    return "field";
         
     | 
| 
      
 510 
     | 
    
         
            +
                  }
         
     | 
| 
      
 511 
     | 
    
         
            +
                  case OP_GETUPVAL: {
         
     | 
| 
      
 512 
     | 
    
         
            +
                    int u = GETARG_B(i);  /* upvalue index */
         
     | 
| 
      
 513 
     | 
    
         
            +
                    *name = p->upvalues ? getstr(p->upvalues[u]) : "?";
         
     | 
| 
      
 514 
     | 
    
         
            +
                    return "upvalue";
         
     | 
| 
      
 515 
     | 
    
         
            +
                  }
         
     | 
| 
      
 516 
     | 
    
         
            +
                  case OP_SELF: {
         
     | 
| 
      
 517 
     | 
    
         
            +
                    int k = GETARG_C(i);  /* key index */
         
     | 
| 
      
 518 
     | 
    
         
            +
                    *name = kname(p, k);
         
     | 
| 
      
 519 
     | 
    
         
            +
                    return "method";
         
     | 
| 
      
 520 
     | 
    
         
            +
                  }
         
     | 
| 
      
 521 
     | 
    
         
            +
                  default: break;
         
     | 
| 
      
 522 
     | 
    
         
            +
                }
         
     | 
| 
      
 523 
     | 
    
         
            +
              }
         
     | 
| 
      
 524 
     | 
    
         
            +
              return NULL;  /* no useful name found */
         
     | 
| 
      
 525 
     | 
    
         
            +
            }
         
     | 
| 
      
 526 
     | 
    
         
            +
             
     | 
| 
      
 527 
     | 
    
         
            +
             
     | 
| 
      
 528 
     | 
    
         
            +
            static const char *getfuncname (lua_State *L, CallInfo *ci, const char **name) {
         
     | 
| 
      
 529 
     | 
    
         
            +
              Instruction i;
         
     | 
| 
      
 530 
     | 
    
         
            +
              if ((isLua(ci) && ci->tailcalls > 0) || !isLua(ci - 1))
         
     | 
| 
      
 531 
     | 
    
         
            +
                return NULL;  /* calling function is not Lua (or is unknown) */
         
     | 
| 
      
 532 
     | 
    
         
            +
              ci--;  /* calling function */
         
     | 
| 
      
 533 
     | 
    
         
            +
              i = ci_func(ci)->l.p->code[currentpc(L, ci)];
         
     | 
| 
      
 534 
     | 
    
         
            +
              if (GET_OPCODE(i) == OP_CALL || GET_OPCODE(i) == OP_TAILCALL ||
         
     | 
| 
      
 535 
     | 
    
         
            +
                  GET_OPCODE(i) == OP_TFORLOOP)
         
     | 
| 
      
 536 
     | 
    
         
            +
                return getobjname(L, ci, GETARG_A(i), name);
         
     | 
| 
      
 537 
     | 
    
         
            +
              else
         
     | 
| 
      
 538 
     | 
    
         
            +
                return NULL;  /* no useful name can be found */
         
     | 
| 
      
 539 
     | 
    
         
            +
            }
         
     | 
| 
      
 540 
     | 
    
         
            +
             
     | 
| 
      
 541 
     | 
    
         
            +
             
     | 
| 
      
 542 
     | 
    
         
            +
            /* only ANSI way to check whether a pointer points to an array */
         
     | 
| 
      
 543 
     | 
    
         
            +
            static int isinstack (CallInfo *ci, const TValue *o) {
         
     | 
| 
      
 544 
     | 
    
         
            +
              StkId p;
         
     | 
| 
      
 545 
     | 
    
         
            +
              for (p = ci->base; p < ci->top; p++)
         
     | 
| 
      
 546 
     | 
    
         
            +
                if (o == p) return 1;
         
     | 
| 
      
 547 
     | 
    
         
            +
              return 0;
         
     | 
| 
      
 548 
     | 
    
         
            +
            }
         
     | 
| 
      
 549 
     | 
    
         
            +
             
     | 
| 
      
 550 
     | 
    
         
            +
             
     | 
| 
      
 551 
     | 
    
         
            +
            void luaG_typeerror (lua_State *L, const TValue *o, const char *op) {
         
     | 
| 
      
 552 
     | 
    
         
            +
              const char *name = NULL;
         
     | 
| 
      
 553 
     | 
    
         
            +
              const char *t = luaT_typenames[ttype(o)];
         
     | 
| 
      
 554 
     | 
    
         
            +
              const char *kind = (isinstack(L->ci, o)) ?
         
     | 
| 
      
 555 
     | 
    
         
            +
                                     getobjname(L, L->ci, cast_int(o - L->base), &name) :
         
     | 
| 
      
 556 
     | 
    
         
            +
                                     NULL;
         
     | 
| 
      
 557 
     | 
    
         
            +
              if (kind)
         
     | 
| 
      
 558 
     | 
    
         
            +
                luaG_runerror(L, "attempt to %s %s " LUA_QS " (a %s value)",
         
     | 
| 
      
 559 
     | 
    
         
            +
                            op, kind, name, t);
         
     | 
| 
      
 560 
     | 
    
         
            +
              else
         
     | 
| 
      
 561 
     | 
    
         
            +
                luaG_runerror(L, "attempt to %s a %s value", op, t);
         
     | 
| 
      
 562 
     | 
    
         
            +
            }
         
     | 
| 
      
 563 
     | 
    
         
            +
             
     | 
| 
      
 564 
     | 
    
         
            +
             
     | 
| 
      
 565 
     | 
    
         
            +
            void luaG_concaterror (lua_State *L, StkId p1, StkId p2) {
         
     | 
| 
      
 566 
     | 
    
         
            +
              if (ttisstring(p1)) p1 = p2;
         
     | 
| 
      
 567 
     | 
    
         
            +
              lua_assert(!ttisstring(p1));
         
     | 
| 
      
 568 
     | 
    
         
            +
              luaG_typeerror(L, p1, "concatenate");
         
     | 
| 
      
 569 
     | 
    
         
            +
            }
         
     | 
| 
      
 570 
     | 
    
         
            +
             
     | 
| 
      
 571 
     | 
    
         
            +
             
     | 
| 
      
 572 
     | 
    
         
            +
            void luaG_aritherror (lua_State *L, const TValue *p1, const TValue *p2) {
         
     | 
| 
      
 573 
     | 
    
         
            +
              TValue temp;
         
     | 
| 
      
 574 
     | 
    
         
            +
              if (luaV_tonumber(p1, &temp) == NULL)
         
     | 
| 
      
 575 
     | 
    
         
            +
                p2 = p1;  /* first operand is wrong */
         
     | 
| 
      
 576 
     | 
    
         
            +
              luaG_typeerror(L, p2, "perform arithmetic on");
         
     | 
| 
      
 577 
     | 
    
         
            +
            }
         
     | 
| 
      
 578 
     | 
    
         
            +
             
     | 
| 
      
 579 
     | 
    
         
            +
             
     | 
| 
      
 580 
     | 
    
         
            +
            int luaG_ordererror (lua_State *L, const TValue *p1, const TValue *p2) {
         
     | 
| 
      
 581 
     | 
    
         
            +
              const char *t1 = luaT_typenames[ttype(p1)];
         
     | 
| 
      
 582 
     | 
    
         
            +
              const char *t2 = luaT_typenames[ttype(p2)];
         
     | 
| 
      
 583 
     | 
    
         
            +
              if (t1[2] == t2[2])
         
     | 
| 
      
 584 
     | 
    
         
            +
                luaG_runerror(L, "attempt to compare two %s values", t1);
         
     | 
| 
      
 585 
     | 
    
         
            +
              else
         
     | 
| 
      
 586 
     | 
    
         
            +
                luaG_runerror(L, "attempt to compare %s with %s", t1, t2);
         
     | 
| 
      
 587 
     | 
    
         
            +
              return 0;
         
     | 
| 
      
 588 
     | 
    
         
            +
            }
         
     | 
| 
      
 589 
     | 
    
         
            +
             
     | 
| 
      
 590 
     | 
    
         
            +
             
     | 
| 
      
 591 
     | 
    
         
            +
            static void addinfo (lua_State *L, const char *msg) {
         
     | 
| 
      
 592 
     | 
    
         
            +
              CallInfo *ci = L->ci;
         
     | 
| 
      
 593 
     | 
    
         
            +
              if (isLua(ci)) {  /* is Lua code? */
         
     | 
| 
      
 594 
     | 
    
         
            +
                char buff[LUA_IDSIZE];  /* add file:line information */
         
     | 
| 
      
 595 
     | 
    
         
            +
                int line = currentline(L, ci);
         
     | 
| 
      
 596 
     | 
    
         
            +
                luaO_chunkid(buff, getstr(getluaproto(ci)->source), LUA_IDSIZE);
         
     | 
| 
      
 597 
     | 
    
         
            +
                luaO_pushfstring(L, "%s:%d: %s", buff, line, msg);
         
     | 
| 
      
 598 
     | 
    
         
            +
              }
         
     | 
| 
      
 599 
     | 
    
         
            +
            }
         
     | 
| 
      
 600 
     | 
    
         
            +
             
     | 
| 
      
 601 
     | 
    
         
            +
             
     | 
| 
      
 602 
     | 
    
         
            +
            void luaG_errormsg (lua_State *L) {
         
     | 
| 
      
 603 
     | 
    
         
            +
              if (L->errfunc != 0) {  /* is there an error handling function? */
         
     | 
| 
      
 604 
     | 
    
         
            +
                StkId errfunc = restorestack(L, L->errfunc);
         
     | 
| 
      
 605 
     | 
    
         
            +
                if (!ttisfunction(errfunc)) luaD_throw(L, LUA_ERRERR);
         
     | 
| 
      
 606 
     | 
    
         
            +
                setobjs2s(L, L->top, L->top - 1);  /* move argument */
         
     | 
| 
      
 607 
     | 
    
         
            +
                setobjs2s(L, L->top - 1, errfunc);  /* push function */
         
     | 
| 
      
 608 
     | 
    
         
            +
                incr_top(L);
         
     | 
| 
      
 609 
     | 
    
         
            +
                luaD_call(L, L->top - 2, 1);  /* call it */
         
     | 
| 
      
 610 
     | 
    
         
            +
              }
         
     | 
| 
      
 611 
     | 
    
         
            +
              luaD_throw(L, LUA_ERRRUN);
         
     | 
| 
      
 612 
     | 
    
         
            +
            }
         
     | 
| 
      
 613 
     | 
    
         
            +
             
     | 
| 
      
 614 
     | 
    
         
            +
             
     | 
| 
      
 615 
     | 
    
         
            +
            void luaG_runerror (lua_State *L, const char *fmt, ...) {
         
     | 
| 
      
 616 
     | 
    
         
            +
              va_list argp;
         
     | 
| 
      
 617 
     | 
    
         
            +
              va_start(argp, fmt);
         
     | 
| 
      
 618 
     | 
    
         
            +
              addinfo(L, luaO_pushvfstring(L, fmt, argp));
         
     | 
| 
      
 619 
     | 
    
         
            +
              va_end(argp);
         
     | 
| 
      
 620 
     | 
    
         
            +
              luaG_errormsg(L);
         
     | 
| 
      
 621 
     | 
    
         
            +
            }
         
     | 
| 
      
 622 
     | 
    
         
            +
             
     | 
| 
         @@ -0,0 +1,33 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            /*
         
     | 
| 
      
 2 
     | 
    
         
            +
            ** $Id: ldebug.h,v 2.3 2005/04/25 19:24:10 roberto Exp $
         
     | 
| 
      
 3 
     | 
    
         
            +
            ** Auxiliary functions from Debug Interface module
         
     | 
| 
      
 4 
     | 
    
         
            +
            ** See Copyright Notice in lua.h
         
     | 
| 
      
 5 
     | 
    
         
            +
            */
         
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
      
 7 
     | 
    
         
            +
            #ifndef ldebug_h
         
     | 
| 
      
 8 
     | 
    
         
            +
            #define ldebug_h
         
     | 
| 
      
 9 
     | 
    
         
            +
             
     | 
| 
      
 10 
     | 
    
         
            +
             
     | 
| 
      
 11 
     | 
    
         
            +
            #include "lstate.h"
         
     | 
| 
      
 12 
     | 
    
         
            +
             
     | 
| 
      
 13 
     | 
    
         
            +
             
     | 
| 
      
 14 
     | 
    
         
            +
            #define pcRel(pc, p)	(cast(int, (pc) - (p)->code) - 1)
         
     | 
| 
      
 15 
     | 
    
         
            +
             
     | 
| 
      
 16 
     | 
    
         
            +
            #define getline(f,pc)	(((f)->lineinfo) ? (f)->lineinfo[pc] : 0)
         
     | 
| 
      
 17 
     | 
    
         
            +
             
     | 
| 
      
 18 
     | 
    
         
            +
            #define resethookcount(L)	(L->hookcount = L->basehookcount)
         
     | 
| 
      
 19 
     | 
    
         
            +
             
     | 
| 
      
 20 
     | 
    
         
            +
             
     | 
| 
      
 21 
     | 
    
         
            +
            LUAI_FUNC void luaG_typeerror (lua_State *L, const TValue *o,
         
     | 
| 
      
 22 
     | 
    
         
            +
                                                         const char *opname);
         
     | 
| 
      
 23 
     | 
    
         
            +
            LUAI_FUNC void luaG_concaterror (lua_State *L, StkId p1, StkId p2);
         
     | 
| 
      
 24 
     | 
    
         
            +
            LUAI_FUNC void luaG_aritherror (lua_State *L, const TValue *p1,
         
     | 
| 
      
 25 
     | 
    
         
            +
                                                          const TValue *p2);
         
     | 
| 
      
 26 
     | 
    
         
            +
            LUAI_FUNC int luaG_ordererror (lua_State *L, const TValue *p1,
         
     | 
| 
      
 27 
     | 
    
         
            +
                                                         const TValue *p2);
         
     | 
| 
      
 28 
     | 
    
         
            +
            LUAI_FUNC void luaG_runerror (lua_State *L, const char *fmt, ...);
         
     | 
| 
      
 29 
     | 
    
         
            +
            LUAI_FUNC void luaG_errormsg (lua_State *L);
         
     | 
| 
      
 30 
     | 
    
         
            +
            LUAI_FUNC int luaG_checkcode (const Proto *pt);
         
     | 
| 
      
 31 
     | 
    
         
            +
            LUAI_FUNC int luaG_checkopenop (Instruction i);
         
     | 
| 
      
 32 
     | 
    
         
            +
             
     | 
| 
      
 33 
     | 
    
         
            +
            #endif
         
     |