forth: CHAR/[CHAR]/KEY/ACCEPT (+7; Hayes 174/590)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled
This commit is contained in:
@@ -79,7 +79,7 @@ Representation:
|
||||
|
||||
### Phase 4 — strings + more Core
|
||||
- [x] `S"`, `C"`, `."`, `TYPE`, `COUNT`, `CMOVE`, `FILL`, `BLANK`
|
||||
- [ ] `CHAR`, `[CHAR]`, `KEY`, `ACCEPT`
|
||||
- [x] `CHAR`, `[CHAR]`, `KEY`, `ACCEPT`
|
||||
- [ ] `BASE` manipulation: `DECIMAL`, `HEX`
|
||||
- [ ] `DEPTH`, `SP@`, `SP!`
|
||||
- [ ] Drive Hayes Core pass-rate up
|
||||
@@ -99,6 +99,15 @@ Representation:
|
||||
|
||||
_Newest first._
|
||||
|
||||
- **Phase 4 — `CHAR`/`[CHAR]`/`KEY`/`ACCEPT` (+7 / Hayes 168→174).**
|
||||
`CHAR` parses the next token and pushes the first-char code. `[CHAR]`
|
||||
is IMMEDIATE: in compile mode it embeds the code as a compiled push
|
||||
op, in interpret mode it pushes inline. `KEY`/`ACCEPT` read from an
|
||||
optional `state.keybuf` string — empty buffer makes `KEY` raise
|
||||
`"no input available"` (matches ANS when stdin is closed) and
|
||||
`ACCEPT` returns `0`. Enough for Hayes to get past CHAR-gated
|
||||
clusters; real interactive IO lands later.
|
||||
|
||||
- **Phase 4 — strings: `S"`/`C"`/`."`/`TYPE`/`COUNT`/`CMOVE`/`CMOVE>`/`MOVE`/`FILL`/`BLANK`/`C@`/`C!`/`CHAR+`/`CHARS` (+16 / Hayes 165→168).**
|
||||
Added a byte-addressable memory model to state: `mem` (dict keyed by
|
||||
stringified address → integer byte) and `here` (next-free integer
|
||||
|
||||
Reference in New Issue
Block a user