blueloveTH 2 ani în urmă
părinte
comite
80a5d5a13e
4 a modificat fișierele cu 7 adăugiri și 6 ștergeri
  1. 1 1
      amalgamate.py
  2. 2 2
      src/linalg.h
  3. 0 0
      src/linalg.pyi
  4. 4 3
      src/pocketpy.h

+ 1 - 1
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()

+ 2 - 2
src/mat3x3.h → 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){}

+ 0 - 0
src/mat3x3.pyi → src/linalg.pyi


+ 4 - 3
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
 }