mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-22 04:20:17 +00:00
some cleanup
This commit is contained in:
parent
40281a8d94
commit
7916bb035f
@ -119,12 +119,12 @@ union BitsCvtImpl<4>{
|
|||||||
BitsCvtImpl(NumberTraits<4>::float_t val): _float(val) {}
|
BitsCvtImpl(NumberTraits<4>::float_t val): _float(val) {}
|
||||||
BitsCvtImpl(NumberTraits<4>::int_t val): _int(val) {}
|
BitsCvtImpl(NumberTraits<4>::int_t val): _int(val) {}
|
||||||
|
|
||||||
void print(){
|
// void print(){
|
||||||
std::string s = std::bitset<32>(_int).to_string();
|
// std::string s = std::bitset<32>(_int).to_string();
|
||||||
std::cout << s.substr(0, 1) << '|';
|
// std::cout << s.substr(0, 1) << '|';
|
||||||
std::cout << s.substr(1, 8) << '|';
|
// std::cout << s.substr(1, 8) << '|';
|
||||||
std::cout << s.substr(9) << std::endl;
|
// std::cout << s.substr(9) << std::endl;
|
||||||
}
|
// }
|
||||||
};
|
};
|
||||||
|
|
||||||
template<>
|
template<>
|
||||||
|
@ -59,13 +59,13 @@ struct Token{
|
|||||||
Str str() const { return Str(start, length);}
|
Str str() const { return Str(start, length);}
|
||||||
std::string_view sv() const { return std::string_view(start, length);}
|
std::string_view sv() const { return std::string_view(start, length);}
|
||||||
|
|
||||||
Str info() const {
|
// Str info() const {
|
||||||
SStream ss;
|
// SStream ss;
|
||||||
ss << line << ": " << TK_STR(type) << " '" << (
|
// ss << line << ": " << TK_STR(type) << " '" << (
|
||||||
sv()=="\n" ? "\\n" : sv()
|
// sv()=="\n" ? "\\n" : sv()
|
||||||
) << "'";
|
// ) << "'";
|
||||||
return ss.str();
|
// return ss.str();
|
||||||
}
|
// }
|
||||||
};
|
};
|
||||||
|
|
||||||
// https://docs.python.org/3/reference/expressions.html#operator-precedence
|
// https://docs.python.org/3/reference/expressions.html#operator-precedence
|
||||||
|
@ -9,6 +9,7 @@ class vec2(_StructLike['vec2']):
|
|||||||
def __add__(self, other: vec2) -> vec2: ...
|
def __add__(self, other: vec2) -> vec2: ...
|
||||||
def __sub__(self, other: vec2) -> vec2: ...
|
def __sub__(self, other: vec2) -> vec2: ...
|
||||||
def __mul__(self, other: float) -> vec2: ...
|
def __mul__(self, other: float) -> vec2: ...
|
||||||
|
def __rmul__(self, other: float) -> vec2: ...
|
||||||
def __truediv__(self, other: float) -> vec2: ...
|
def __truediv__(self, other: float) -> vec2: ...
|
||||||
def dot(self, other: vec2) -> float: ...
|
def dot(self, other: vec2) -> float: ...
|
||||||
def cross(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 __add__(self, other: vec3) -> vec3: ...
|
||||||
def __sub__(self, other: vec3) -> vec3: ...
|
def __sub__(self, other: vec3) -> vec3: ...
|
||||||
def __mul__(self, other: float) -> vec3: ...
|
def __mul__(self, other: float) -> vec3: ...
|
||||||
|
def __rmul__(self, other: float) -> vec3: ...
|
||||||
def __truediv__(self, other: float) -> vec3: ...
|
def __truediv__(self, other: float) -> vec3: ...
|
||||||
def dot(self, other: vec3) -> float: ...
|
def dot(self, other: vec3) -> float: ...
|
||||||
def cross(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 __add__(self, other: vec4) -> vec4: ...
|
||||||
def __sub__(self, other: vec4) -> vec4: ...
|
def __sub__(self, other: vec4) -> vec4: ...
|
||||||
def __mul__(self, other: float) -> vec4: ...
|
def __mul__(self, other: float) -> vec4: ...
|
||||||
|
def __rmul__(self, other: float) -> vec4: ...
|
||||||
def __truediv__(self, other: float) -> vec4: ...
|
def __truediv__(self, other: float) -> vec4: ...
|
||||||
def dot(self, other: vec4) -> float: ...
|
def dot(self, other: vec4) -> float: ...
|
||||||
def length(self) -> float: ...
|
def length(self) -> float: ...
|
||||||
@ -80,6 +83,7 @@ class mat3x3(_StructLike['mat3x3']):
|
|||||||
def __add__(self, other: mat3x3) -> mat3x3: ...
|
def __add__(self, other: mat3x3) -> mat3x3: ...
|
||||||
def __sub__(self, other: mat3x3) -> mat3x3: ...
|
def __sub__(self, other: mat3x3) -> mat3x3: ...
|
||||||
def __mul__(self, other: float) -> mat3x3: ...
|
def __mul__(self, other: float) -> mat3x3: ...
|
||||||
|
def __rmul__(self, other: float) -> mat3x3: ...
|
||||||
def __truediv__(self, other: float) -> mat3x3: ...
|
def __truediv__(self, other: float) -> mat3x3: ...
|
||||||
|
|
||||||
def __invert__(self) -> mat3x3: ...
|
def __invert__(self) -> mat3x3: ...
|
||||||
|
Loading…
x
Reference in New Issue
Block a user