mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-21 03:50:16 +00:00
add some final
kw
This commit is contained in:
parent
c7ec20a11e
commit
83b059b24f
@ -4,7 +4,7 @@
|
||||
|
||||
namespace pkpy{
|
||||
|
||||
class RangeIter : public BaseIter {
|
||||
class RangeIter final: public BaseIter {
|
||||
i64 current;
|
||||
Range r; // copy by value, so we don't need to keep ref
|
||||
public:
|
||||
@ -25,7 +25,7 @@ public:
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
class ArrayIter : public BaseIter {
|
||||
class ArrayIter final: public BaseIter {
|
||||
PyObject* ref;
|
||||
int index;
|
||||
public:
|
||||
@ -42,7 +42,7 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class StringIter : public BaseIter {
|
||||
class StringIter final: public BaseIter {
|
||||
PyObject* ref;
|
||||
int index;
|
||||
public:
|
||||
|
@ -88,7 +88,7 @@ struct GCHeader {
|
||||
GCHeader() : enabled(true), marked(false) {}
|
||||
};
|
||||
|
||||
struct PyObject {
|
||||
struct PyObject{
|
||||
GCHeader gc;
|
||||
Type type;
|
||||
NameDict* _attr;
|
||||
@ -111,7 +111,7 @@ template<typename T>
|
||||
void gc_mark(T& t);
|
||||
|
||||
template <typename T>
|
||||
struct Py_ : PyObject {
|
||||
struct Py_ final: PyObject {
|
||||
T _value;
|
||||
|
||||
Py_(Type type, const T& val): PyObject(type), _value(val) { _init(); }
|
||||
|
2
src/vm.h
2
src/vm.h
@ -32,7 +32,7 @@ Str _read_file_cwd(const Str& name, bool* ok);
|
||||
inline PyObject* py_var(VM* vm, ctype&& value) { return vm->heap.gcnew(vm->ptype, std::move(value));}
|
||||
|
||||
|
||||
class Generator: public BaseIter {
|
||||
class Generator final: public BaseIter {
|
||||
Frame frame;
|
||||
int state; // 0,1,2
|
||||
public:
|
||||
|
Loading…
x
Reference in New Issue
Block a user