The Lambda Lab
/
projects
/
ez.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
6f7b0f5
)
Scaffolding for input processing.
author
plugd
<plugd@thelambdalab.xyz>
Tue, 4 Oct 2022 07:15:09 +0000
(09:15 +0200)
committer
plugd
<plugd@thelambdalab.xyz>
Tue, 4 Oct 2022 07:15:09 +0000
(09:15 +0200)
ez.el
patch
|
blob
|
history
diff --git
a/ez.el
b/ez.el
index
7a91e57
..
f96005a
100644
(file)
--- a/
ez.el
+++ b/
ez.el
@@
-840,12
+840,19
@@
(ez-print (ez-get-obj-name obj)))
'run)
(ez-print (ez-get-obj-name obj)))
'run)
+(defvar ez--next-read-args nil)
(defun ez-op-read (operands operand-types)
(let ((baddr1 (car operands))
(baddr2 (cadr operands)))
(defun ez-op-read (operands operand-types)
(let ((baddr1 (car operands))
(baddr2 (cadr operands)))
- )
+
(setq ez--next-read-args (list baddr1 baddr2))
)
'wait-for-input)
'wait-for-input)
+(defun ez-op-read2 (input-string)
+ (ez-tokenize-string input-string
+ (car ez--next-read-args)
+ (cadr ez--next-read-args))
+ 'run)
+
;; Execution loop
(defun ez-load-and-run (filename)
;; Execution loop
(defun ez-load-and-run (filename)
@@
-888,8
+895,12
@@
(defun ez-enter ()
(interactive)
(defun ez-enter ()
(interactive)
- (with-current-buffer "*ez*"
- (buffer-substring ez-input-marker (point-max))))
+ (if (not (eq ez-machine-state 'wait-for-input))
+ (error "Z-machine not ready for input."))
+ (let ((input-string (with-current-buffer "*ez*"
+ (buffer-substring ez-input-marker (point-max)))))
+ (ez-op-read2 input-string)
+ (ez-run)))
;; Mode
;; Mode