mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-20 19:40:18 +00:00
fix all
This commit is contained in:
parent
428761ea22
commit
c95c93499a
@ -224,6 +224,7 @@ struct vector {
|
|||||||
int n = end - begin;
|
int n = end - begin;
|
||||||
reserve(_size + n);
|
reserve(_size + n);
|
||||||
uninitialized_copy_n(begin, n, _data + _size);
|
uninitialized_copy_n(begin, n, _data + _size);
|
||||||
|
_size += n;
|
||||||
}
|
}
|
||||||
|
|
||||||
void insert(const T* it, const T& t) {
|
void insert(const T* it, const T& t) {
|
||||||
@ -308,12 +309,6 @@ struct small_vector {
|
|||||||
|
|
||||||
[[nodiscard]] T* end() const { return _end; }
|
[[nodiscard]] T* end() const { return _end; }
|
||||||
|
|
||||||
[[nodiscard]] T* rbegin() const { return _end - 1; }
|
|
||||||
|
|
||||||
[[nodiscard]] T* rend() const { return _begin - 1; }
|
|
||||||
|
|
||||||
[[nodiscard]] T& front() const { return *begin(); }
|
|
||||||
|
|
||||||
[[nodiscard]] T& back() const { return *(end() - 1); }
|
[[nodiscard]] T& back() const { return *(end() - 1); }
|
||||||
|
|
||||||
[[nodiscard]] T& operator[] (int index) { return _begin[index]; }
|
[[nodiscard]] T& operator[] (int index) { return _begin[index]; }
|
||||||
|
@ -1005,12 +1005,13 @@ void Compiler::consume_type_hints() {
|
|||||||
|
|
||||||
void Compiler::_add_decorators(const Expr_vector& decorators) {
|
void Compiler::_add_decorators(const Expr_vector& decorators) {
|
||||||
// [obj]
|
// [obj]
|
||||||
for(auto it = decorators.rbegin(); it != decorators.rend(); ++it) {
|
for(int i=decorators.size()-1; i>=0; i--) {
|
||||||
(*it)->emit_(ctx()); // [obj, f]
|
int line = decorators[i]->line;
|
||||||
ctx()->emit_(OP_ROT_TWO, BC_NOARG, (*it)->line); // [f, obj]
|
decorators[i]->emit_(ctx()); // [obj, f]
|
||||||
|
ctx()->emit_(OP_ROT_TWO, BC_NOARG, line); // [f, obj]
|
||||||
ctx()->emit_(OP_LOAD_NULL, BC_NOARG, BC_KEEPLINE); // [f, obj, NULL]
|
ctx()->emit_(OP_LOAD_NULL, BC_NOARG, BC_KEEPLINE); // [f, obj, NULL]
|
||||||
ctx()->emit_(OP_ROT_TWO, BC_NOARG, BC_KEEPLINE); // [obj, NULL, f]
|
ctx()->emit_(OP_ROT_TWO, BC_NOARG, BC_KEEPLINE); // [obj, NULL, f]
|
||||||
ctx()->emit_(OP_CALL, 1, (*it)->line); // [obj]
|
ctx()->emit_(OP_CALL, 1, line); // [obj]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user