diff --git a/generator/lua.go b/generator/lua.go index 53322f5..158a07e 100644 --- a/generator/lua.go +++ b/generator/lua.go @@ -701,21 +701,6 @@ func luaDefaultValue(f parser.Field, enumNames map[string]struct{}) string { return "nil" } -func luaTypeName(f parser.Field, enumNames map[string]struct{}) string { - switch f.Kind { - case parser.KindPrimitive: - if luaIsEnumType(f, enumNames) { - return "number" - } - return "number" - case parser.KindNested: - return f.TypeName - case parser.KindFixedArray, parser.KindSlice: - return "table" - } - return "any" -} - func luaSerializeValueExpr(access string, f parser.Field, enumNames map[string]struct{}) string { if !luaIsEnumType(f, enumNames) { return access @@ -765,7 +750,7 @@ func checkFieldLuaSupport(msgName string, f parser.Field) error { switch f.Kind { case parser.KindPrimitive: if f.Primitive == parser.KindInt64 || f.Primitive == parser.KindUint64 { - return fmt.Errorf("Lua target does not support int64/uint64: field %s in message %s (LuaJIT/Defold uses double-precision floats which can only safely represent integers up to 2^53)", f.Name, msgName) + return fmt.Errorf("lua target does not support int64/uint64: field %s in message %s (LuaJIT/Defold uses double-precision floats which can only safely represent integers up to 2^53)", f.Name, msgName) } case parser.KindFixedArray, parser.KindSlice: if f.Elem != nil { diff --git a/testdata/sample.go b/testdata/sample.go index d9843b3..e5c342c 100644 --- a/testdata/sample.go +++ b/testdata/sample.go @@ -15,14 +15,14 @@ const ( ) type MoveMessage struct { - Position Vector3 - Velocity [3]float32 - Waypoints []Vector3 + Position Vector3 + Velocity [3]float32 + Waypoints []Vector3 PlayerID uint32 - Active bool - Visible bool - Ghost bool - Name string + Active bool + Visible bool + Ghost bool + Name string } type SpawnMessage struct {