moving runtime.js to the js-assembler subdirectory
This commit is contained in:
parent
891e3c73b0
commit
387048f381
19
js-assembler/get-runtime.rkt
Normal file
19
js-assembler/get-runtime.rkt
Normal file
|
@ -0,0 +1,19 @@
|
|||
#lang racket/base
|
||||
|
||||
;; Function to get the runtime library.
|
||||
|
||||
(require racket/contract
|
||||
racket/runtime-path
|
||||
racket/port)
|
||||
|
||||
|
||||
(provide/contract [get-runtime (-> string?)])
|
||||
|
||||
(define-runtime-path runtime.js "runtime.js")
|
||||
|
||||
(define text (call-with-input-file runtime.js
|
||||
(lambda (ip)
|
||||
(port->string ip))))
|
||||
|
||||
(define (get-runtime)
|
||||
text)
|
|
@ -1,6 +1,7 @@
|
|||
#lang racket
|
||||
|
||||
(require "js-assembler/assemble.rkt"
|
||||
"js-assembler/get-runtime.rkt"
|
||||
"browser-evaluate.rkt"
|
||||
"lexical-structs.rkt"
|
||||
"il-structs.rkt"
|
||||
|
@ -8,9 +9,8 @@
|
|||
racket/promise
|
||||
racket/runtime-path)
|
||||
|
||||
(define-runtime-path runtime.js "runtime.js")
|
||||
(define runtime (call-with-input-file runtime.js
|
||||
(lambda (ip) (port->string ip))))
|
||||
(define runtime (get-runtime))
|
||||
|
||||
|
||||
; Test out the compiler, using the simulator.
|
||||
(define-syntax (test stx)
|
||||
|
|
|
@ -1,12 +1,10 @@
|
|||
#lang racket
|
||||
(require "browser-evaluate.rkt"
|
||||
(require "js-assembler/get-runtime.rkt"
|
||||
"browser-evaluate.rkt"
|
||||
"package.rkt"
|
||||
racket/runtime-path)
|
||||
|
||||
|
||||
(define-runtime-path runtime.js
|
||||
"runtime.js"
|
||||
#;"runtime.compressed.js")
|
||||
|
||||
(define evaluate (make-evaluate
|
||||
(lambda (program op)
|
||||
|
@ -14,9 +12,7 @@
|
|||
(fprintf op "(function () {")
|
||||
|
||||
;; The runtime code
|
||||
(call-with-input-file* runtime.js
|
||||
(lambda (ip)
|
||||
(copy-port ip op)))
|
||||
(displayln (get-runtime) op)
|
||||
|
||||
(newline op)
|
||||
|
||||
|
|
|
@ -1,20 +1,17 @@
|
|||
#lang racket
|
||||
(require "browser-evaluate.rkt"
|
||||
"package.rkt"
|
||||
"js-assembler/get-runtime.rkt"
|
||||
racket/port
|
||||
racket/runtime-path)
|
||||
|
||||
(define-runtime-path runtime.js "runtime.js")
|
||||
|
||||
(define evaluate (make-evaluate
|
||||
(lambda (program op)
|
||||
|
||||
(fprintf op "(function () {")
|
||||
|
||||
;; The runtime code
|
||||
(call-with-input-file* runtime.js
|
||||
(lambda (ip)
|
||||
(copy-port ip op)))
|
||||
(displayln (get-runtime) op)
|
||||
|
||||
(newline op)
|
||||
|
||||
|
|
|
@ -1,20 +1,17 @@
|
|||
#lang racket
|
||||
(require "browser-evaluate.rkt"
|
||||
"package.rkt"
|
||||
"js-assembler/get-runtime.rkt"
|
||||
racket/port
|
||||
racket/runtime-path)
|
||||
|
||||
(define-runtime-path runtime.js "runtime.js")
|
||||
|
||||
(define evaluate (make-evaluate
|
||||
(lambda (program op)
|
||||
|
||||
(fprintf op "(function () {")
|
||||
|
||||
;; The runtime code
|
||||
(call-with-input-file* runtime.js
|
||||
(lambda (ip)
|
||||
(copy-port ip op)))
|
||||
(displayln (get-runtime) op)
|
||||
|
||||
(newline op)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user