Changeset 3127 for code/branches/pch/src/tolua/lua/container.lua
- Timestamp:
- Jun 9, 2009, 4:29:42 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/pch/src/tolua/lua/container.lua
r2710 r3127 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 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 617 624 if b then 618 625 if virt and string.find(virt, "[=0]") then … … 647 654 base = '' body = '' 648 655 b,e,name = strfind(s,"^%s*class%s*([_%w][_%w@]*)%s*;") -- dummy class 656 local dummy = false 649 657 if not b then 650 658 b,e,name = strfind(s,"^%s*struct%s*([_%w][_%w@]*)%s*;") -- dummy struct 651 659 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*") 653 661 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*") 655 663 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*") 657 665 if not b then 658 666 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*;") 660 668 end 661 669 end 662 670 end 663 e nd664 e nd671 else dummy = 1 end 672 else dummy = 1 end 665 673 if b then 666 674 if base ~= '' then … … 675 683 _curr_code = strsub(s,b,e) 676 684 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 677 692 return strsub(s,e+1) 678 693 end … … 723 738 -- try array 724 739 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*") 726 741 if b then 727 742 _curr_code = strsub(s,b,e) … … 743 758 function classContainer:parse (s) 744 759 745 self.curr_member_access = nil760 --self.curr_member_access = nil 746 761 747 762 while s ~= '' do
Note: See TracChangeset
for help on using the changeset viewer.