smalltalk: super send + top-level temps + 9 super tests
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Has been cancelled

This commit is contained in:
2026-04-25 03:15:39 +00:00
parent 45147bd8a6
commit 82bad15b13
5 changed files with 218 additions and 20 deletions

View File

@@ -883,9 +883,30 @@
:pragmas pragmas
:body body}))))
;; Top-level program: statements separated by '.'
;; Top-level program: optional temp declaration, then statements
;; separated by '.'. Pharo workspace-style scripts allow
;; `| temps | body...` at the top level.
(cond
((= mode "expr") (parse-expression))
((= mode "method") (parse-method))
(else
{:type "seq" :exprs (parse-statements "eof")}))))))
(let ((temps (list)))
(begin
(when
(at? "bar" nil)
(begin
(advance-tok!)
(define
tt-loop
(fn
()
(when
(at-type? "ident")
(let ((t (peek-tok)))
(begin
(advance-tok!)
(append! temps (st-tok-value t))
(tt-loop))))))
(tt-loop)
(consume! "bar" nil)))
{:type "seq" :temps temps :exprs (parse-statements "eof")}))))))))