File tree Expand file tree Collapse file tree 2 files changed +11
-4
lines changed
Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change 313313 cm2))])])]
314314 [(PStruct n ps)
315315 (match (compile-struct-patterns ps (cons #f cm) next 1 )
316- [(list i f cm )
316+ [(list i f cm1 )
317317 (let ((fail (gensym)))
318318 (list
319- (seq (Mov r8 rax)
319+ (seq (%%% "struct " )
320+ (Mov r8 rax)
320321 (And r8 ptr-mask)
321322 (Cmp r8 type-struct)
322323 (Jne fail)
331332 (Label fail)
332333 (Add rsp (* 8 (length cm)))
333334 (Jmp next))
334- cm ))])]))
335+ cm1 ))])]))
335336
336337;; [Listof Pat] CEnv Symbol Nat -> (list Asm Asm CEnv)
337338(define (compile-struct-patterns ps cm next i)
Original file line number Diff line number Diff line change 428428 #f )
429429 (check-equal? (run '(struct foo (x))
430430 '(foo-x #t ))
431- 'err ))
431+ 'err )
432+ (check-equal? (run '(struct foo (x))
433+ '(struct bar (y))
434+ '(match (bar 5 )
435+ [(foo x) #f ]
436+ [(bar x) x]))
437+ 5 ))
432438
433439(define (test-runner-io run)
434440 ;; Evildoer examples
You can’t perform that action at this time.
0 commit comments