Changeset 3138 for code/branches/pch/src/tolua/lua/container.lua
- Timestamp:
- Jun 10, 2009, 4:01:42 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/pch/src/tolua/lua/container.lua
r3127 r3138 615 615 b,e,decl,arg,const = strfind(s,"^%s*([_%w])%s*(%b())%s*(c?o?n?s?t?)%s*;%s*") 616 616 end 617 if not b then618 -- try function pointer619 b,e,decl,arg,const = strfind(s,"^%s*([^%(;\n]+%b())%s*(%b())%s*;%s*")620 if b then621 decl = string.gsub(decl, "%(%s*%*([^%)]*)%s*%)", " %1 ")622 end623 end624 617 if b then 625 618 if virt and string.find(virt, "[=0]") then … … 654 647 base = '' body = '' 655 648 b,e,name = strfind(s,"^%s*class%s*([_%w][_%w@]*)%s*;") -- dummy class 656 local dummy = false657 649 if not b then 658 650 b,e,name = strfind(s,"^%s*struct%s*([_%w][_%w@]*)%s*;") -- dummy struct 659 651 if not b then 660 b,e,name,base,body = strfind(s,"^%s*class%s*([_%w][_%w@]*)%s*( [^{]-)%s*(%b{})%s*")652 b,e,name,base,body = strfind(s,"^%s*class%s*([_%w][_%w@]*)%s*(.-)%s*(%b{})%s*;%s*") 661 653 if not b then 662 b,e,name,base,body = strfind(s,"^%s*struct%s +([_%w][_%w@]*)%s*([^{]-)%s*(%b{})%s*")654 b,e,name,base,body = strfind(s,"^%s*struct%s*([_%w][_%w@]*)%s*(.-)%s*(%b{})%s*;%s*") 663 655 if not b then 664 b,e,name,base,body = strfind(s,"^%s*union%s*([_%w][_%w@]*)%s*( [^{]-)%s*(%b{})%s*")656 b,e,name,base,body = strfind(s,"^%s*union%s*([_%w][_%w@]*)%s*(.-)%s*(%b{})%s*;%s*") 665 657 if not b then 666 658 base = '' 667 b,e,body,name = strfind(s,"^%s*typedef%s%s*struct%s%s*[_%w]*%s*(%b{})%s*([_%w][_%w@]*)%s*; ")659 b,e,body,name = strfind(s,"^%s*typedef%s%s*struct%s%s*[_%w]*%s*(%b{})%s*([_%w][_%w@]*)%s*;%s*") 668 660 end 669 661 end 670 662 end 671 e lse dummy = 1 end672 e lse dummy = 1 end663 end 664 end 673 665 if b then 674 666 if base ~= '' then … … 683 675 _curr_code = strsub(s,b,e) 684 676 Class(name,base,body) 685 if not dummy then686 varb,vare,varname = string.find(s, "^%s*([_%w]+)%s*;", e+1)687 if varb then688 Variable(name.." "..varname)689 e = vare690 end691 end692 677 return strsub(s,e+1) 693 678 end … … 738 723 -- try array 739 724 do 740 local b,e,decl = strfind(s,"^%s*([_%w][][_@%s%w%d%*&:<>]*[]_%w%d])%s*;%s*")725 local b,e,decl = strfind(s,"^%s*([_%w][][_@%s%w%d%*&:]*[]_%w%d])%s*;%s*") 741 726 if b then 742 727 _curr_code = strsub(s,b,e) … … 758 743 function classContainer:parse (s) 759 744 760 --self.curr_member_access = nil745 self.curr_member_access = nil 761 746 762 747 while s ~= '' do
Note: See TracChangeset
for help on using the changeset viewer.