From 4bb8bee2c13fb8c1675979c706e50a54de88d95f Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Fri, 10 Feb 2017 20:40:57 -0800 Subject: [PATCH] Fix parser case-folding to use ustring-foldcase. --- src/runtime/parse.scm | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/runtime/parse.scm b/src/runtime/parse.scm index 595d2c495..c7a3c5585 100644 --- a/src/runtime/parse.scm +++ b/src/runtime/parse.scm @@ -520,10 +520,6 @@ USA. (define (parse-atom-1 port db prefix quoting?) (let ((port* (open-output-string)) - (%canon - (if (db-fold-case? db) - char-downcase - (lambda (char) char))) (atom-delimiters (db-atom-delimiters db)) (constituents (db-constituents db))) (define (%read) @@ -554,9 +550,14 @@ USA. (char (%peek))) (if (or (eof-object? char) (char-set-member? atom-delimiters char)) - (if quoting? - (values (get-output-string port*) quoted? previous-char) - (get-output-string port*)) + (let ((atom + (let ((s (get-output-string port*))) + (if (db-fold-case? db) + (ustring-foldcase s) + s)))) + (if quoting? + (values atom quoted? previous-char) + atom)) (begin (if (not (char-set-member? constituents char)) (error:illegal-char char)) @@ -584,7 +585,7 @@ USA. (read-unquoted #t #f (%peek))) (error:illegal-char char))) (else - (write-char (%canon char) port*) + (write-char char port*) (read-unquoted quoted? char (%peek))))))))) (define (handler:list port db ctx char) -- 2.25.1