From: John L. <jr...@us...> - 2008-10-30 04:14:32
|
Update of /cvsroot/wxlua/wxLua/bindings In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv31959/wxLua/bindings Modified Files: genwxbind.lua Log Message: Add op_preinc and op_predec for ++/--obj. Make op_inc/dec be for the post inc/dec operator; obj++/-- Index: genwxbind.lua =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/genwxbind.lua,v retrieving revision 1.174 retrieving revision 1.175 diff -C2 -d -r1.174 -r1.175 *** genwxbind.lua 29 Oct 2008 04:44:32 -0000 1.174 --- genwxbind.lua 30 Oct 2008 04:14:25 -0000 1.175 *************** *** 1123,1128 **** bindingOperatorTable["[]"] = "op_index" ! bindingOperatorTable["++"] = "op_inc" ! bindingOperatorTable["--"] = "op_dec" bindingOperatorTable["~"] = "op_comp" -- bitwise one's compliment --bindingOperatorTable["-"] = "op_neg" -- also op_sub if not unary - --- 1123,1128 ---- bindingOperatorTable["[]"] = "op_index" ! bindingOperatorTable["++"] = "op_inc" -- or op_preinc ! bindingOperatorTable["--"] = "op_dec" -- or op_predec bindingOperatorTable["~"] = "op_comp" -- bitwise one's compliment --bindingOperatorTable["-"] = "op_neg" -- also op_sub if not unary - *************** *** 3216,3219 **** --- 3216,3228 ---- local arg = 0 + + if (member["%operator"] == "++") and (#member.Params > 0) then + member.Name = "op_preinc" + member.Params = {} + elseif (member["%operator"] == "--") and (#member.Params > 0) then + member.Name = "op_predec" + member.Params = {} + end + while member.Params[arg+1] do arg = arg + 1 *************** *** 3755,3759 **** if member["%operator"] then ! if member["%operator"] == "[]" then -- op_index functor = "(*self)[" elseif member["%operator"] == "()" then -- op_func --- 3764,3772 ---- if member["%operator"] then ! if (member.Name == "op_preinc") or (member.Name == "op_predec") then ! functor = member["%operator"].."(*self)" ! elseif (member.Name == "op_inc") or (member.Name == "op_dec") then ! functor = "(*self)"..member["%operator"] ! elseif member["%operator"] == "[]" then -- op_index functor = "(*self)[" elseif member["%operator"] == "()" then -- op_func *************** *** 3802,3806 **** elseif member["%operator"] and string.find(origMemberPtr or "", "&", 1, 1) and (string.find(member["%operator"], "=", 1, 1) == nil) then if string.find(memberTypeWithAttrib or "", "*", 1, 1) then ! table.insert(codeList, " "..memberTypeWithAttrib.." returns = &"..functor..";\n") else table.insert(codeList, " "..memberTypeWithAttrib.." returns = "..functor..";\n") --- 3815,3819 ---- elseif member["%operator"] and string.find(origMemberPtr or "", "&", 1, 1) and (string.find(member["%operator"], "=", 1, 1) == nil) then if string.find(memberTypeWithAttrib or "", "*", 1, 1) then ! table.insert(codeList, " "..memberTypeWithAttrib.." returns = &("..functor..");\n") else table.insert(codeList, " "..memberTypeWithAttrib.." returns = "..functor..";\n") |