Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #9 from jmervine/master

autogen.lua:52: attempt to call method 'split' (a nil value)
  • Loading branch information...
commit fa16d9174278dbeff8d5392afc95a7750bfe728d 2 parents 1b11c5b + 7bb6c0f
@orangeduck authored
Showing with 8 additions and 8 deletions.
  1. +8 −8 autogen.lua
View
16 autogen.lua
@@ -19,7 +19,14 @@ function findall(text, pattern)
end
return matches
end
-
+
+function string:split(sep)
+ local sep, fields = sep or ":", {}
+ local pattern = string.format("([^%s]+)", sep)
+ self:gsub(pattern, function(c) fields[#fields+1] = c end)
+ return fields
+end
+
typedefs = findall(text, "typedef struct {.-} %w-;")
funcdefs = findall(text, "[%w%*]- [%w_]-%(.-%);")
@@ -29,13 +36,6 @@ for k,v in pairs(typedefs) do
local _, _, members, typename = string.find(v, "typedef struct {(.-)} (%w-);")
print(string.format("luaA_struct(%s);", typename))
- function string:split(sep)
- local sep, fields = sep or ":", {}
- local pattern = string.format("([^%s]+)", sep)
- self:gsub(pattern, function(c) fields[#fields+1] = c end)
- return fields
- end
-
for _, mem in pairs(members:split(";")) do
local meminfo = mem:split(" ")
print(string.format("luaA_struct_member(%s, %s, %s);", typename, meminfo[2], meminfo[1]))
Please sign in to comment.
Something went wrong with that request. Please try again.