The Lambda Lab
/
projects
/
ez.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Scaffolding for input processing.
[ez.git]
/
ez.el
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