From 12a1078727d224a007aa4d6dfd9c7958750fa444 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sun, 9 Oct 2022 15:54:10 +0300 Subject: [PATCH 45/45] Clear trailing spaces from tolua .lua files See osdn #45749 Signed-off-by: Marko Lindqvist --- dependencies/tolua-5.2/Version.txt | 4 +- dependencies/tolua-5.2/src/bin/lua/array.lua | 8 +-- dependencies/tolua-5.2/src/bin/lua/basic.lua | 18 +++---- dependencies/tolua-5.2/src/bin/lua/class.lua | 2 +- dependencies/tolua-5.2/src/bin/lua/clean.lua | 6 +-- dependencies/tolua-5.2/src/bin/lua/code.lua | 16 +++--- dependencies/tolua-5.2/src/bin/lua/compat.lua | 2 +- .../tolua-5.2/src/bin/lua/container.lua | 52 +++++++++---------- .../tolua-5.2/src/bin/lua/declaration.lua | 14 ++--- dependencies/tolua-5.2/src/bin/lua/define.lua | 4 +- dependencies/tolua-5.2/src/bin/lua/doit.lua | 2 +- .../tolua-5.2/src/bin/lua/enumerate.lua | 4 +- .../tolua-5.2/src/bin/lua/feature.lua | 4 +- .../tolua-5.2/src/bin/lua/function.lua | 18 +++---- dependencies/tolua-5.2/src/bin/lua/module.lua | 2 +- .../tolua-5.2/src/bin/lua/operator.lua | 4 +- .../tolua-5.2/src/bin/lua/package.lua | 8 +-- .../tolua-5.2/src/bin/lua/typedef.lua | 2 +- .../tolua-5.2/src/bin/lua/variable.lua | 16 +++--- .../tolua-5.2/src/bin/lua/verbatim.lua | 4 +- 20 files changed, 96 insertions(+), 94 deletions(-) diff --git a/dependencies/tolua-5.2/Version.txt b/dependencies/tolua-5.2/Version.txt index 50b5ea33dc..1548f88dce 100644 --- a/dependencies/tolua-5.2/Version.txt +++ b/dependencies/tolua-5.2/Version.txt @@ -3,7 +3,9 @@ Not entire tolua distribution directory hierarchy is included here, and some files needed for Freeciv usage have been added. Changes applied to included tolua source files are included in -patches in patch -directory. +patches in patch -directory. Trailing spaces and tabs have +been stripped from the .lua files to form the baseline for +these patches. Changes to toluabind.c are not included in the patches - one needs to regenerate that file after applying them. diff --git a/dependencies/tolua-5.2/src/bin/lua/array.lua b/dependencies/tolua-5.2/src/bin/lua/array.lua index 7a9b1adef8..946b09df7c 100644 --- a/dependencies/tolua-5.2/src/bin/lua/array.lua +++ b/dependencies/tolua-5.2/src/bin/lua/array.lua @@ -7,7 +7,7 @@ -- This code is free software; you can redistribute it and/or modify it. -- The software provided hereunder is on an "as is" basis, and -- the author has no obligation to provide maintenance, support, updates, --- enhancements, or modifications. +-- enhancements, or modifications. -- Array class @@ -59,7 +59,7 @@ function classArray:supcode () output("/* get function:",self.name," */") end self.cgetname = self:cfuncname("tolua_get") - output("static int",self.cgetname,"(lua_State* tolua_S)") + output("static int",self.cgetname,"(lua_State* tolua_S)") output("{") output(" int tolua_index;") @@ -132,7 +132,7 @@ function classArray:supcode () elseif static then _,_,self.mod = strfind(self.mod,'^%s*static%s%s*(.*)') end - + -- check index output('#ifndef TOLUA_RELEASE\n') output(' {') @@ -180,7 +180,7 @@ function classArray:supcode () output(' return 0;') output('}') output('\n') - end + end end diff --git a/dependencies/tolua-5.2/src/bin/lua/basic.lua b/dependencies/tolua-5.2/src/bin/lua/basic.lua index fc9d09dce3..9ac8e0aff3 100644 --- a/dependencies/tolua-5.2/src/bin/lua/basic.lua +++ b/dependencies/tolua-5.2/src/bin/lua/basic.lua @@ -13,7 +13,7 @@ -- Basic C types and their corresponding Lua types -- All occurrences of "char*" will be replaced by "_cstring", --- and all occurrences of "void*" will be replaced by "_userdata" +-- and all occurrences of "void*" will be replaced by "_userdata" _basic = { ['void'] = '', ['char'] = 'number', @@ -175,9 +175,9 @@ function concatparam (line, ...) local arg = {...} local i=1 while i<=#arg do - if _cont and not strfind(_cont,'[%(,"]') and - strfind(arg[i],"^[%a_~]") then - line = line .. ' ' + if _cont and not strfind(_cont,'[%(,"]') and + strfind(arg[i],"^[%a_~]") then + line = line .. ' ' end line = line .. arg[i] if arg[i] ~= '' then @@ -185,7 +185,7 @@ function concatparam (line, ...) end i = i+1 end - if strfind(arg[#arg],"[%/%)%;%{%}]$") then + if strfind(arg[#arg],"[%/%)%;%{%}]$") then _cont=nil line = line .. '\n' end return line @@ -196,9 +196,9 @@ function output (...) local arg = {...} local i=1 while i<=#arg do - if _cont and not strfind(_cont,'[%(,"]') and - strfind(arg[i],"^[%a_~]") then - write(' ') + if _cont and not strfind(_cont,'[%(,"]') and + strfind(arg[i],"^[%a_~]") then + write(' ') end write(arg[i]) if arg[i] ~= '' then @@ -206,7 +206,7 @@ function output (...) end i = i+1 end - if strfind(arg[#arg],"[%/%)%;%{%}]$") then + if strfind(arg[#arg],"[%/%)%;%{%}]$") then _cont=nil write('\n') end end diff --git a/dependencies/tolua-5.2/src/bin/lua/class.lua b/dependencies/tolua-5.2/src/bin/lua/class.lua index bf38405245..3a6ef5917e 100644 --- a/dependencies/tolua-5.2/src/bin/lua/class.lua +++ b/dependencies/tolua-5.2/src/bin/lua/class.lua @@ -60,7 +60,7 @@ function classClass:requirecollection (t) i = i+1 end pop() - -- only class that exports destructor can be appropriately collected + -- only class that exports destructor can be appropriately collected if self._delete then t[self.type] = "tolua_collect_" .. gsub(self.type,"::","_") r = true diff --git a/dependencies/tolua-5.2/src/bin/lua/clean.lua b/dependencies/tolua-5.2/src/bin/lua/clean.lua index b11e38cb4b..6f845c9a6f 100644 --- a/dependencies/tolua-5.2/src/bin/lua/clean.lua +++ b/dependencies/tolua-5.2/src/bin/lua/clean.lua @@ -34,7 +34,7 @@ end function clean (s) -- check for compilation error - local code = "return function () " .. s .. " end" + local code = "return function () " .. s .. " end" if not dostring(code) then return nil end @@ -46,7 +46,7 @@ function clean (s) -- remove blanks and comments while 1 do local b,e,d = strfind(s,ANY) - if b then + if b then S = S..strsub(s,1,b-1) s = strsub(s,b+1) if d==STR1 or d==STR2 then @@ -59,7 +59,7 @@ function clean (s) s = strsub(s,e+1) elseif d==REM then s = gsub(s,"[^\n]*(\n?)","%1",1) - end + end else S = S..s break diff --git a/dependencies/tolua-5.2/src/bin/lua/code.lua b/dependencies/tolua-5.2/src/bin/lua/code.lua index 6afa84cc48..dadea24163 100644 --- a/dependencies/tolua-5.2/src/bin/lua/code.lua +++ b/dependencies/tolua-5.2/src/bin/lua/code.lua @@ -7,7 +7,7 @@ -- This code is free software; you can redistribute it and/or modify it. -- The software provided hereunder is on an "as is" basis, and -- the author has no obligation to provide maintenance, support, updates, --- enhancements, or modifications. +-- enhancements, or modifications. -- Code class @@ -26,17 +26,17 @@ function classCode:register () -- clean Lua code local s = clean(self.text) if not s then - error("parser error in embedded code") + error("parser error in embedded code") end - + -- convert to C output('\n { /* begin embedded lua code */\n') output(' static unsigned char B[] = {\n ') local t={n=0} - local b = gsub(s,'(.)',function (c) - local e = '' - t.n=t.n+1 if t.n==15 then t.n=0 e='\n ' end - return format('%3u,%s',strbyte(c),e) + local b = gsub(s,'(.)',function (c) + local e = '' + t.n=t.n+1 if t.n==15 then t.n=0 e='\n ' end + return format('%3u,%s',strbyte(c),e) end ) output(b..strbyte(" ")) @@ -45,7 +45,7 @@ function classCode:register () output(' lua_pcall(tolua_S,0,LUA_MULTRET,0);') output(' } /* end of embedded lua code */\n\n') end - + -- Print method function classCode:print (ident,close) diff --git a/dependencies/tolua-5.2/src/bin/lua/compat.lua b/dependencies/tolua-5.2/src/bin/lua/compat.lua index d200399709..94c5cb6d79 100644 --- a/dependencies/tolua-5.2/src/bin/lua/compat.lua +++ b/dependencies/tolua-5.2/src/bin/lua/compat.lua @@ -89,7 +89,7 @@ max = math.max min = math.min mod = math.mod PI = math.pi ---??? pow = math.pow +--??? pow = math.pow rad = math.rad random = math.random randomseed = math.randomseed diff --git a/dependencies/tolua-5.2/src/bin/lua/container.lua b/dependencies/tolua-5.2/src/bin/lua/container.lua index 29c3781cb2..0e17575e47 100644 --- a/dependencies/tolua-5.2/src/bin/lua/container.lua +++ b/dependencies/tolua-5.2/src/bin/lua/container.lua @@ -7,7 +7,7 @@ -- This code is free software; you can redistribute it and/or modify it. -- The software provided hereunder is on an "as is" basis, and -- the author has no obligation to provide maintenance, support, updates, --- enhancements, or modifications. +-- enhancements, or modifications. -- table to store namespaced typedefs/enums in global scope global_typedefs = {} @@ -16,7 +16,7 @@ global_enums = {} -- Container class -- Represents a container of features to be bound -- to lua. -classContainer = +classContainer = { curr = nil, } @@ -84,14 +84,14 @@ end -- get current namespace function getcurrnamespace () - return getnamespace(classContainer.curr) + return getnamespace(classContainer.curr) end -- append to current container function append (t) return classContainer.curr:append(t) end - + -- append typedef to current container function appendtypedef (t) return classContainer.curr:appendtypedef(t) @@ -106,7 +106,7 @@ end function appendenum (t) return classContainer.curr:appendenum(t) end - + -- substitute typedef function applytypedef (type) return classContainer.curr:applytypedef(type) @@ -157,10 +157,10 @@ end function getnamespace (curr) local namespace = '' while curr do - if curr and + if curr and ( curr.classtype == 'class' or curr.classtype == 'namespace') then - namespace = curr.name .. '::' .. namespace + namespace = curr.name .. '::' .. namespace end curr = curr.prox end @@ -173,9 +173,9 @@ function getonlynamespace () local namespace = '' while curr do if curr.classtype == 'class' then - return namespace + return namespace elseif curr.classtype == 'namespace' then - namespace = curr.name .. '::' .. namespace + namespace = curr.name .. '::' .. namespace end curr = curr.prox end @@ -194,7 +194,7 @@ function classContainer:append (t) t.parent = self end --- append typedef +-- append typedef function classContainer:appendtypedef (t) local namespace = getnamespace(classContainer.curr) self.typedefs.tolua_n = self.typedefs.tolua_n + 1 @@ -217,7 +217,7 @@ function classContainer:appendusertype (t) return ft end --- append enum +-- append enum function classContainer:appendenum (t) local namespace = getnamespace(classContainer.curr) self.enums.tolua_n = self.enums.tolua_n + 1 @@ -227,7 +227,7 @@ end -- determine lua function name overload function classContainer:overload (lname) - if not self.lnames[lname] then + if not self.lnames[lname] then self.lnames[lname] = 0 else self.lnames[lname] = self.lnames[lname] + 1 @@ -238,7 +238,7 @@ end -- applies typedef: returns the 'the facto' modifier and type function classContainer:applytypedef (type) if global_typedefs[type] then - local mod1, type1 = global_typedefs[type].mod, global_typedefs[type].type + local mod1, type1 = global_typedefs[type].mod, global_typedefs[type].type local mod2, type2 = applytypedef(type1) return mod2 .. ' ' .. mod1, type2 end @@ -259,7 +259,7 @@ function classContainer:applytypedef (type) env = env.parent end return '',type -end +end -- check if it is a typedef function classContainer:istypedef (type) @@ -276,7 +276,7 @@ function classContainer:istypedef (type) end env = env.parent end - return nil + return nil end -- check if is a registered type: return full type or nil @@ -315,7 +315,7 @@ function classContainer:isenum (type) end env = env.parent end - return false + return false end -- parse chunk @@ -327,8 +327,8 @@ function classContainer:doparse (s) if b then Code(strsub(code,2,-2)) return strsub(s,e+1) - end - end + end + end -- try C code do @@ -337,8 +337,8 @@ function classContainer:doparse (s) code = '{'..strsub(code,2,-2)..'\n}\n' Verbatim(code,'r') -- verbatim code for 'r'egister fragment return strsub(s,e+1) - end - end + end + end -- try verbatim do @@ -346,8 +346,8 @@ function classContainer:doparse (s) if b then Verbatim(line) return strsub(s,e+1) - end - end + end + end -- try module @@ -399,13 +399,13 @@ function classContainer:doparse (s) end end - -- try operator + -- try operator do local b,e,decl,kind,arg,const = strfind(s,"^%s*([_%w][_%w%s%*&:]*operator)%s*([^%s][^%s]*)%s*(%b())%s*(c?o?n?s?t?)%s*;%s*") if not b then -- try inline b,e,decl,kind,arg,const = strfind(s,"^%s*([_%w][_%w%s%*&:]*operator)%s*([^%s][^%s]*)%s*(%b())%s*(c?o?n?s?t?)%s*%b{}%s*;?%s*") - end + end if b then _curr_code = strsub(s,b,e) Operator(decl,kind,arg,const) @@ -467,9 +467,9 @@ function classContainer:doparse (s) end end if b then - if base ~= '' then + if base ~= '' then local b,e - b,e,base = strfind(base,".-([_%w][_%w]*)$") + b,e,base = strfind(base,".-([_%w][_%w]*)$") end _curr_code = strsub(s,b,e) Class(name,base,body) diff --git a/dependencies/tolua-5.2/src/bin/lua/declaration.lua b/dependencies/tolua-5.2/src/bin/lua/declaration.lua index b2aab1ef48..4bc543dee5 100644 --- a/dependencies/tolua-5.2/src/bin/lua/declaration.lua +++ b/dependencies/tolua-5.2/src/bin/lua/declaration.lua @@ -7,7 +7,7 @@ -- This code is free software; you can redistribute it and/or modify it. -- The software provided hereunder is on an "as is" basis, and -- the author has no obligation to provide maintenance, support, updates, --- enhancements, or modifications. +-- enhancements, or modifications. -- Declaration class @@ -156,7 +156,7 @@ function classDeclaration:outchecktype (narg,var) else def = 0 end - if self.dim ~= '' then + if self.dim ~= '' then if var and self.type=='char' then return 'tolua_isstring(tolua_S,'..narg..','..def..',&tolua_err)' else @@ -186,7 +186,7 @@ function classDeclaration:builddeclaration (narg, cplusplus) line = concatparam(line," ",self.mod,ctype,ptr) if array then line = concatparam(line,'*') - end + end line = concatparam(line,self.name) if self.dim ~= '' then if tonumber(self.dim)~=nil then @@ -283,7 +283,7 @@ function classDeclaration:getarray (narg) if t then if t=='function' then t='value' end output('tolua_tofield'..t..'(tolua_S,',narg,',i+1,',def,'));') - else + else output('tolua_tofieldusertype(tolua_S,',narg,',i+1,',def,'));') end output(' }') @@ -419,7 +419,7 @@ function Declaration (s,kind) kind = kind } end - + -- check the form: mod type& name t = split(s,'&') if t.n == 2 then @@ -432,7 +432,7 @@ function Declaration (s,kind) kind = kind } end - + -- check the form: mod type* name local s1 = gsub(s,"(%b%[%])",function (n) return gsub(n,'%*','\1') end) t = split(s1,'%*') @@ -461,7 +461,7 @@ function Declaration (s,kind) } else -- kind == "func" - + -- check the form: mod type name t = split(s,'%s%s*') local v = t[t.n] -- last word is the function name diff --git a/dependencies/tolua-5.2/src/bin/lua/define.lua b/dependencies/tolua-5.2/src/bin/lua/define.lua index a903d2a21d..1763ad2944 100644 --- a/dependencies/tolua-5.2/src/bin/lua/define.lua +++ b/dependencies/tolua-5.2/src/bin/lua/define.lua @@ -7,7 +7,7 @@ -- This code is free software; you can redistribute it and/or modify it. -- The software provided hereunder is on an "as is" basis, and -- the author has no obligation to provide maintenance, support, updates, --- enhancements, or modifications. +-- enhancements, or modifications. -- Define class @@ -22,7 +22,7 @@ setmetatable(classDefine,classFeature) -- register define function classDefine:register () - output(' tolua_constant(tolua_S,"'..self.lname..'",'..self.name..');') + output(' tolua_constant(tolua_S,"'..self.lname..'",'..self.name..');') end -- Print method diff --git a/dependencies/tolua-5.2/src/bin/lua/doit.lua b/dependencies/tolua-5.2/src/bin/lua/doit.lua index 4050058aa2..231cff990a 100644 --- a/dependencies/tolua-5.2/src/bin/lua/doit.lua +++ b/dependencies/tolua-5.2/src/bin/lua/doit.lua @@ -9,7 +9,7 @@ -- This code is free software; you can redistribute it and/or modify it. -- The software provided hereunder is on an "as is" basis, and -- the author has no obligation to provide maintenance, support, updates, --- enhancements, or modifications. +-- enhancements, or modifications. function doit () -- define package name, if not provided diff --git a/dependencies/tolua-5.2/src/bin/lua/enumerate.lua b/dependencies/tolua-5.2/src/bin/lua/enumerate.lua index 41ce314429..ebd5732c18 100644 --- a/dependencies/tolua-5.2/src/bin/lua/enumerate.lua +++ b/dependencies/tolua-5.2/src/bin/lua/enumerate.lua @@ -7,7 +7,7 @@ -- This code is free software; you can redistribute it and/or modify it. -- The software provided hereunder is on an "as is" basis, and -- the author has no obligation to provide maintenance, support, updates, --- enhancements, or modifications. +-- enhancements, or modifications. -- Enumerate class @@ -72,7 +72,7 @@ function Enumerate (n,b) end e.lnames[i] = t[2] or t[1] i = i+1 - end + end e.name = n if n~="" then Typedef("int "..n) diff --git a/dependencies/tolua-5.2/src/bin/lua/feature.lua b/dependencies/tolua-5.2/src/bin/lua/feature.lua index dbf76ca7cf..742f7e18b2 100644 --- a/dependencies/tolua-5.2/src/bin/lua/feature.lua +++ b/dependencies/tolua-5.2/src/bin/lua/feature.lua @@ -7,7 +7,7 @@ -- This code is free software; you can redistribute it and/or modify it. -- The software provided hereunder is on an "as is" basis, and -- the author has no obligation to provide maintenance, support, updates, --- enhancements, or modifications. +-- enhancements, or modifications. -- Feature class @@ -90,7 +90,7 @@ function classFeature:cfuncname (n) n = self.parent:cfuncname(n) end - if self.lname and + if self.lname and strsub(self.lname,1,1)~="." -- operator are named as ".add" then return n..'_'..self.lname diff --git a/dependencies/tolua-5.2/src/bin/lua/function.lua b/dependencies/tolua-5.2/src/bin/lua/function.lua index b435b93943..3fbc2f80dd 100644 --- a/dependencies/tolua-5.2/src/bin/lua/function.lua +++ b/dependencies/tolua-5.2/src/bin/lua/function.lua @@ -7,7 +7,7 @@ -- This code is free software; you can redistribute it and/or modify it. -- The software provided hereunder is on an "as is" basis, and -- the author has no obligation to provide maintenance, support, updates, --- enhancements, or modifications. +-- enhancements, or modifications. @@ -85,14 +85,14 @@ function classFunction:supcode () func = 'tolua_isusertable' type = self.parent.type end - output(' !'..func..'(tolua_S,1,"'..type..'",0,&tolua_err) || \n') + output(' !'..func..'(tolua_S,1,"'..type..'",0,&tolua_err) || \n') end -- check args local vararg = false if self.args[1].type ~= 'void' then local i=1 while self.args[i] and self.args[i].type ~= "..." do - local btype = isbasic(self.args[i].type) + local btype = isbasic(self.args[i].type) if btype ~= 'state' then output(' !'..self.args[i]:outchecktype(narg,false)..' || \n') end @@ -105,7 +105,7 @@ function classFunction:supcode () vararg = true end end - -- check end of list + -- check end of list if not vararg then output(' !tolua_isnoobj(tolua_S,'..narg..',&tolua_err)\n') else @@ -119,7 +119,7 @@ function classFunction:supcode () output('#endif\n') end output(' {') - + -- declare self, if the case local narg if class then narg=2 else narg=1 end @@ -143,7 +143,7 @@ function classFunction:supcode () end -- check self - if class and self.name~='new' and static==nil then + if class and self.name~='new' and static==nil then output('#ifndef TOLUA_RELEASE\n') output(' if (!self) tolua_error(tolua_S,"invalid \'self\' in function \''..self.name..'\'",NULL);'); output('#endif\n') @@ -205,7 +205,7 @@ function classFunction:supcode () output(',') end end - + if class and self.name == 'operator[]' then output('-1);') else @@ -229,7 +229,7 @@ function classFunction:supcode () if self.ptr == '' then output(' {') output('#ifdef __cplusplus\n') - output(' void* tolua_obj = new',t,'(tolua_ret);') + output(' void* tolua_obj = new',t,'(tolua_ret);') output(' tolua_pushusertype(tolua_S,tolua_clone(tolua_S,tolua_obj,'.. (_collect[t] or 'NULL') ..'),"',t,'");') output('#else\n') output(' void* tolua_obj = tolua_copy(tolua_S,(void*)&tolua_ret,sizeof(',t,'));') @@ -267,7 +267,7 @@ function classFunction:supcode () i = i+1 end end - + -- free dynamically allocated array if self.args[1].type ~= 'void' then local i=1 diff --git a/dependencies/tolua-5.2/src/bin/lua/module.lua b/dependencies/tolua-5.2/src/bin/lua/module.lua index 10d541b150..96962ca686 100644 --- a/dependencies/tolua-5.2/src/bin/lua/module.lua +++ b/dependencies/tolua-5.2/src/bin/lua/module.lua @@ -7,7 +7,7 @@ -- This code is free software; you can redistribute it and/or modify it. -- The software provided hereunder is on an "as is" basis, and -- the author has no obligation to provide maintenance, support, updates, --- enhancements, or modifications. +-- enhancements, or modifications. diff --git a/dependencies/tolua-5.2/src/bin/lua/operator.lua b/dependencies/tolua-5.2/src/bin/lua/operator.lua index 822fe83335..07b55e0090 100644 --- a/dependencies/tolua-5.2/src/bin/lua/operator.lua +++ b/dependencies/tolua-5.2/src/bin/lua/operator.lua @@ -7,7 +7,7 @@ -- This code is free software; you can redistribute it and/or modify it. -- The software provided hereunder is on an "as is" basis, and -- the author has no obligation to provide maintenance, support, updates, --- enhancements, or modifications. +-- enhancements, or modifications. -- Operator class @@ -31,7 +31,7 @@ _TM = {['+'] = 'add', ['[]'] = 'geti', ['&[]'] = 'seti', } - + -- Print method function classOperator:print (ident,close) diff --git a/dependencies/tolua-5.2/src/bin/lua/package.lua b/dependencies/tolua-5.2/src/bin/lua/package.lua index d0a7b08d12..0e7178b81d 100644 --- a/dependencies/tolua-5.2/src/bin/lua/package.lua +++ b/dependencies/tolua-5.2/src/bin/lua/package.lua @@ -7,7 +7,7 @@ -- This code is free software; you can redistribute it and/or modify it. -- The software provided hereunder is on an "as is" basis, and -- the author has no obligation to provide maintenance, support, updates, --- enhancements, or modifications. +-- enhancements, or modifications. @@ -38,7 +38,7 @@ function classPackage:preprocess () self.code = gsub(self.code,"\n%s*%$%]","\2") self.code = gsub(self.code,"(%b\1\2)", function (c) tinsert(L,c) - return "\n#["..getn(L).."]#" + return "\n#["..getn(L).."]#" end) -- avoid preprocessing embedded C code local C = {} @@ -46,14 +46,14 @@ function classPackage:preprocess () self.code = gsub(self.code,"\n%s*%$%>","\4") self.code = gsub(self.code,"(%b\3\4)", function (c) tinsert(C,c) - return "\n#<"..getn(C)..">#" + return "\n#<"..getn(C)..">#" end) -- avoid preprocessing verbatim lines local V = {} self.code = gsub(self.code,"\n(%s*%$[^%[%]][^\n]*)",function (v) tinsert(V,v) - return "\n#"..getn(V).."#" + return "\n#"..getn(V).."#" end) -- perform global substitution diff --git a/dependencies/tolua-5.2/src/bin/lua/typedef.lua b/dependencies/tolua-5.2/src/bin/lua/typedef.lua index e7b4bc905f..bff61c4178 100644 --- a/dependencies/tolua-5.2/src/bin/lua/typedef.lua +++ b/dependencies/tolua-5.2/src/bin/lua/typedef.lua @@ -7,7 +7,7 @@ -- This code is free software; you can redistribute it and/or modify it. -- The software provided hereunder is on an "as is" basis, and -- the author has no obligation to provide maintenance, support, updates, --- enhancements, or modifications. +-- enhancements, or modifications. diff --git a/dependencies/tolua-5.2/src/bin/lua/variable.lua b/dependencies/tolua-5.2/src/bin/lua/variable.lua index 976694be21..9328f73354 100644 --- a/dependencies/tolua-5.2/src/bin/lua/variable.lua +++ b/dependencies/tolua-5.2/src/bin/lua/variable.lua @@ -7,7 +7,7 @@ -- This code is free software; you can redistribute it and/or modify it. -- The software provided hereunder is on an "as is" basis, and -- the author has no obligation to provide maintenance, support, updates, --- enhancements, or modifications. +-- enhancements, or modifications. -- Variable class @@ -53,7 +53,7 @@ function classVariable:cfuncname (prefix) elseif self.ptr == "&" then ptr = "_ref" end - local name = prefix .. parent .. unsigned .. "_" .. gsub(self.name,".*::","") .. ptr + local name = prefix .. parent .. unsigned .. "_" .. gsub(self.name,".*::","") .. ptr return name @@ -98,8 +98,8 @@ function classVariable:supcode () output("/* get function:",self.name," */") self.cgetname = self:cfuncname("tolua_get") end - - output("static int",self.cgetname,"(lua_State* tolua_S)") + + output("static int",self.cgetname,"(lua_State* tolua_S)") output("{") -- declare self, if the case @@ -178,7 +178,7 @@ function classVariable:supcode () output(' if (!'..self:outchecktype(2,true)..')') output(' tolua_error(tolua_S,"#vinvalid type in variable assignment.",&tolua_err);') output('#endif\n') - + -- assign value local def = 0 if self.def ~= '' then def = self.def end @@ -215,7 +215,7 @@ function classVariable:supcode () if isenum(self.type) then output('(int) ') end - if t=='function' then t='value' end + if t=='function' then t='value' end output('tolua_to'..t,'(tolua_S,2,',def,'));') else output('tolua_tousertype(tolua_S,2,',def,'));') @@ -224,7 +224,7 @@ function classVariable:supcode () output(' return 0;') output('}') output('\n') - end + end end @@ -233,7 +233,7 @@ function classVariable:register () if not parent then if classVariable._warning==nil then warning("Mapping variable to global may degrade performance") - classVariable._warning = 1 + classVariable._warning = 1 end end if self.csetname then diff --git a/dependencies/tolua-5.2/src/bin/lua/verbatim.lua b/dependencies/tolua-5.2/src/bin/lua/verbatim.lua index 158109233d..454ddb7800 100644 --- a/dependencies/tolua-5.2/src/bin/lua/verbatim.lua +++ b/dependencies/tolua-5.2/src/bin/lua/verbatim.lua @@ -7,7 +7,7 @@ -- This code is free software; you can redistribute it and/or modify it. -- The software provided hereunder is on an "as is" basis, and -- the author has no obligation to provide maintenance, support, updates, --- enhancements, or modifications. +-- enhancements, or modifications. @@ -43,7 +43,7 @@ function classVerbatim:register () write(self.line) end end - + -- Print method function classVerbatim:print (ident,close) -- 2.35.1