Changeset 2229 for code/branches/buildsystem/src/tolua/lua/feature.lua
- Timestamp:
- Nov 19, 2008, 4:40:43 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/buildsystem/src/tolua/lua/feature.lua
r1755 r2229 40 40 -- check if it requires collection 41 41 function classFeature:requirecollection (t) 42 return false42 return false 43 43 end 44 44 45 45 -- build names 46 46 function classFeature:buildnames () 47 if self.name and self.name~='' then48 local n = split(self.name,'@')49 self.name = n[1]50 if not n[2] then51 n[2] = applyrenaming(n[1])52 end53 self.lname = n[2] or gsub(n[1],"%[.-%]","")54 self.original_name = self.name55 self.lname = clean_template(self.lname)56 end57 if not self.is_parameter then58 59 end47 if self.name and self.name~='' then 48 local n = split(self.name,'@') 49 self.name = n[1] 50 if not n[2] then 51 n[2] = applyrenaming(n[1]) 52 end 53 self.lname = n[2] or gsub(n[1],"%[.-%]","") 54 self.original_name = self.name 55 self.lname = clean_template(self.lname) 56 end 57 if not self.is_parameter then 58 self.name = getonlynamespace() .. self.name 59 end 60 60 61 local parent = classContainer.curr62 if parent then63 64 else65 end61 local parent = classContainer.curr 62 if parent then 63 self.access = parent.curr_member_access 64 else 65 end 66 66 end 67 67 68 68 function classFeature:check_public_access() 69 69 70 71 72 70 if self.access and self.access ~= 0 then 71 return false 72 end 73 73 74 75 76 77 78 79 80 81 74 local parent = classContainer.curr 75 while parent do 76 if parent.access and parent.access ~= 0 then 77 return false 78 end 79 parent = parent.prox 80 end 81 return true 82 82 end 83 83 84 84 function clean_template(t) 85 85 86 86 return string.gsub(t, "[<>:, %*]", "_") 87 87 end 88 88 … … 90 90 -- it returns the container class name or nil. 91 91 function classFeature:incontainer (which) 92 if self.parent then93 local parent = self.parent94 while parent do95 if parent.classtype == which then96 return parent.name97 end98 parent = parent.parent99 end100 end101 return nil92 if self.parent then 93 local parent = self.parent 94 while parent do 95 if parent.classtype == which then 96 return parent.name 97 end 98 parent = parent.parent 99 end 100 end 101 return nil 102 102 end 103 103 104 104 function classFeature:inclass () 105 return self:incontainer('class')105 return self:incontainer('class') 106 106 end 107 107 108 108 function classFeature:inmodule () 109 return self:incontainer('module')109 return self:incontainer('module') 110 110 end 111 111 112 112 function classFeature:innamespace () 113 return self:incontainer('namespace')113 return self:incontainer('namespace') 114 114 end 115 115 … … 118 118 function classFeature:cfuncname (n) 119 119 120 if self.parent then121 n = self.parent:cfuncname(n)122 end120 if self.parent then 121 n = self.parent:cfuncname(n) 122 end 123 123 124 n = string.gsub(n..'_'.. (self.lname or self.name), "[<>:, \.%*&]", "_")124 n = string.gsub(n..'_'.. (self.lname or self.name), "[<>:, \.%*&]", "_") 125 125 126 return n126 return n 127 127 end 128 128
Note: See TracChangeset
for help on using the changeset viewer.