diff options
author | Julian Laubstein <julianlaubstein@yahoo.de> | 2015-11-05 10:56:20 +0100 |
---|---|---|
committer | Julian Laubstein <julianlaubstein@yahoo.de> | 2015-11-05 10:56:20 +0100 |
commit | 51e5e6e9a8ed689c044256859f16f1b1f57585b7 (patch) | |
tree | 3a0d2409a61622edcc3ec5953a28fb3c13cc8705 /lib/tolua++/src/bin/lua/typedef.lua | |
parent | Merge pull request #2601 from Gargaj/patch-1 (diff) | |
parent | Outsourced all libraries into submodules (diff) | |
download | cuberite-51e5e6e9a8ed689c044256859f16f1b1f57585b7.tar cuberite-51e5e6e9a8ed689c044256859f16f1b1f57585b7.tar.gz cuberite-51e5e6e9a8ed689c044256859f16f1b1f57585b7.tar.bz2 cuberite-51e5e6e9a8ed689c044256859f16f1b1f57585b7.tar.lz cuberite-51e5e6e9a8ed689c044256859f16f1b1f57585b7.tar.xz cuberite-51e5e6e9a8ed689c044256859f16f1b1f57585b7.tar.zst cuberite-51e5e6e9a8ed689c044256859f16f1b1f57585b7.zip |
Diffstat (limited to 'lib/tolua++/src/bin/lua/typedef.lua')
m--------- | lib/tolua++ | 0 | ||||
-rw-r--r-- | lib/tolua++/src/bin/lua/typedef.lua | 71 |
2 files changed, 0 insertions, 71 deletions
diff --git a/lib/tolua++ b/lib/tolua++ new file mode 160000 +Subproject 9181fc9ef73fa1c052f968d68dc60538f144a47 diff --git a/lib/tolua++/src/bin/lua/typedef.lua b/lib/tolua++/src/bin/lua/typedef.lua deleted file mode 100644 index a78a84155..000000000 --- a/lib/tolua++/src/bin/lua/typedef.lua +++ /dev/null @@ -1,71 +0,0 @@ --- tolua: typedef class --- Written by Waldemar Celes --- TeCGraf/PUC-Rio --- Jul 1998 --- $Id: $ - --- 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. - - - --- Typedef class --- Represents a type synonym. --- The 'de facto' type replaces the typedef before the --- remaining code is parsed. --- The following fields are stored: --- utype = typedef name --- type = 'the facto' type --- mod = modifiers to the 'de facto' type -classTypedef = { - utype = '', - mod = '', - type = '' -} -classTypedef.__index = classTypedef - --- Print method -function classTypedef:print (ident,close) - print(ident.."Typedef{") - print(ident.." utype = '"..self.utype.."',") - print(ident.." mod = '"..self.mod.."',") - print(ident.." type = '"..self.type.."',") - print(ident.."}"..close) -end - --- Return it's not a variable -function classTypedef:isvariable () - return false -end - --- Internal constructor -function _Typedef (t) - setmetatable(t,classTypedef) - t.type = resolve_template_types(t.type) - appendtypedef(t) - return t -end - --- Constructor --- Expects one string representing the type definition. -function Typedef (s) - if strfind(string.gsub(s, '%b<>', ''),'[%*&]') then - tolua_error("#invalid typedef: pointers (and references) are not supported") - end - local o = {mod = ''} - if string.find(s, "[<>]") then - _,_,o.type,o.utype = string.find(s, "^%s*([^<>]+%b<>[^%s]*)%s+(.-)$") - else - local t = split(gsub(s,"%s%s*"," ")," ") - o = { - utype = t[t.n], - type = t[t.n-1], - mod = concat(t,1,t.n-2), - } - end - return _Typedef(o) -end - - |