loosening instruction sequences to allow for statements as well.

This commit is contained in:
Danny Yoo 2011-05-23 14:23:57 -04:00
parent 45d8ec3330
commit 749253d8c4
2 changed files with 8 additions and 6 deletions

View File

@ -2021,13 +2021,11 @@
(end-with-linkage linkage (end-with-linkage linkage
cenv cenv
(append-instruction-sequences (append-instruction-sequences
(make-instruction-sequence (make-AssignImmediateStatement target exp)
`(,(make-AssignImmediateStatement target exp) singular-context-check)))]
singular-context-check)))))]
[else [else
((current-warn-unimplemented-kernel-primitive) id) ((current-warn-unimplemented-kernel-primitive) id)
(make-instruction-sequence (make-PerformStatement (make-RaiseUnimplementedPrimitiveError! id))])))
`(,(make-PerformStatement (make-RaiseUnimplementedPrimitiveError! id))))])))

View File

@ -442,12 +442,14 @@
(define-type InstructionSequence (U Symbol LinkedLabel instruction-sequence)) (define-type InstructionSequence (U Symbol LinkedLabel Statement instruction-sequence))
(define-struct: instruction-sequence ([statements : (Listof Statement)]) (define-struct: instruction-sequence ([statements : (Listof Statement)])
#:transparent) #:transparent)
(define empty-instruction-sequence (make-instruction-sequence '())) (define empty-instruction-sequence (make-instruction-sequence '()))
(define-predicate Statement? Statement)
(: statements (InstructionSequence -> (Listof Statement))) (: statements (InstructionSequence -> (Listof Statement)))
(define (statements s) (define (statements s)
@ -455,6 +457,8 @@
(list s)] (list s)]
[(LinkedLabel? s) [(LinkedLabel? s)
(list s)] (list s)]
[(Statement? s)
(list s)]
[else [else
(instruction-sequence-statements s)])) (instruction-sequence-statements s)]))