69309006a2
The CORE word was missing. QUIT empties the return stack, enters interpretation state, restores SOURCE-ID to the user input device and returns to the interpreter without a message, leaving the data stack untouched -- that last part is the whole difference to ABORT, which the standard defines as 'empty the data stack, then QUIT'. Implemented on the throw plumbing with the standard code -56, so nested EVALUATE / INCLUDE frames unwind and are abandoned on the way out. Two places treat -56 specially: CATCH lets it through (QUIT is a return to the prompt, not an exception) and evaluate() turns it into a silent Ok after the compile-state wipe it already performs. Semantics checked against gforth 0.7.3 and SwiftForth sf64, which agree: the data stack survives, nothing is printed, the rest of the input is abandoned, and '1 2 ' QUIT CATCH .' prints nothing while leaving 1 2. Six tests in outer.rs pin it. Deliberately NOT added to the cross-engine corpus: what QUIT abandons is the input source, and the three engines are fed differently there, so a comparison would measure the harness. The gap survived because the Forth 2012 suite skips QUIT by its own admission, and HELP's coverage lint compares dictionary against docs -- a word missing from both looks complete. docs/wafer-anki.txt had been documenting QUIT as if it existed. ABORT itself was already correct: executed while a definition is open it clears both stacks and returns to interpretation state. Ships as v0.2.5.
24 lines
543 B
TOML
24 lines
543 B
TOML
[package]
|
|
name = "wafer-web"
|
|
description = "WAFER browser REPL — WebAssembly Forth in the browser"
|
|
version.workspace = true
|
|
edition.workspace = true
|
|
license.workspace = true
|
|
|
|
[lints]
|
|
workspace = true
|
|
|
|
[lib]
|
|
crate-type = ["cdylib", "rlib"]
|
|
|
|
[dependencies]
|
|
wafer-core = { path = "../core", version = "0.2.5", default-features = false, features = ["crypto"] }
|
|
wasm-bindgen = "0.2"
|
|
js-sys = "0.3"
|
|
send_wrapper = { workspace = true }
|
|
wasm-encoder = { workspace = true }
|
|
anyhow = { workspace = true }
|
|
|
|
[dev-dependencies]
|
|
wasm-bindgen-test = "0.3"
|