mirror of
https://github.com/pocketpy/pocketpy
synced 2026-02-22 15:30:21 +00:00
Compare commits
3 Commits
0c965d8c5b
...
98fabb45bf
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
98fabb45bf | ||
|
|
3fe55bbe76 | ||
|
|
d9a7798891 |
@ -36,6 +36,7 @@ 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
|
||||||
|
|
||||||
@ -111,7 +112,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_getreg(0);
|
py_Ref r0 = py_tmpr0();
|
||||||
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,6 +15,7 @@ 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_getreg(0);
|
py_Ref r0 = py_tmpr0();
|
||||||
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:
|
def unalias(self, name: str) -> c_ast.Node | str:
|
||||||
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
|
||||||
assert False, f'alias {name} not found'
|
return name
|
||||||
|
|
||||||
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_getreg(0);
|
py_Ref r0 = py_tmpr0();
|
||||||
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