some cleanup

This commit is contained in:
blueloveTH 2023-10-28 11:08:27 +08:00
parent 40281a8d94
commit 7916bb035f
3 changed files with 17 additions and 13 deletions

View File

@ -119,12 +119,12 @@ union BitsCvtImpl<4>{
BitsCvtImpl(NumberTraits<4>::float_t val): _float(val) {}
BitsCvtImpl(NumberTraits<4>::int_t val): _int(val) {}
void print(){
std::string s = std::bitset<32>(_int).to_string();
std::cout << s.substr(0, 1) << '|';
std::cout << s.substr(1, 8) << '|';
std::cout << s.substr(9) << std::endl;
}
// void print(){
// std::string s = std::bitset<32>(_int).to_string();
// std::cout << s.substr(0, 1) << '|';
// std::cout << s.substr(1, 8) << '|';
// std::cout << s.substr(9) << std::endl;
// }
};
template<>

View File

@ -59,13 +59,13 @@ struct Token{
Str str() const { return Str(start, length);}
std::string_view sv() const { return std::string_view(start, length);}
Str info() const {
SStream ss;
ss << line << ": " << TK_STR(type) << " '" << (
sv()=="\n" ? "\\n" : sv()
) << "'";
return ss.str();
}
// Str info() const {
// SStream ss;
// ss << line << ": " << TK_STR(type) << " '" << (
// sv()=="\n" ? "\\n" : sv()
// ) << "'";
// return ss.str();
// }
};
// https://docs.python.org/3/reference/expressions.html#operator-precedence

View File

@ -9,6 +9,7 @@ class vec2(_StructLike['vec2']):
def __add__(self, other: vec2) -> vec2: ...
def __sub__(self, other: vec2) -> vec2: ...
def __mul__(self, other: float) -> vec2: ...
def __rmul__(self, other: float) -> vec2: ...
def __truediv__(self, other: float) -> vec2: ...
def dot(self, other: vec2) -> float: ...
def cross(self, other: vec2) -> float: ...
@ -27,6 +28,7 @@ class vec3(_StructLike['vec3']):
def __add__(self, other: vec3) -> vec3: ...
def __sub__(self, other: vec3) -> vec3: ...
def __mul__(self, other: float) -> vec3: ...
def __rmul__(self, other: float) -> vec3: ...
def __truediv__(self, other: float) -> vec3: ...
def dot(self, other: vec3) -> float: ...
def cross(self, other: vec3) -> float: ...
@ -44,6 +46,7 @@ class vec4(_StructLike['vec4']):
def __add__(self, other: vec4) -> vec4: ...
def __sub__(self, other: vec4) -> vec4: ...
def __mul__(self, other: float) -> vec4: ...
def __rmul__(self, other: float) -> vec4: ...
def __truediv__(self, other: float) -> vec4: ...
def dot(self, other: vec4) -> float: ...
def length(self) -> float: ...
@ -80,6 +83,7 @@ class mat3x3(_StructLike['mat3x3']):
def __add__(self, other: mat3x3) -> mat3x3: ...
def __sub__(self, other: mat3x3) -> mat3x3: ...
def __mul__(self, other: float) -> mat3x3: ...
def __rmul__(self, other: float) -> mat3x3: ...
def __truediv__(self, other: float) -> mat3x3: ...
def __invert__(self) -> mat3x3: ...