Skip to content

Commit

Permalink
fix: support latest Erg version
Browse files Browse the repository at this point in the history
  • Loading branch information
mtshiba committed Feb 15, 2024
1 parent c869360 commit 33a867f
Show file tree
Hide file tree
Showing 10 changed files with 4,079 additions and 2,691 deletions.
19 changes: 9 additions & 10 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "erg-playground"
version = "0.1.0"
authors = ["Shunsuke Shibayama <[email protected]>"]
edition = "2018"
edition = "2021"

[lib]
crate-type = ["cdylib", "rlib"]
Expand All @@ -11,10 +11,10 @@ crate-type = ["cdylib", "rlib"]
default = ["console_error_panic_hook"]

[dependencies]
wasm-bindgen = "0.2.63"
erg_common = { git = "https://github.com/erg-lang/erg", version = "0.5.12" }
erg_compiler = { git = "https://github.com/erg-lang/erg", version = "0.5.12" }
rustpython_wasm = { git = "https://github.com/rustpython/rustpython", version = "0.1.2" }
wasm-bindgen = "=0.2.87"
erg_common = { git = "https://github.com/erg-lang/erg", features = ["no_std"] }
erg_compiler = { git = "https://github.com/erg-lang/erg", features = ["no_std"] }
rustpython_wasm = { git = "https://github.com/rustpython/rustpython", version = "0.3.0" }
once_cell = "1.16.0"

# The `console_error_panic_hook` crate provides better debugging of panics by
Expand All @@ -23,14 +23,13 @@ once_cell = "1.16.0"
# code size when deploying.
console_error_panic_hook = { version = "0.1.6", optional = true }

# `wee_alloc` is a tiny allocator for wasm that is only ~1K in code size
# compared to the default allocator's ~10K. It is slower than the default
# allocator, however.
wee_alloc = { version = "0.4.5", optional = true }

[dev-dependencies]
wasm-bindgen-test = "0.3.13"

[profile.release]
# Tell `rustc` to optimize for small code size.
opt-level = "s"

[profile.dev]
opt-level = 1
incremental = true
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,11 @@
![Screenshot](screenshot.png)

[Try it here](https://erg-lang.org/web-repl/)

## Development

```sh
npm install
npm run full_build
npm run start # starts a local server
```
24 changes: 12 additions & 12 deletions docs/0.bootstrap.js

Large diffs are not rendered by default.

Binary file removed docs/16f39126a9685f22adf9.module.wasm
Binary file not shown.
Binary file added docs/a5172e4877b93ae6db47.module.wasm
Binary file not shown.
453 changes: 228 additions & 225 deletions docs/bootstrap.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const action = function(command, term) {
result = result.replace("<<RuntimeError>>", "").split("\n");
let code = result[0];
result = result.slice(1).join("\n");
term.error(`invalid code:\n${code}`);
term.error(`error:\n${code}`);
term.error(result);
} else if (result.length > 0) {
term.echo(result);
Expand Down
Loading

0 comments on commit 33a867f

Please sign in to comment.