set `read-accept-lang' to #t by default, plus related adjustments
including adding some uses of `with-module-read-parameterization' so that `read-accept-lang' is set right anyway; still, so many many places just set `read-accept-reader' to #t that making `read-accept-lang' #f by default looks like too big of an incompatibility
This commit is contained in:
parent
c25b20867e
commit
6ac33a62be
|
@ -1016,9 +1016,10 @@
|
|||
(parameterize ([current-custodian nc])
|
||||
(thread (lambda ()
|
||||
(with-handlers ((exn? (lambda (x) (set! exn x))))
|
||||
(parameterize ([read-accept-reader #t]
|
||||
[current-namespace (make-base-namespace)])
|
||||
(compile-file filename))))))])
|
||||
(parameterize ([current-namespace (make-base-namespace)])
|
||||
(with-module-reading-parameterization
|
||||
(lambda ()
|
||||
(compile-file filename))))))))])
|
||||
(thread
|
||||
(lambda ()
|
||||
(thread-wait t)
|
||||
|
|
|
@ -378,7 +378,8 @@
|
|||
|
||||
(define/override (front-end/interaction port settings)
|
||||
(λ ()
|
||||
(let ([v (parameterize ([read-accept-reader #t])
|
||||
(let ([v (parameterize ([read-accept-reader #t]
|
||||
[read-accept-lang #f])
|
||||
(with-stack-checkpoint
|
||||
((current-read-interaction)
|
||||
(object-name port)
|
||||
|
|
|
@ -20,7 +20,8 @@ This file sets up the right lexical environment to invoke the tools that want to
|
|||
string-constants)
|
||||
|
||||
(require (for-syntax racket/base racket/match
|
||||
compiler/cm-accomplice))
|
||||
compiler/cm-accomplice
|
||||
syntax/modread))
|
||||
|
||||
(import [prefix drscheme:frame: drracket:frame^]
|
||||
[prefix drscheme:unit: drracket:unit^]
|
||||
|
@ -46,8 +47,9 @@ This file sets up the right lexical environment to invoke the tools that want to
|
|||
(define full-sexp
|
||||
(call-with-input-file tool-lib-src
|
||||
(λ (port)
|
||||
(parameterize ([read-accept-reader #t])
|
||||
(read port)))))
|
||||
(with-module-reading-parameterization
|
||||
(lambda ()
|
||||
(read port))))))
|
||||
|
||||
(register-external-file tool-lib-src)
|
||||
|
||||
|
|
|
@ -556,7 +556,8 @@
|
|||
(drscheme:rep:current-rep)))
|
||||
|
||||
(define/override (front-end/interaction port settings)
|
||||
(let ([t (super front-end/interaction port settings)]
|
||||
(let ([t (parameterize ([read-accept-lang #f])
|
||||
(super front-end/interaction port settings))]
|
||||
[start? #t]
|
||||
[done? #f])
|
||||
(λ ()
|
||||
|
@ -825,9 +826,10 @@
|
|||
(parameterize ([current-custodian nc])
|
||||
(thread (λ ()
|
||||
(with-handlers ((exn? (λ (x) (set! exn x))))
|
||||
(parameterize ([read-accept-reader #t]
|
||||
[current-namespace (make-base-namespace)])
|
||||
(compile-file filename))))))])
|
||||
(parameterize ([current-namespace (make-base-namespace)])
|
||||
(with-module-reading-parameterization
|
||||
(lambda ()
|
||||
(compile-file filename))))))))])
|
||||
(thread
|
||||
(λ ()
|
||||
(thread-wait t)
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
scheme/path
|
||||
scheme/list
|
||||
syntax/path-spec
|
||||
syntax/modread
|
||||
(for-syntax scheme/base)))
|
||||
|
||||
(provide include-extracted
|
||||
|
@ -35,14 +36,15 @@
|
|||
n-path)])
|
||||
(let ([s-exp
|
||||
(parameterize ([current-namespace (make-base-namespace)]
|
||||
[read-accept-reader #t]
|
||||
[current-load-relative-directory
|
||||
(path-only path)])
|
||||
(expand
|
||||
(with-input-from-file path
|
||||
(lambda ()
|
||||
(port-count-lines! (current-input-port))
|
||||
(read-syntax path)))))])
|
||||
(with-module-reading-parameterization
|
||||
(lambda ()
|
||||
(with-input-from-file path
|
||||
(lambda ()
|
||||
(port-count-lines! (current-input-port))
|
||||
(read-syntax path)))))))])
|
||||
(syntax-case s-exp ()
|
||||
[(mod name lang
|
||||
(mod-beg
|
||||
|
|
|
@ -340,7 +340,8 @@ The default read interaction handler accepts @racket[_src] and
|
|||
@racket[_in] and returns
|
||||
|
||||
@racketblock[
|
||||
(parameterize ([read-accept-reader #t])
|
||||
(parameterize ([read-accept-reader #t]
|
||||
[read-accept-lang #f])
|
||||
(read-syntax _src _in))
|
||||
]}
|
||||
|
||||
|
|
|
@ -243,15 +243,14 @@ A parameter that controls parsing input with @litchar{`} or
|
|||
@defboolparam[read-accept-reader on?]{
|
||||
|
||||
A parameter that controls whether @litchar{#reader}, @litchar{#lang},
|
||||
and @litchar{#!} followed by a space are allowed for selecting a
|
||||
parser. See @secref["parse-reader"] for more information.}
|
||||
or @litchar{#!} are allowed for selecting a parser. See
|
||||
@secref["parse-reader"] for more information.}
|
||||
|
||||
@defboolparam[read-accept-lang on?]{
|
||||
|
||||
A parameter that (along with @racket[read-accept-reader] controls
|
||||
whether @litchar{#lang} and @litchar{#!} followed by a space are
|
||||
allowed for selecting a parser. See @secref["parse-reader"] for more
|
||||
information.}
|
||||
whether @litchar{#lang} and @litchar{#!} are allowed for selecting a
|
||||
parser. See @secref["parse-reader"] for more information.}
|
||||
|
||||
@defparam[current-reader-guard proc (any/c . -> . any)]{
|
||||
|
||||
|
|
|
@ -835,8 +835,7 @@ file, possibly after comment forms, to specify the syntax of a module.
|
|||
|
||||
If the @racket[read-accept-reader] or @racket[read-accept-lang]
|
||||
@tech{parameter} is set to @racket[#f], then if the reader encounters
|
||||
@litchar{#lang} or @litchar{#!} followed by a space, the
|
||||
@exnraise[exn:fail:read].
|
||||
@litchar{#lang} or equivalent @litchar{#!}, the @exnraise[exn:fail:read].
|
||||
|
||||
@subsection{S-Expression Reader Language}
|
||||
|
||||
|
|
|
@ -35,8 +35,7 @@
|
|||
(apply error 'get-info (string-append "info file " fmt " in ~a")
|
||||
(append args (list file))))
|
||||
(define (contents)
|
||||
(parameterize ([read-accept-reader #t]
|
||||
[current-reader-guard
|
||||
(parameterize ([current-reader-guard
|
||||
(lambda (x)
|
||||
(if (eq? x 'setup/infotab/lang/reader)
|
||||
x
|
||||
|
|
|
@ -638,7 +638,9 @@
|
|||
(get-compiled-file-sha1 renderer-path)
|
||||
(get-file-sha1 css-path))])
|
||||
(with-output-to-file stamp-file #:exists 'truncate/replace (lambda () (write data)))
|
||||
(file-or-directory-modify-seconds stamp-file (max aux-time src-time))))
|
||||
(let ([m (max aux-time src-time)])
|
||||
(unless (equal? m +inf.0)
|
||||
(file-or-directory-modify-seconds stamp-file m)))))
|
||||
info))))
|
||||
(lambda () #f))
|
||||
#f))))
|
||||
|
|
|
@ -63,6 +63,15 @@
|
|||
(build-path "compiled" (compile-mode))
|
||||
(build-path "compiled")))
|
||||
|
||||
(unless (make-user)
|
||||
(current-library-collection-paths
|
||||
(if (member main-collects-dir (current-library-collection-paths))
|
||||
(list main-collects-dir)
|
||||
'())))
|
||||
|
||||
(current-library-collection-paths
|
||||
(map simple-form-path (current-library-collection-paths)))
|
||||
|
||||
(define (setup-fprintf p task s . args)
|
||||
(let ([task (if task (string-append task ": ") "")])
|
||||
(apply fprintf p (string-append name-str ": " task s "\n") args)))
|
||||
|
@ -953,15 +962,6 @@
|
|||
;; setup-unit Body ;;
|
||||
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(unless (make-user)
|
||||
(current-library-collection-paths
|
||||
(if (member main-collects-dir (current-library-collection-paths))
|
||||
(list main-collects-dir)
|
||||
'())))
|
||||
|
||||
(current-library-collection-paths
|
||||
(map simple-form-path (current-library-collection-paths)))
|
||||
|
||||
(setup-printf "version" "~a [~a]" (version) (system-type 'gc))
|
||||
(setup-printf "variants" "~a" (string-join (map symbol->string (available-mzscheme-variants)) ", "))
|
||||
(setup-printf "main collects" "~a" (path->string main-collects-dir))
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
mzlib/contract
|
||||
mzlib/list
|
||||
scheme/gui/dynamic
|
||||
syntax/modread
|
||||
"image.ss"
|
||||
"editor.ss"
|
||||
"private/compat.ss")
|
||||
|
@ -578,17 +579,9 @@
|
|||
;; ----------------------------------------
|
||||
|
||||
(define plain-params
|
||||
(parameterize ([current-readtable #f]
|
||||
[read-accept-reader #f]
|
||||
[read-case-sensitive #t]
|
||||
[read-accept-graph #f]
|
||||
[read-accept-box #f]
|
||||
[read-accept-bar-quote #t]
|
||||
[read-decimal-as-inexact #t]
|
||||
[read-accept-dot #t]
|
||||
[read-accept-quasiquote #f]
|
||||
[read-accept-compiled #f])
|
||||
(current-parameterization)))
|
||||
(with-module-reading-parameterization
|
||||
(lambda ()
|
||||
(current-parameterization))))
|
||||
|
||||
(define (plain-read port)
|
||||
(call-with-parameterization
|
||||
|
|
|
@ -9564,6 +9564,7 @@ scheme_default_read_handler(int argc, Scheme_Object *argv[])
|
|||
|
||||
config = scheme_current_config();
|
||||
config = scheme_extend_config(config, MZCONFIG_CAN_READ_READER, scheme_true);
|
||||
config = scheme_extend_config(config, MZCONFIG_CAN_READ_LANG, scheme_false);
|
||||
|
||||
scheme_push_continuation_frame(&cframe);
|
||||
scheme_install_config(config);
|
||||
|
|
|
@ -129,6 +129,8 @@ static int scheme_ellipses(mzchar* buffer, int length);
|
|||
|
||||
#define mzSPAN(port, pos) ()
|
||||
|
||||
#define NOT_ENABLED_str " not enabled in the current context"
|
||||
|
||||
#define isdigit_ascii(n) ((n >= '0') && (n <= '9'))
|
||||
|
||||
#define scheme_isxdigit(n) (isdigit_ascii(n) || ((n >= 'a') && (n <= 'f')) || ((n >= 'A') && (n <= 'F')))
|
||||
|
@ -1429,7 +1431,7 @@ read_inner_inner(Scheme_Object *port, Scheme_Object *stxsrc, Scheme_Hash_Table *
|
|||
return cpld;
|
||||
} else {
|
||||
scheme_read_err(port, stxsrc, line, col, pos, 2, 0, indentation,
|
||||
"read: #~ compiled expressions not currently enabled");
|
||||
"read: #~ compiled expressions" NOT_ENABLED_str);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
@ -1507,7 +1509,7 @@ read_inner_inner(Scheme_Object *port, Scheme_Object *stxsrc, Scheme_Hash_Table *
|
|||
return read_box(port, stxsrc, line, col, pos, ht, indentation, params);
|
||||
else {
|
||||
scheme_read_err(port, stxsrc, line, col, pos, 2, 0, indentation,
|
||||
"read: #& expressions not currently enabled");
|
||||
"read: #& expressions" NOT_ENABLED_str);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
@ -1534,7 +1536,7 @@ read_inner_inner(Scheme_Object *port, Scheme_Object *stxsrc, Scheme_Hash_Table *
|
|||
if (!params->can_read_reader
|
||||
|| !params->can_read_lang) {
|
||||
scheme_read_err(port, stxsrc, line, col, pos, 6, 0, indentation,
|
||||
"read: #lang expressions not currently enabled");
|
||||
"read: #lang" NOT_ENABLED_str);
|
||||
return NULL;
|
||||
}
|
||||
v = read_lang(port, stxsrc, line, col, pos, get_info, ht, indentation, params, 0);
|
||||
|
@ -1619,7 +1621,7 @@ read_inner_inner(Scheme_Object *port, Scheme_Object *stxsrc, Scheme_Hash_Table *
|
|||
|
||||
if (!params->can_read_reader) {
|
||||
scheme_read_err(port, stxsrc, line, col, pos, 7, 0, indentation,
|
||||
"read: #reader expressions not currently enabled");
|
||||
"read: #reader" NOT_ENABLED_str);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -1810,9 +1812,10 @@ read_inner_inner(Scheme_Object *port, Scheme_Object *stxsrc, Scheme_Hash_Table *
|
|||
goto start_over;
|
||||
} else if ((ch < 128) && is_lang_nonsep_char(ch)) {
|
||||
Scheme_Object *v;
|
||||
if (!params->can_read_reader) {
|
||||
if (!params->can_read_reader
|
||||
|| !params->can_read_lang) {
|
||||
scheme_read_err(port, stxsrc, line, col, pos, 2, 0, indentation,
|
||||
"read: #! reader expressions not currently enabled");
|
||||
"read: #!" NOT_ENABLED_str);
|
||||
return NULL;
|
||||
}
|
||||
v = read_lang(port, stxsrc, line, col, pos, get_info, ht, indentation, params, ch);
|
||||
|
@ -1903,7 +1906,7 @@ read_inner_inner(Scheme_Object *port, Scheme_Object *stxsrc, Scheme_Hash_Table *
|
|||
|
||||
if (!params->can_read_graph)
|
||||
scheme_read_err(port, stxsrc, line, col, pos, SPAN(port, pos), 0, indentation,
|
||||
"read: #..# expressions not currently enabled");
|
||||
"read: #..# expressions" NOT_ENABLED_str);
|
||||
|
||||
if (digits > MAX_GRAPH_ID_DIGITS)
|
||||
scheme_read_err(port, stxsrc, line, col, pos, SPAN(port, pos), 0, indentation,
|
||||
|
@ -1934,7 +1937,7 @@ read_inner_inner(Scheme_Object *port, Scheme_Object *stxsrc, Scheme_Hash_Table *
|
|||
|
||||
if (!params->can_read_graph)
|
||||
scheme_read_err(port, stxsrc, line, col, pos, SPAN(port, pos), 0, indentation,
|
||||
"read: #..= expressions not currently enabled");
|
||||
"read: #..= expressions" NOT_ENABLED_str);
|
||||
|
||||
if (digits > MAX_GRAPH_ID_DIGITS)
|
||||
scheme_read_err(port, stxsrc, line, col, pos, SPAN(port, pos), 0, indentation,
|
||||
|
|
|
@ -6789,7 +6789,7 @@ static void make_initial_config(Scheme_Thread *p)
|
|||
init_param(cells, paramz, MZCONFIG_CAN_READ_QUASI, scheme_true);
|
||||
init_param(cells, paramz, MZCONFIG_READ_DECIMAL_INEXACT, scheme_true);
|
||||
init_param(cells, paramz, MZCONFIG_CAN_READ_READER, scheme_false);
|
||||
init_param(cells, paramz, MZCONFIG_CAN_READ_LANG, scheme_false);
|
||||
init_param(cells, paramz, MZCONFIG_CAN_READ_LANG, scheme_true);
|
||||
init_param(cells, paramz, MZCONFIG_LOAD_DELAY_ENABLED, init_load_on_demand ? scheme_true : scheme_false);
|
||||
init_param(cells, paramz, MZCONFIG_DELAY_LOAD_INFO, scheme_false);
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user