smalltalk: super send + top-level temps + 9 super tests
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:
@@ -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")}))))))))
|
||||
|
||||
Reference in New Issue
Block a user