diff --git a/module/mes/M1.mes b/module/mes/M1.mes index 7868ec46..72f09b0e 100644 --- a/module/mes/M1.mes +++ b/module/mes/M1.mes @@ -1,7 +1,7 @@ ;;; -*-scheme-*- ;;; Mes --- Maxwell Equations of Software -;;; Copyright © 2017 Jan Nieuwenhuizen +;;; Copyright © 2017,2018 Jan Nieuwenhuizen ;;; ;;; This file is part of Mes. ;;; @@ -150,14 +150,14 @@ (data (filter-map labelize data)) (len (length data)) (string-max (or (and=> (getenv "M1_STRING_MAX") string->number) 80))) - (format #t "\n:~a\n" label) + (display (string-append "\n:" label "\n")) (cond ((and (< len string-max) (char? (car data)) (eq? (last data) #\nul) (not (find (cut memq <> '(#\nul #\backspace #\return #\" #\')) (list-head data (1- (length data))))) (not (any (lambda (ch) (>= (char->integer ch) #x80)) data))) - (format #t "\"~a\"" (list->string (list-head data (1- (length data)))))) - (else (format #t "~a" (string-join (map text->M1 data) " ")))) + (display (string-append "\"" (list->string (list-head data (1- (length data)))) "\""))) + (else (display (string-join (map text->M1 data) " ")))) (newline))) (for-each write-function (filter cdr functions)) (when (assoc-ref functions "main") diff --git a/scripts/mescc.mes b/scripts/mescc.mes index 8e908838..0f3e591b 100755 --- a/scripts/mescc.mes +++ b/scripts/mescc.mes @@ -19,7 +19,7 @@ exit $? !# ;;; Mes --- Maxwell Equations of Software -;;; Copyright © 2016,2017 Jan Nieuwenhuizen +;;; Copyright © 2016,2017,2018 Jan Nieuwenhuizen ;;; ;;; This file is part of Mes. ;;; @@ -51,6 +51,7 @@ exit $? (mes-use-module (mes pretty-print)) (mes-use-module (language c99 info)) (mes-use-module (language c99 compiler)) +(mes-use-module (mes display)) (mes-use-module (mes elf)) (mes-use-module (mes M1)) (mes-use-module (srfi srfi-1)) @@ -108,7 +109,7 @@ Usage: mescc.mes [OPTION]... FILE... (lambda (file) (with-input-from-file file (lambda () - (pretty-print (c99-input->ast #:defines defines #:includes includes)))))) + (write (c99-input->ast #:defines defines #:includes includes)))))) (define (source->info defines includes) (lambda (file)