mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-07-09 22:17:34 +02:00
adding support for #![no-]fold-case in srfi.38 and chibi.repl
This commit is contained in:
parent
769ef4725d
commit
3f8ac7106f
2 changed files with 18 additions and 2 deletions
|
@ -162,7 +162,12 @@
|
|||
(guard
|
||||
(exn
|
||||
(else (print-exception exn (current-error-port))))
|
||||
(let* ((expr (call-with-input-string line read/ss))
|
||||
(let* ((expr (call-with-input-string line
|
||||
(lambda (in2)
|
||||
(set-port-fold-case! in2 (port-fold-case? in))
|
||||
(let ((expr (read/ss in2)))
|
||||
(set-port-fold-case! in (port-fold-case? in2))
|
||||
expr))))
|
||||
(thread
|
||||
(make-thread
|
||||
(lambda ()
|
||||
|
|
|
@ -180,7 +180,18 @@
|
|||
(read-one))
|
||||
((#\|)
|
||||
(skip-comment in 0))
|
||||
((#\!) (skip-line in) (read-one in))
|
||||
((#\!)
|
||||
(let ((name (read-name #f in)))
|
||||
(cond
|
||||
((string-ci=? name "!fold-case")
|
||||
(set-port-fold-case! in #t))
|
||||
((string-ci=? name "!no-fold-case")
|
||||
(set-port-fold-case! in #f))
|
||||
(else ;; assume a #!/bin/bash line
|
||||
(skip-line in)))
|
||||
(let ((res (read-one)))
|
||||
(if (not (eof-object? res))
|
||||
res))))
|
||||
((#\() (list->vector (read-one)))
|
||||
((#\') (read-char in) (list 'syntax (read-one)))
|
||||
((#\`) (read-char in) (list 'quasisyntax (read-one)))
|
||||
|
|
Loading…
Add table
Reference in a new issue