mirror of
https://github.com/pocketpy/pocketpy
synced 2026-02-27 09:50:17 +00:00
Compare commits
No commits in common. "98fabb45bf369d761656e72b105940c00183ea4d" and "0c965d8c5b0077ca74cae55c194c51f08a9e2a87" have entirely different histories.
98fabb45bf
...
0c965d8c5b
@ -36,7 +36,6 @@ Please see https://pocketpy.dev for details and try the following resources.
|
|||||||
+ [Godot Extension](https://github.com/pocketpy/godot-pocketpy): Use pocketpy in Godot Engine
|
+ [Godot Extension](https://github.com/pocketpy/godot-pocketpy): Use pocketpy in Godot Engine
|
||||||
+ [VSCode Extension](https://marketplace.visualstudio.com/items?itemName=pocketpy.pocketpy): Debug and profile pocketpy scripts in VSCode
|
+ [VSCode Extension](https://marketplace.visualstudio.com/items?itemName=pocketpy.pocketpy): Debug and profile pocketpy scripts in VSCode
|
||||||
+ [Flutter Plugin](https://pub.dev/packages/pocketpy): Use pocketpy in Flutter apps
|
+ [Flutter Plugin](https://pub.dev/packages/pocketpy): Use pocketpy in Flutter apps
|
||||||
+ [Raylib Bindings](https://github.com/pocketpy/raylib-bindings): Use raylib with pocketpy
|
|
||||||
|
|
||||||
## Supported Platforms
|
## Supported Platforms
|
||||||
|
|
||||||
@ -112,7 +111,7 @@ int main() {
|
|||||||
if(!ok) goto __ERROR;
|
if(!ok) goto __ERROR;
|
||||||
|
|
||||||
// Create a list: [1, 2, 3]
|
// Create a list: [1, 2, 3]
|
||||||
py_Ref r0 = py_tmpr0();
|
py_Ref r0 = py_getreg(0);
|
||||||
py_newlistn(r0, 3);
|
py_newlistn(r0, 3);
|
||||||
py_newint(py_list_getitem(r0, 0), 1);
|
py_newint(py_list_getitem(r0, 0), 1);
|
||||||
py_newint(py_list_getitem(r0, 1), 2);
|
py_newint(py_list_getitem(r0, 1), 2);
|
||||||
|
|||||||
@ -15,7 +15,6 @@ Developers are able to write Python bindings via C-API or pybind11 compatible in
|
|||||||
+ [Godot Extension](https://github.com/pocketpy/godot-pocketpy): Use pocketpy in Godot Engine
|
+ [Godot Extension](https://github.com/pocketpy/godot-pocketpy): Use pocketpy in Godot Engine
|
||||||
+ [VSCode Extension](https://marketplace.visualstudio.com/items?itemName=pocketpy.pocketpy): Debug and profile pocketpy scripts in VSCode
|
+ [VSCode Extension](https://marketplace.visualstudio.com/items?itemName=pocketpy.pocketpy): Debug and profile pocketpy scripts in VSCode
|
||||||
+ [Flutter Plugin](https://pub.dev/packages/pocketpy): Use pocketpy in Flutter apps
|
+ [Flutter Plugin](https://pub.dev/packages/pocketpy): Use pocketpy in Flutter apps
|
||||||
+ [Raylib Bindings](https://github.com/pocketpy/raylib-bindings): Use raylib with pocketpy
|
|
||||||
|
|
||||||
## What it looks like
|
## What it looks like
|
||||||
|
|
||||||
|
|||||||
@ -85,7 +85,7 @@ int main() {
|
|||||||
if(!ok) goto __ERROR;
|
if(!ok) goto __ERROR;
|
||||||
|
|
||||||
// Create a list: [1, 2, 3]
|
// Create a list: [1, 2, 3]
|
||||||
py_Ref r0 = py_tmpr0();
|
py_Ref r0 = py_getreg(0);
|
||||||
py_newlistn(r0, 3);
|
py_newlistn(r0, 3);
|
||||||
py_newint(py_list_getitem(r0, 0), 1);
|
py_newint(py_list_getitem(r0, 0), 1);
|
||||||
py_newint(py_list_getitem(r0, 1), 2);
|
py_newint(py_list_getitem(r0, 1), 2);
|
||||||
|
|||||||
@ -19,14 +19,14 @@ class Library:
|
|||||||
self.functions = [] # type: list[Function]
|
self.functions = [] # type: list[Function]
|
||||||
self.callbacks = set() # type: set[str]
|
self.callbacks = set() # type: set[str]
|
||||||
|
|
||||||
def unalias(self, name: str) -> c_ast.Node | str:
|
def unalias(self, name: str) -> c_ast.Node:
|
||||||
while name in self.aliases:
|
while name in self.aliases:
|
||||||
node = self.aliases[name]
|
node = self.aliases[name]
|
||||||
if isinstance(node, str):
|
if isinstance(node, str):
|
||||||
name = node
|
name = node
|
||||||
else:
|
else:
|
||||||
return node
|
return node
|
||||||
return name
|
assert False, f'alias {name} not found'
|
||||||
|
|
||||||
def build(self, *, glue_dir='.', stub_dir='.', includes: list[str] | None = None):
|
def build(self, *, glue_dir='.', stub_dir='.', includes: list[str] | None = None):
|
||||||
self.remove_unsupported()
|
self.remove_unsupported()
|
||||||
|
|||||||
@ -20,7 +20,7 @@ int main() {
|
|||||||
if(!ok) goto __ERROR;
|
if(!ok) goto __ERROR;
|
||||||
|
|
||||||
// Create a list: [1, 2, 3]
|
// Create a list: [1, 2, 3]
|
||||||
py_Ref r0 = py_tmpr0();
|
py_Ref r0 = py_getreg(0);
|
||||||
py_newlistn(r0, 3);
|
py_newlistn(r0, 3);
|
||||||
py_newint(py_list_getitem(r0, 0), 1);
|
py_newint(py_list_getitem(r0, 0), 1);
|
||||||
py_newint(py_list_getitem(r0, 1), 2);
|
py_newint(py_list_getitem(r0, 1), 2);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user