From 2a667dc9a8a97adeac49084192ba0773d9619ee4 Mon Sep 17 00:00:00 2001 From: Alexis King Date: Tue, 21 Aug 2018 15:02:09 -0500 Subject: [PATCH] Fix reader error message when encountering illegal graph notation Also, document explicitly that graph notation is not allowed at all in read-syntax mode. --- pkgs/racket-doc/scribblings/reference/reader.scrbl | 3 ++- racket/src/expander/read/graph.rkt | 4 ++-- racket/src/racket/src/startup.inc | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/pkgs/racket-doc/scribblings/reference/reader.scrbl b/pkgs/racket-doc/scribblings/reference/reader.scrbl index 00c66f3493..6a62fb667e 100644 --- a/pkgs/racket-doc/scribblings/reference/reader.scrbl +++ b/pkgs/racket-doc/scribblings/reference/reader.scrbl @@ -845,7 +845,8 @@ as constructed by @racket[pregexp], @litchar{#rx#} as constructed by A @graph-defn[] tags the following datum for reference via @graph-ref[], which allows the reader to produce a datum that -has graph structure. +has graph structure. Neither form is allowed in +@racket[read-syntax] mode. For a specific @graph-tag[] in a single read result, each @graph-ref[] reference is replaced by the datum read for the corresponding diff --git a/racket/src/expander/read/graph.rkt b/racket/src/expander/read/graph.rkt index 0fdee7cf5f..ec062d71f8 100644 --- a/racket/src/expander/read/graph.rkt +++ b/racket/src/expander/read/graph.rkt @@ -57,8 +57,8 @@ "`#...~a` forms not ~a" c (if (read-config-for-syntax? config) - "enabled" - "allowed in `read-syntax` mode"))) + "allowed in `read-syntax` mode" + "enabled"))) (unless ((accum-string-count accum-str) . <= . 8) (reader-error in config "graph ID too long in `~a~a~a`" diff --git a/racket/src/racket/src/startup.inc b/racket/src/racket/src/startup.inc index 5567c39295..db15c7da92 100644 --- a/racket/src/racket/src/startup.inc +++ b/racket/src/racket/src/startup.inc @@ -52913,8 +52913,8 @@ static const char *startup_source = "((c40_0) c_0)" "((temp41_0)" "(if(read-config-for-syntax? config_0)" -" \"enabled\"" -" \"allowed in `read-syntax` mode\")))" +" \"allowed in `read-syntax` mode\"" +" \"enabled\")))" "(reader-error12.1" " unsafe-undefined" " '#\\x"