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
cenv
(append-instruction-sequences
(make-instruction-sequence
`(,(make-AssignImmediateStatement target exp)
singular-context-check)))))]
(make-AssignImmediateStatement target exp)
singular-context-check)))]
[else
((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)])
#:transparent)
(define empty-instruction-sequence (make-instruction-sequence '()))
(define-predicate Statement? Statement)
(: statements (InstructionSequence -> (Listof Statement)))
(define (statements s)
@ -455,6 +457,8 @@
(list s)]
[(LinkedLabel? s)
(list s)]
[(Statement? s)
(list s)]
[else
(instruction-sequence-statements s)]))