mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-20 11:30:18 +00:00
Update pubspec.yaml
Update pubspec.yaml up Update main.yml up
This commit is contained in:
parent
26b065c1fb
commit
46350b0964
2
.github/workflows/main.yml
vendored
2
.github/workflows/main.yml
vendored
@ -52,7 +52,7 @@ jobs:
|
|||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: subosito/flutter-action@v2
|
- uses: subosito/flutter-action@v2
|
||||||
with:
|
with:
|
||||||
flutter-version: '3.3.9'
|
flutter-version: '3.0.0'
|
||||||
channel: 'stable'
|
channel: 'stable'
|
||||||
- run: flutter --version
|
- run: flutter --version
|
||||||
- name: Compiling
|
- name: Compiling
|
||||||
|
@ -16,3 +16,7 @@ The initial version. Hello, world!
|
|||||||
+ Support type hints
|
+ Support type hints
|
||||||
+ Fix a bug about comment and indentation
|
+ Fix a bug about comment and indentation
|
||||||
+ Fix a bug about compile error line number
|
+ Fix a bug about compile error line number
|
||||||
|
|
||||||
|
## 0.4.8+3
|
||||||
|
|
||||||
|
+ Downgrade to `sdk>=2.17.0`
|
@ -20,7 +20,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
|||||||
version: 1.0.0+1
|
version: 1.0.0+1
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: '>=2.18.5 <3.0.0'
|
sdk: '>=2.17.0 <3.0.0'
|
||||||
|
|
||||||
# Dependencies specify other packages that your package needs in order to work.
|
# Dependencies specify other packages that your package needs in order to work.
|
||||||
# To automatically upgrade your package dependencies to the latest versions
|
# To automatically upgrade your package dependencies to the latest versions
|
||||||
@ -48,13 +48,6 @@ dev_dependencies:
|
|||||||
flutter_test:
|
flutter_test:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
|
|
||||||
# The "flutter_lints" package below contains a set of recommended lints to
|
|
||||||
# encourage good coding practices. The lint set provided by the package is
|
|
||||||
# activated in the `analysis_options.yaml` file located at the root of your
|
|
||||||
# package. See that file for information about deactivating specific lint
|
|
||||||
# rules and activating additional ones.
|
|
||||||
flutter_lints: ^2.0.0
|
|
||||||
|
|
||||||
# For information on the generic Dart part of this file, see the
|
# For information on the generic Dart part of this file, see the
|
||||||
# following page: https://dart.dev/tools/pub/pubspec
|
# following page: https://dart.dev/tools/pub/pubspec
|
||||||
|
|
||||||
|
@ -1,12 +1,11 @@
|
|||||||
name: pocketpy
|
name: pocketpy
|
||||||
description: A lightweight Python interpreter for game engines.
|
description: A lightweight Python interpreter for game engines.
|
||||||
version: 0.4.8+2
|
version: 0.4.8+3
|
||||||
homepage: https://pocketpy.dev
|
homepage: https://pocketpy.dev
|
||||||
repository: https://github.com/blueloveth/pocketpy
|
repository: https://github.com/blueloveth/pocketpy
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: '>=2.18.2 <3.0.0'
|
sdk: '>=2.17.0 <3.0.0'
|
||||||
flutter: ">=2.5.0"
|
|
||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
flutter:
|
flutter:
|
||||||
|
@ -3779,7 +3779,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
Frame(const CodeObject* code, PyVar _module, PyVarDict&& locals)
|
Frame(const CodeObject* code, PyVar _module, PyVarDict&& locals)
|
||||||
: code(code), _module(_module), f_locals(locals) {
|
: code(code), _module(_module), f_locals(std::move(locals)) {
|
||||||
|
|
||||||
static uint64_t frame_id = 1;
|
static uint64_t frame_id = 1;
|
||||||
id = frame_id++;
|
id = frame_id++;
|
||||||
@ -3829,12 +3829,9 @@ public:
|
|||||||
return __deref_pointer(vm, s_data[s_data.size() + n]);
|
return __deref_pointer(vm, s_data[s_data.size() + n]);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void push(const PyVar& v){
|
template<typename T>
|
||||||
s_data.push_back(v);
|
inline void push(T&& obj){
|
||||||
}
|
s_data.push_back(std::forward<T>(obj));
|
||||||
|
|
||||||
inline void push(PyVar&& v){
|
|
||||||
s_data.emplace_back(std::move(v));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -4315,14 +4312,13 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
PyVar fastCall(const _Str& name, pkpy::ArgList&& args){
|
PyVar fastCall(const _Str& name, pkpy::ArgList&& args){
|
||||||
const PyVar& obj = args[0];
|
PyObject* cls = args[0]->_type.get();
|
||||||
PyObject* cls = obj->_type.get();
|
|
||||||
while(cls != None.get()) {
|
while(cls != None.get()) {
|
||||||
auto it = cls->attribs.find(name);
|
auto it = cls->attribs.find(name);
|
||||||
if(it != cls->attribs.end()) return call(it->second, std::move(args));
|
if(it != cls->attribs.end()) return call(it->second, std::move(args));
|
||||||
cls = cls->attribs[__base__].get();
|
cls = cls->attribs[__base__].get();
|
||||||
}
|
}
|
||||||
attributeError(obj, name);
|
attributeError(args[0], name);
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4330,12 +4326,16 @@ public:
|
|||||||
return call(_callable, pkpy::noArg(), pkpy::noArg(), false);
|
return call(_callable, pkpy::noArg(), pkpy::noArg(), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline PyVar call(const PyVar& _callable, pkpy::ArgList args){
|
template<typename ArgT>
|
||||||
return call(_callable, args, pkpy::noArg(), false);
|
inline std::enable_if_t<std::is_same_v<std::remove_const_t<std::remove_reference_t<ArgT>>, pkpy::ArgList>, PyVar>
|
||||||
|
call(const PyVar& _callable, ArgT&& args){
|
||||||
|
return call(_callable, std::forward<ArgT>(args), pkpy::noArg(), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline PyVar call(const PyVar& obj, const _Str& func, pkpy::ArgList args){
|
template<typename ArgT>
|
||||||
return call(getAttr(obj, func), args, pkpy::noArg(), false);
|
inline std::enable_if_t<std::is_same_v<std::remove_const_t<std::remove_reference_t<ArgT>>, pkpy::ArgList>, PyVar>
|
||||||
|
call(const PyVar& obj, const _Str& func, ArgT&& args){
|
||||||
|
return call(getAttr(obj, func), std::forward<ArgT>(args), pkpy::noArg(), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline PyVar call(const PyVar& obj, const _Str& func){
|
inline PyVar call(const PyVar& obj, const _Str& func){
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit 81b5fc7f112d83abc6fd93824397017e3d837921
|
Subproject commit 70637fe5198a3dc5d130781987b3cf2b46de3efc
|
@ -3779,7 +3779,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
Frame(const CodeObject* code, PyVar _module, PyVarDict&& locals)
|
Frame(const CodeObject* code, PyVar _module, PyVarDict&& locals)
|
||||||
: code(code), _module(_module), f_locals(locals) {
|
: code(code), _module(_module), f_locals(std::move(locals)) {
|
||||||
|
|
||||||
static uint64_t frame_id = 1;
|
static uint64_t frame_id = 1;
|
||||||
id = frame_id++;
|
id = frame_id++;
|
||||||
@ -3829,12 +3829,9 @@ public:
|
|||||||
return __deref_pointer(vm, s_data[s_data.size() + n]);
|
return __deref_pointer(vm, s_data[s_data.size() + n]);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void push(const PyVar& v){
|
template<typename T>
|
||||||
s_data.push_back(v);
|
inline void push(T&& obj){
|
||||||
}
|
s_data.push_back(std::forward<T>(obj));
|
||||||
|
|
||||||
inline void push(PyVar&& v){
|
|
||||||
s_data.emplace_back(std::move(v));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -4315,14 +4312,13 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
PyVar fastCall(const _Str& name, pkpy::ArgList&& args){
|
PyVar fastCall(const _Str& name, pkpy::ArgList&& args){
|
||||||
const PyVar& obj = args[0];
|
PyObject* cls = args[0]->_type.get();
|
||||||
PyObject* cls = obj->_type.get();
|
|
||||||
while(cls != None.get()) {
|
while(cls != None.get()) {
|
||||||
auto it = cls->attribs.find(name);
|
auto it = cls->attribs.find(name);
|
||||||
if(it != cls->attribs.end()) return call(it->second, std::move(args));
|
if(it != cls->attribs.end()) return call(it->second, std::move(args));
|
||||||
cls = cls->attribs[__base__].get();
|
cls = cls->attribs[__base__].get();
|
||||||
}
|
}
|
||||||
attributeError(obj, name);
|
attributeError(args[0], name);
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4330,12 +4326,16 @@ public:
|
|||||||
return call(_callable, pkpy::noArg(), pkpy::noArg(), false);
|
return call(_callable, pkpy::noArg(), pkpy::noArg(), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline PyVar call(const PyVar& _callable, pkpy::ArgList args){
|
template<typename ArgT>
|
||||||
return call(_callable, args, pkpy::noArg(), false);
|
inline std::enable_if_t<std::is_same_v<std::remove_const_t<std::remove_reference_t<ArgT>>, pkpy::ArgList>, PyVar>
|
||||||
|
call(const PyVar& _callable, ArgT&& args){
|
||||||
|
return call(_callable, std::forward<ArgT>(args), pkpy::noArg(), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline PyVar call(const PyVar& obj, const _Str& func, pkpy::ArgList args){
|
template<typename ArgT>
|
||||||
return call(getAttr(obj, func), args, pkpy::noArg(), false);
|
inline std::enable_if_t<std::is_same_v<std::remove_const_t<std::remove_reference_t<ArgT>>, pkpy::ArgList>, PyVar>
|
||||||
|
call(const PyVar& obj, const _Str& func, ArgT&& args){
|
||||||
|
return call(getAttr(obj, func), std::forward<ArgT>(args), pkpy::noArg(), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline PyVar call(const PyVar& obj, const _Str& func){
|
inline PyVar call(const PyVar& obj, const _Str& func){
|
||||||
|
@ -142,7 +142,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
Frame(const CodeObject* code, PyVar _module, PyVarDict&& locals)
|
Frame(const CodeObject* code, PyVar _module, PyVarDict&& locals)
|
||||||
: code(code), _module(_module), f_locals(locals) {
|
: code(code), _module(_module), f_locals(std::move(locals)) {
|
||||||
|
|
||||||
static uint64_t frame_id = 1;
|
static uint64_t frame_id = 1;
|
||||||
id = frame_id++;
|
id = frame_id++;
|
||||||
@ -192,12 +192,9 @@ public:
|
|||||||
return __deref_pointer(vm, s_data[s_data.size() + n]);
|
return __deref_pointer(vm, s_data[s_data.size() + n]);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void push(const PyVar& v){
|
template<typename T>
|
||||||
s_data.push_back(v);
|
inline void push(T&& obj){
|
||||||
}
|
s_data.push_back(std::forward<T>(obj));
|
||||||
|
|
||||||
inline void push(PyVar&& v){
|
|
||||||
s_data.emplace_back(std::move(v));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
17
src/vm.h
17
src/vm.h
@ -438,14 +438,13 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
PyVar fastCall(const _Str& name, pkpy::ArgList&& args){
|
PyVar fastCall(const _Str& name, pkpy::ArgList&& args){
|
||||||
const PyVar& obj = args[0];
|
PyObject* cls = args[0]->_type.get();
|
||||||
PyObject* cls = obj->_type.get();
|
|
||||||
while(cls != None.get()) {
|
while(cls != None.get()) {
|
||||||
auto it = cls->attribs.find(name);
|
auto it = cls->attribs.find(name);
|
||||||
if(it != cls->attribs.end()) return call(it->second, std::move(args));
|
if(it != cls->attribs.end()) return call(it->second, std::move(args));
|
||||||
cls = cls->attribs[__base__].get();
|
cls = cls->attribs[__base__].get();
|
||||||
}
|
}
|
||||||
attributeError(obj, name);
|
attributeError(args[0], name);
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -453,12 +452,16 @@ public:
|
|||||||
return call(_callable, pkpy::noArg(), pkpy::noArg(), false);
|
return call(_callable, pkpy::noArg(), pkpy::noArg(), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline PyVar call(const PyVar& _callable, pkpy::ArgList args){
|
template<typename ArgT>
|
||||||
return call(_callable, args, pkpy::noArg(), false);
|
inline std::enable_if_t<std::is_same_v<std::remove_const_t<std::remove_reference_t<ArgT>>, pkpy::ArgList>, PyVar>
|
||||||
|
call(const PyVar& _callable, ArgT&& args){
|
||||||
|
return call(_callable, std::forward<ArgT>(args), pkpy::noArg(), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline PyVar call(const PyVar& obj, const _Str& func, pkpy::ArgList args){
|
template<typename ArgT>
|
||||||
return call(getAttr(obj, func), args, pkpy::noArg(), false);
|
inline std::enable_if_t<std::is_same_v<std::remove_const_t<std::remove_reference_t<ArgT>>, pkpy::ArgList>, PyVar>
|
||||||
|
call(const PyVar& obj, const _Str& func, ArgT&& args){
|
||||||
|
return call(getAttr(obj, func), std::forward<ArgT>(args), pkpy::noArg(), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline PyVar call(const PyVar& obj, const _Str& func){
|
inline PyVar call(const PyVar& obj, const _Str& func){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user