Skip to content

Commit

Permalink
crook
Browse files Browse the repository at this point in the history
  • Loading branch information
dvanhorn committed Nov 25, 2024
1 parent 5cb072e commit 30f8a88
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 6 deletions.
14 changes: 14 additions & 0 deletions iniquity-plus/exec-io.rkt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#lang racket
(require a86/interp)
(require "compile.rkt")
(require "interp-io.rkt")
(require "types.rkt")
(require "build-runtime.rkt")
(provide exec/io)
;; Prog String -> (cons Answer String)
(define (exec/io p in)
(parameterize ((current-objs (list (path->string runtime-path))))
(match (asm-interp/io (compile p) in)
[(cons 'err o) (cons 'err o)]
[(cons b o) (cons (bits->value b) o)])))

14 changes: 14 additions & 0 deletions iniquity-plus/exec.rkt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#lang racket
(require a86/interp)
(require "compile.rkt")
(require "interp.rkt")
(require "types.rkt")
(require "build-runtime.rkt")
(provide exec)
;; Prog -> Answer
(define (exec p)
(parameterize ((current-objs (list (path->string runtime-path))))
(match (asm-interp (compile p))
['err 'err]
[b (bits->value b)])))

7 changes: 4 additions & 3 deletions iniquity-plus/test/compile.rkt
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#lang racket
(require "../compile.rkt")
(require "../parse.rkt")
(require "../run.rkt")
(require "../exec.rkt")
(require "../exec-io.rkt")
(require "test-runner.rkt")
(test (λ p (run (compile (apply parse p)))))
(test/io (λ (in . p) (run/io (compile (apply parse p)) in)))
(test (λ p (exec (apply parse p))))
(test/io (λ (in . p) (exec/io (apply parse p) in)))

14 changes: 14 additions & 0 deletions knock-plus/exec-io.rkt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#lang racket
(require a86/interp)
(require "compile.rkt")
(require "interp-io.rkt")
(require "types.rkt")
(require "build-runtime.rkt")
(provide exec/io)
;; Prog String -> (cons Answer String)
(define (exec/io p in)
(parameterize ((current-objs (list (path->string runtime-path))))
(match (asm-interp/io (compile p) in)
[(cons 'err o) (cons 'err o)]
[(cons b o) (cons (bits->value b) o)])))

14 changes: 14 additions & 0 deletions knock-plus/exec.rkt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#lang racket
(require a86/interp)
(require "compile.rkt")
(require "interp.rkt")
(require "types.rkt")
(require "build-runtime.rkt")
(provide exec)
;; Prog -> Answer
(define (exec p)
(parameterize ((current-objs (list (path->string runtime-path))))
(match (asm-interp (compile p))
['err 'err]
[b (bits->value b)])))

7 changes: 4 additions & 3 deletions knock-plus/test/compile.rkt
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#lang racket
(require "../compile.rkt")
(require "../parse.rkt")
(require "../run.rkt")
(require "../exec.rkt")
(require "../exec-io.rkt")
(require "test-runner.rkt")
(test (λ p (run (compile (apply parse p)))))
(test/io (λ (in . p) (run/io (compile (apply parse p)) in)))
(test (λ p (exec (apply parse p))))
(test/io (λ (in . p) (exec/io (apply parse p) in)))

0 comments on commit 30f8a88

Please sign in to comment.