From deb6aabe4c8ae6258c81bf8a497c1152c94f23d3 Mon Sep 17 00:00:00 2001 From: Robby Findler <robby@racket-lang.org> Date: Mon, 11 Mar 2013 08:42:59 -0500 Subject: [PATCH] adjust 2d reader so the keyword has its own source location and is syntax-original? original commit: d652d69d146b6ed048e06509c77e1f46f710654c --- collects/unstable/2d/private/readtable.rkt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/collects/unstable/2d/private/readtable.rkt b/collects/unstable/2d/private/readtable.rkt index b822a46..9fe4806 100644 --- a/collects/unstable/2d/private/readtable.rkt +++ b/collects/unstable/2d/private/readtable.rkt @@ -84,7 +84,13 @@ example uses: (for/list ([line (in-vector lines)]) (length line))) - `(,(string->symbol (string-append "2d" (apply string kwd-chars))) + (define kwd-str (string-append "2d" (apply string kwd-chars))) + (define kwd-port (open-input-string kwd-str)) + (port-count-lines! kwd-port) + (set-port-next-location! kwd-port _line (and _col (+ _col 1)) (and _pos (+ _pos 1))) + (define kwd-stx (read-syntax source kwd-port)) + + `(,kwd-stx ,table-column-breaks ,heights