Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 9, 2009, 4:29:42 PM (16 years ago)
Author:
rgrieder
Message:

Update to tolua 1.0.93

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/pch/src/tolua/lua/container.lua

    r2710 r3127  
    615615            b,e,decl,arg,const = strfind(s,"^%s*([_%w])%s*(%b())%s*(c?o?n?s?t?)%s*;%s*")
    616616        end
     617        if not b then
     618            -- try function pointer
     619            b,e,decl,arg,const = strfind(s,"^%s*([^%(;\n]+%b())%s*(%b())%s*;%s*")
     620            if b then
     621                decl = string.gsub(decl, "%(%s*%*([^%)]*)%s*%)", " %1 ")
     622            end
     623        end
    617624        if b then
    618625            if virt and string.find(virt, "[=0]") then
     
    647654        base = '' body = ''
    648655        b,e,name = strfind(s,"^%s*class%s*([_%w][_%w@]*)%s*;")  -- dummy class
     656        local dummy = false
    649657        if not b then
    650658            b,e,name = strfind(s,"^%s*struct%s*([_%w][_%w@]*)%s*;")    -- dummy struct
    651659            if not b then
    652                 b,e,name,base,body = strfind(s,"^%s*class%s*([_%w][_%w@]*)%s*(.-)%s*(%b{})%s*;%s*")
     660                b,e,name,base,body = strfind(s,"^%s*class%s*([_%w][_%w@]*)%s*([^{]-)%s*(%b{})%s*")
    653661                if not b then
    654                     b,e,name,base,body = strfind(s,"^%s*struct%s*([_%w][_%w@]*)%s*(.-)%s*(%b{})%s*;%s*")
     662                    b,e,name,base,body = strfind(s,"^%s*struct%s+([_%w][_%w@]*)%s*([^{]-)%s*(%b{})%s*")
    655663                    if not b then
    656                         b,e,name,base,body = strfind(s,"^%s*union%s*([_%w][_%w@]*)%s*(.-)%s*(%b{})%s*;%s*")
     664                        b,e,name,base,body = strfind(s,"^%s*union%s*([_%w][_%w@]*)%s*([^{]-)%s*(%b{})%s*")
    657665                        if not b then
    658666                            base = ''
    659                             b,e,body,name = strfind(s,"^%s*typedef%s%s*struct%s%s*[_%w]*%s*(%b{})%s*([_%w][_%w@]*)%s*;%s*")
     667                            b,e,body,name = strfind(s,"^%s*typedef%s%s*struct%s%s*[_%w]*%s*(%b{})%s*([_%w][_%w@]*)%s*;")
    660668                        end
    661669                    end
    662670                end
    663             end
    664         end
     671            else dummy = 1 end
     672        else dummy = 1 end
    665673        if b then
    666674            if base ~= '' then
     
    675683            _curr_code = strsub(s,b,e)
    676684            Class(name,base,body)
     685            if not dummy then
     686                varb,vare,varname = string.find(s, "^%s*([_%w]+)%s*;", e+1)
     687                if varb then
     688                    Variable(name.." "..varname)
     689                    e = vare
     690                end
     691            end
    677692            return strsub(s,e+1)
    678693        end
     
    723738    -- try array
    724739    do
    725         local b,e,decl = strfind(s,"^%s*([_%w][][_@%s%w%d%*&:]*[]_%w%d])%s*;%s*")
     740    local b,e,decl = strfind(s,"^%s*([_%w][][_@%s%w%d%*&:<>]*[]_%w%d])%s*;%s*")
    726741        if b then
    727742            _curr_code = strsub(s,b,e)
     
    743758function classContainer:parse (s)
    744759
    745     self.curr_member_access = nil
     760    --self.curr_member_access = nil
    746761
    747762    while s ~= '' do
Note: See TracChangeset for help on using the changeset viewer.