Scheme read respects "positions" reader option
authorAndy Wingo <wingo@pobox.com>
Wed, 17 Feb 2021 11:14:15 +0000 (12:14 +0100)
committerAndy Wingo <wingo@pobox.com>
Wed, 17 Feb 2021 11:14:15 +0000 (12:14 +0100)
* module/ice-9/read.scm (read): Don't add source positions if the option
  is off.

module/ice-9/read.scm

index 04e3cac93f1a8424c365f2c8ebee0e8387a7a3be..be072f9c7d6264e079af489fa3341a8cc8132e25 100644 (file)
   (define (annotate line column datum)
     ;; FIXME: Return a syntax object instead, so we can avoid the
     ;; srcprops side table.
-    (when (and (supports-source-properties? datum)
+    (when (and (record-positions?)
+               (supports-source-properties? datum)
                ;; Line or column can be invalid via set-port-column! or
                ;; ungetting chars beyond start of line.
                (<= 0 line)