Changeset 2509 for code/branches/buildsystem2/src/tolua/lua/namespace.lua
- Timestamp:
- Dec 17, 2008, 8:59:48 PM (16 years ago)
- Location:
- code/branches/buildsystem2
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/buildsystem2
- Property svn:ignore deleted
- Property svn:mergeinfo changed
/code/branches/buildsystem (added) merged: 1875,1882-1886,1975-1982,1991,1999,2054,2061,2135,2137-2139,2197-2199,2204,2214-2220,2223-2224,2229,2233-2244,2248-2249,2252-2253,2260,2275
-
code/branches/buildsystem2/src/tolua/lua/namespace.lua
r2087 r2509 17 17 -- {i} = list of members 18 18 classNamespace = { 19 classtype = 'namespace',20 name = '',19 classtype = 'namespace', 20 name = '', 21 21 } 22 22 classNamespace.__index = classNamespace … … 25 25 -- Print method 26 26 function classNamespace:print (ident,close) 27 print(ident.."Namespace{")28 print(ident.." name = '"..self.name.."',")29 local i=130 while self[i] do31 self[i]:print(ident.." ",",")32 i = i+133 end34 print(ident.."}"..close)27 print(ident.."Namespace{") 28 print(ident.." name = '"..self.name.."',") 29 local i=1 30 while self[i] do 31 self[i]:print(ident.." ",",") 32 i = i+1 33 end 34 print(ident.."}"..close) 35 35 end 36 36 37 37 -- Internal constructor 38 38 function _Namespace (t) 39 setmetatable(t,classNamespace)40 append(t)41 return t39 setmetatable(t,classNamespace) 40 append(t) 41 return t 42 42 end 43 43 … … 45 45 -- Expects the name and the body of the namespace. 46 46 function Namespace (n,b) 47 local c = _Namespace(_Container{name=n})48 push(c)49 c:parse(strsub(b,2,strlen(b)-1)) -- eliminate braces50 pop()47 local c = _Namespace(_Container{name=n}) 48 push(c) 49 c:parse(strsub(b,2,strlen(b)-1)) -- eliminate braces 50 pop() 51 51 end 52 52
Note: See TracChangeset
for help on using the changeset viewer.