From 2f4e1d64dc10361085da8757f6f98fb8e8cac1ca Mon Sep 17 00:00:00 2001 From: unittensor Date: Sun, 21 Jan 2024 17:39:32 -0500 Subject: [PATCH] typemap for luau analyzer, rename "tests" to "luau" and move tests into it --- {tests => luau/tests}/Vector.lua | 0 luau/typemap.lua | 17 +++++++++++++++++ 2 files changed, 17 insertions(+) rename {tests => luau/tests}/Vector.lua (100%) create mode 100644 luau/typemap.lua diff --git a/tests/Vector.lua b/luau/tests/Vector.lua similarity index 100% rename from tests/Vector.lua rename to luau/tests/Vector.lua diff --git a/luau/typemap.lua b/luau/typemap.lua new file mode 100644 index 0000000..22c83f2 --- /dev/null +++ b/luau/typemap.lua @@ -0,0 +1,17 @@ +--A type map for the luau analyzer +type f64 = number + +type Vector2 = {x: f64, y: f64} +type Vector3 = Vector2 & {z: f64} +type Vector4 = Vector3 & {w: f64} + +type fn_Vector3 = (x: f64, y: f64, z: f64) -> Vector3 +local Vector3: fn_Vector3 = Vector3 + +type fn_Vector3add = (v1: Vector3, v2: Vector3) -> Vector3 +local Vector3add: fn_Vector3add = Vector3add + +return { + Vector3 = Vector3, + Vector3add = Vector3add +} \ No newline at end of file