From ba492401d9c9fd39bf1927ceb64f3c065fd0b26b Mon Sep 17 00:00:00 2001 From: Vishesh Yadav Date: Thu, 14 May 2015 17:32:23 -0400 Subject: [PATCH] FIX broken standalone build by ditching XHTML in favor of HTML #17 --- whalesong/js-assembler/package.rkt | 18 ++++++++---------- whalesong/selfhost/js-assembler/package.rkt | 18 ++++++++---------- whalesong/whalesong-cmd.rkt | 8 ++++---- whalesong/whalesong-helpers.rkt | 8 ++++---- 4 files changed, 24 insertions(+), 28 deletions(-) diff --git a/whalesong/js-assembler/package.rkt b/whalesong/js-assembler/package.rkt index a4c564f..0d4055f 100644 --- a/whalesong/js-assembler/package.rkt +++ b/whalesong/js-assembler/package.rkt @@ -1,7 +1,6 @@ #lang racket/base (require "assemble.rkt" - "quote-cdata.rkt" "../logger.rkt" "../make/make.rkt" "../make/make-structs.rkt" @@ -43,7 +42,7 @@ (provide package package-anonymous - package-standalone-xhtml + package-standalone-html get-inert-code get-standalone-code write-standalone-code @@ -506,14 +505,13 @@ M.installedModules[~s] = function() { -;; package-standalone-xhtml: X output-port -> void -(define (package-standalone-xhtml source-code op) +;; package-standalone-html: X output-port -> void +(define (package-standalone-html source-code op) (display (get-header) op) - (display (quote-cdata - (string-append (get-runtime) - (get-inert-code source-code - (lambda () (error 'package-standalone-xhtml))) - invoke-main-module-code)) op) + (display (string-append (get-runtime) + (get-inert-code source-code + (lambda () (error 'package-standalone-html))) + invoke-main-module-code) op) (display *footer* op)) @@ -591,7 +589,7 @@ M.installedModules[~s] = function() { (format #< - + diff --git a/whalesong/selfhost/js-assembler/package.rkt b/whalesong/selfhost/js-assembler/package.rkt index a4c564f..0d4055f 100644 --- a/whalesong/selfhost/js-assembler/package.rkt +++ b/whalesong/selfhost/js-assembler/package.rkt @@ -1,7 +1,6 @@ #lang racket/base (require "assemble.rkt" - "quote-cdata.rkt" "../logger.rkt" "../make/make.rkt" "../make/make-structs.rkt" @@ -43,7 +42,7 @@ (provide package package-anonymous - package-standalone-xhtml + package-standalone-html get-inert-code get-standalone-code write-standalone-code @@ -506,14 +505,13 @@ M.installedModules[~s] = function() { -;; package-standalone-xhtml: X output-port -> void -(define (package-standalone-xhtml source-code op) +;; package-standalone-html: X output-port -> void +(define (package-standalone-html source-code op) (display (get-header) op) - (display (quote-cdata - (string-append (get-runtime) - (get-inert-code source-code - (lambda () (error 'package-standalone-xhtml))) - invoke-main-module-code)) op) + (display (string-append (get-runtime) + (get-inert-code source-code + (lambda () (error 'package-standalone-html))) + invoke-main-module-code) op) (display *footer* op)) @@ -591,7 +589,7 @@ M.installedModules[~s] = function() { (format #< - + diff --git a/whalesong/whalesong-cmd.rkt b/whalesong/whalesong-cmd.rkt index 447fac3..623142b 100644 --- a/whalesong/whalesong-cmd.rkt +++ b/whalesong/whalesong-cmd.rkt @@ -17,7 +17,7 @@ ;; Usage: ;; -;; * Build standalone .xhtml application. +;; * Build standalone .html application. ;; ;; $ whalesong build main-module-name.rkt ;; @@ -102,8 +102,8 @@ dest-dir ("Set destination directory (default: current-directory)") (current-output-dir dest-dir)] - [("--as-standalone-xhtml") - ("Write single standalone xhtml file") + [("--as-standalone-html") + ("Write single standalone html file") (as-standalone-html? #t)] #:multi [("--include-script") @@ -115,7 +115,7 @@ (maybe-with-profiling (if (as-standalone-html?) - (build-standalone-xhtml path) + (build-standalone-html path) (build-html-and-javascript path)))] ["print-il" "print the intermediate translation of a module" diff --git a/whalesong/whalesong-helpers.rkt b/whalesong/whalesong-helpers.rkt index 9ad2efe..d48d080 100644 --- a/whalesong/whalesong-helpers.rkt +++ b/whalesong/whalesong-helpers.rkt @@ -94,7 +94,7 @@ (flush-output (current-report-port))])) (loop))))))) -(define (build-standalone-xhtml f) +(define (build-standalone-html f) (with-catchall-exception-handler (lambda () (turn-on-logger!) @@ -104,7 +104,7 @@ (build-path (regexp-replace #rx"[.](rkt|ss)$" (path->string filename) - ".xhtml"))]) + ".html"))]) (unless (directory-exists? (current-output-dir)) (fprintf (current-report-port) "Creating destination directory ~s\n" (current-output-dir)) (make-directory* (current-output-dir))) @@ -129,10 +129,10 @@ (build-path (current-output-dir) (resource-key r)))]))]) (fprintf (current-report-port) - (format "Writing program ~s\n" (build-path (current-output-port) output-filename))) + (format "Writing program ~s\n" (build-path (current-output-dir) output-filename))) (call-with-output-file* (build-path (current-output-dir) output-filename) (lambda (op) - (package-standalone-xhtml + (package-standalone-html (make-MainModuleSource (normalize-path (build-path f))) op))