diff --git a/amalgamate.py b/amalgamate.py index 9ef5a3a0..65cfa0a0 100644 --- a/amalgamate.py +++ b/amalgamate.py @@ -9,7 +9,7 @@ pipeline = [ ["common.h", "memory.h", "vector.h", "str.h", "tuplelist.h", "namedict.h", "error.h", "lexer.h"], ["obj.h", "codeobject.h", "frame.h"], ["gc.h", "vm.h", "ceval.h", "expr.h", "compiler.h", "repl.h"], - ["_generated.h", "iter.h", "base64.h", "cffi.h", "mat3x3.h", "requests.h", "io.h", "pocketpy.h"] + ["_generated.h", "iter.h", "base64.h", "cffi.h", "linalg.h", "requests.h", "io.h", "pocketpy.h"] ] copied = set() diff --git a/src/mat3x3.h b/src/linalg.h similarity index 99% rename from src/mat3x3.h rename to src/linalg.h index 9894907f..014570f5 100644 --- a/src/mat3x3.h +++ b/src/linalg.h @@ -262,7 +262,7 @@ struct Mat3x3{ }; struct PyVec2: Vec2 { - PY_CLASS(PyVec2, builtins, vec2) + PY_CLASS(PyVec2, linalg, vec2) PyVec2() : Vec2() {} PyVec2(float x, float y) : Vec2(x, y) {} @@ -378,7 +378,7 @@ struct PyVec2: Vec2 { }; struct PyMat3x3: Mat3x3{ - PY_CLASS(PyMat3x3, builtins, mat3x3) + PY_CLASS(PyMat3x3, linalg, mat3x3) PyMat3x3(): Mat3x3(){} PyMat3x3(const Mat3x3& other): Mat3x3(other){} diff --git a/src/mat3x3.pyi b/src/linalg.pyi similarity index 100% rename from src/mat3x3.pyi rename to src/linalg.pyi diff --git a/src/pocketpy.h b/src/pocketpy.h index 9b063db7..870a85b2 100644 --- a/src/pocketpy.h +++ b/src/pocketpy.h @@ -7,7 +7,7 @@ #include "iter.h" #include "base64.h" #include "cffi.h" -#include "mat3x3.h" +#include "linalg.h" #include "requests.h" #include "io.h" #include "_generated.h" @@ -1053,8 +1053,9 @@ inline void VM::post_init(){ add_module_requests(this); } - PyVec2::register_class(this, builtins); - PyMat3x3::register_class(this, builtins); + PyObject* linalg = new_module("linalg"); + PyVec2::register_class(this, linalg); + PyMat3x3::register_class(this, linalg); #endif }