rpiclang 0.0.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- rpiclang-0.0.2/Cargo.toml +22 -0
- rpiclang-0.0.2/PKG-INFO +48 -0
- rpiclang-0.0.2/README.md +31 -0
- rpiclang-0.0.2/bindings/python/Cargo.lock +980 -0
- rpiclang-0.0.2/bindings/python/Cargo.toml +20 -0
- rpiclang-0.0.2/bindings/python/README.md +31 -0
- rpiclang-0.0.2/bindings/python/src/lib.rs +65 -0
- rpiclang-0.0.2/crates/core/Cargo.toml +18 -0
- rpiclang-0.0.2/crates/core/src/ast.rs +300 -0
- rpiclang-0.0.2/crates/core/src/eval.rs +1354 -0
- rpiclang-0.0.2/crates/core/src/geom.rs +150 -0
- rpiclang-0.0.2/crates/core/src/ir.rs +141 -0
- rpiclang-0.0.2/crates/core/src/lexer.rs +725 -0
- rpiclang-0.0.2/crates/core/src/lib.rs +138 -0
- rpiclang-0.0.2/crates/core/src/parser.rs +1468 -0
- rpiclang-0.0.2/crates/core/src/std/circuits.pic +1046 -0
- rpiclang-0.0.2/crates/core/src/svg.rs +421 -0
- rpiclang-0.0.2/crates/core/src/token.rs +275 -0
- rpiclang-0.0.2/crates/render/Cargo.toml +14 -0
- rpiclang-0.0.2/crates/render/src/lib.rs +68 -0
- rpiclang-0.0.2/pyproject.toml +28 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# rpic — a modern, SVG/PNG/PDF-first reimplementation of the pic graphics
|
|
2
|
+
# language (Kernighan 1982) in Rust, descended in spirit from dpic (J.D.
|
|
3
|
+
# Aplevich).
|
|
4
|
+
[workspace]
|
|
5
|
+
resolver = "2"
|
|
6
|
+
members = [
|
|
7
|
+
"crates/core",
|
|
8
|
+
"crates/render",
|
|
9
|
+
"crates/cli",
|
|
10
|
+
"crates/capi",
|
|
11
|
+
]
|
|
12
|
+
|
|
13
|
+
[workspace.package]
|
|
14
|
+
version = "0.0.2"
|
|
15
|
+
edition = "2024"
|
|
16
|
+
license = "BSD-2-Clause"
|
|
17
|
+
authors = ["André Leite <leite@de.ufpe.br>"]
|
|
18
|
+
repository = "https://github.com/leite/dpic"
|
|
19
|
+
|
|
20
|
+
[profile.release]
|
|
21
|
+
opt-level = 3
|
|
22
|
+
lto = "thin"
|
rpiclang-0.0.2/PKG-INFO
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: rpiclang
|
|
3
|
+
Version: 0.0.2
|
|
4
|
+
Classifier: Programming Language :: Rust
|
|
5
|
+
Classifier: Programming Language :: Python :: 3
|
|
6
|
+
Classifier: Topic :: Multimedia :: Graphics
|
|
7
|
+
Classifier: License :: OSI Approved :: BSD License
|
|
8
|
+
Summary: Python bindings for rpic — the pic graphics language → SVG/PNG/PDF with animation.
|
|
9
|
+
Author-email: André Leite <leite@de.ufpe.br>
|
|
10
|
+
License: BSD-2-Clause
|
|
11
|
+
Requires-Python: >=3.9
|
|
12
|
+
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
13
|
+
Project-URL: Homepage, https://github.com/milkway/rpic-lang
|
|
14
|
+
Project-URL: Issues, https://github.com/milkway/rpic-lang/issues
|
|
15
|
+
Project-URL: Repository, https://github.com/milkway/rpic-lang
|
|
16
|
+
|
|
17
|
+
# rpiclang (Python)
|
|
18
|
+
|
|
19
|
+
Python bindings for [rpic](https://github.com/milkway/rpic-lang) — the pic
|
|
20
|
+
graphics language rendered to SVG / PNG / PDF, with animation manifests.
|
|
21
|
+
|
|
22
|
+
```sh
|
|
23
|
+
pip install rpiclang # distribution name; you `import rpic`
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
```python
|
|
27
|
+
import rpic, json
|
|
28
|
+
|
|
29
|
+
svg = rpic.render_svg('box "hi"; arrow; circle "x"')
|
|
30
|
+
open("out.png", "wb").write(rpic.render_png("box \"hi\"", scale=2.0))
|
|
31
|
+
open("out.pdf", "wb").write(rpic.render_pdf("box \"hi\""))
|
|
32
|
+
|
|
33
|
+
# circuit library:
|
|
34
|
+
svg = rpic.render_svg('A:(0,0); B:(2,0)\nresistor(A,B)', circuits=True)
|
|
35
|
+
|
|
36
|
+
# svg + animation manifest:
|
|
37
|
+
bundle = json.loads(rpic.compile_json('box\nanimate last box with "pop"'))
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Build
|
|
41
|
+
|
|
42
|
+
```sh
|
|
43
|
+
pip install maturin
|
|
44
|
+
cd bindings/python
|
|
45
|
+
maturin develop --release # installs into the current environment
|
|
46
|
+
# or: maturin build --release → wheels in target/wheels/
|
|
47
|
+
```
|
|
48
|
+
|
rpiclang-0.0.2/README.md
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# rpiclang (Python)
|
|
2
|
+
|
|
3
|
+
Python bindings for [rpic](https://github.com/milkway/rpic-lang) — the pic
|
|
4
|
+
graphics language rendered to SVG / PNG / PDF, with animation manifests.
|
|
5
|
+
|
|
6
|
+
```sh
|
|
7
|
+
pip install rpiclang # distribution name; you `import rpic`
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
```python
|
|
11
|
+
import rpic, json
|
|
12
|
+
|
|
13
|
+
svg = rpic.render_svg('box "hi"; arrow; circle "x"')
|
|
14
|
+
open("out.png", "wb").write(rpic.render_png("box \"hi\"", scale=2.0))
|
|
15
|
+
open("out.pdf", "wb").write(rpic.render_pdf("box \"hi\""))
|
|
16
|
+
|
|
17
|
+
# circuit library:
|
|
18
|
+
svg = rpic.render_svg('A:(0,0); B:(2,0)\nresistor(A,B)', circuits=True)
|
|
19
|
+
|
|
20
|
+
# svg + animation manifest:
|
|
21
|
+
bundle = json.loads(rpic.compile_json('box\nanimate last box with "pop"'))
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Build
|
|
25
|
+
|
|
26
|
+
```sh
|
|
27
|
+
pip install maturin
|
|
28
|
+
cd bindings/python
|
|
29
|
+
maturin develop --release # installs into the current environment
|
|
30
|
+
# or: maturin build --release → wheels in target/wheels/
|
|
31
|
+
```
|