From b9e78f806d34dbf2a3b9dc3eb9c3959a30513ef1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20V=C3=A1zquez?= Date: Thu, 20 Jun 2013 14:35:38 +0200 Subject: [PATCH] Move lisp-escape-string to print.lisp --- src/compiler.lisp | 15 --------------- src/print.lisp | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/compiler.lisp b/src/compiler.lisp index 49a31ff..22b318f 100644 --- a/src/compiler.lisp +++ b/src/compiler.lisp @@ -489,21 +489,6 @@ ;;; Compilation of literals an object dumping -(defun lisp-escape-string (string) - (let ((output "") - (index 0) - (size (length string))) - (while (< index size) - (let ((ch (char string index))) - (when (or (char= ch #\") (char= ch #\\)) - (setq output (concat output "\\"))) - (when (or (char= ch #\newline)) - (setq output (concat output "\\")) - (setq ch #\n)) - (setq output (concat output (string ch)))) - (incf index)) - (concat "\"" output "\""))) - ;;; BOOTSTRAP MAGIC: We record the macro definitions as lists during ;;; the bootstrap. Once everything is compiled, we want to dump the ;;; whole global environment to the output file to reproduce it in the diff --git a/src/print.lisp b/src/print.lisp index 941b97c..48af786 100644 --- a/src/print.lisp +++ b/src/print.lisp @@ -18,6 +18,21 @@ ;;; Printer +(defun lisp-escape-string (string) + (let ((output "") + (index 0) + (size (length string))) + (while (< index size) + (let ((ch (char string index))) + (when (or (char= ch #\") (char= ch #\\)) + (setq output (concat output "\\"))) + (when (or (char= ch #\newline)) + (setq output (concat output "\\")) + (setq ch #\n)) + (setq output (concat output (string ch)))) + (incf index)) + (concat "\"" output "\""))) + ;;; Return T if the string S contains characters which need to be ;;; escaped to print the symbol name, NIL otherwise. (defun escape-symbol-name-p (s) -- 1.7.10.4