[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 06/13: Read Scheme via read-syntax
From: |
Andy Wingo |
Subject: |
[Guile-commits] 06/13: Read Scheme via read-syntax |
Date: |
Thu, 25 Feb 2021 15:39:09 -0500 (EST) |
wingo pushed a commit to branch master
in repository guile.
commit 03448b289d9804bb27b633b82e22cf7be55743c5
Author: Andy Wingo <wingo@pobox.com>
AuthorDate: Wed Feb 24 20:47:28 2021 +0100
Read Scheme via read-syntax
* module/language/scheme/spec.scm: Use read-syntax.
* test-suite/tests/dwarf.test: Adapt expected source locations.
* am/bootstrap.am (SOURCES): Add ice-9/read.
---
am/bootstrap.am | 1 +
module/language/scheme/spec.scm | 3 ++-
test-suite/tests/dwarf.test | 20 +++++++++++++-------
3 files changed, 16 insertions(+), 8 deletions(-)
diff --git a/am/bootstrap.am b/am/bootstrap.am
index acc00c7..2f5804f 100644
--- a/am/bootstrap.am
+++ b/am/bootstrap.am
@@ -102,6 +102,7 @@ SOURCES = \
ice-9/match.scm \
ice-9/networking.scm \
ice-9/posix.scm \
+ ice-9/read.scm \
ice-9/rdelim.scm \
ice-9/receive.scm \
ice-9/regex.scm \
diff --git a/module/language/scheme/spec.scm b/module/language/scheme/spec.scm
index e4cf55c..b150053 100644
--- a/module/language/scheme/spec.scm
+++ b/module/language/scheme/spec.scm
@@ -21,6 +21,7 @@
(define-module (language scheme spec)
#:use-module (system base compile)
#:use-module (system base language)
+ #:use-module (ice-9 read)
#:use-module (language scheme compile-tree-il)
#:use-module (language scheme decompile-tree-il)
#:export (scheme))
@@ -37,7 +38,7 @@
((or (and=> (and=> (module-variable env 'current-reader)
variable-ref)
fluid-ref)
- read)
+ read-syntax)
port))
#:compilers `((tree-il . ,compile-tree-il))
diff --git a/test-suite/tests/dwarf.test b/test-suite/tests/dwarf.test
index bf36b65..53e8798 100644
--- a/test-suite/tests/dwarf.test
+++ b/test-suite/tests/dwarf.test
@@ -1,6 +1,6 @@
;;;; dwarf.test -*- scheme -*-
;;;;
-;;;; Copyright 2013 Free Software Foundation, Inc.
+;;;; Copyright 2013, 2021 Free Software Foundation, Inc.
;;;;
;;;; This library is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Lesser General Public
@@ -26,7 +26,7 @@
(define prog
(string-concatenate
- ;; Every open parenthesis is a possible source location.
+ ;; The start of every datum is a possible source location.
'("(define (qux f)\n"
;^ 0:0
" (+ 32 (f)))\n"
@@ -37,6 +37,7 @@
" (lambda (a)\n"
; ^ 4:2
" 13))\n"
+ ; ^ 5:4
"'success\n")
))
@@ -81,10 +82,15 @@
(error "unexpected sources" sources)))
(match (find-program-sources (program-code bar))
- ((source)
- (pass-if-equal "foo.scm" (source-file source))
- (pass-if-equal 4 (source-line source))
- (pass-if-equal 5 (source-line-for-user source))
- (pass-if-equal 2 (source-column source)))
+ ((s1 s2)
+ (pass-if-equal "foo.scm" (source-file s1))
+ (pass-if-equal 4 (source-line s1))
+ (pass-if-equal 5 (source-line-for-user s1))
+ (pass-if-equal 2 (source-column s1))
+
+ (pass-if-equal "foo.scm" (source-file s2))
+ (pass-if-equal 5 (source-line s2))
+ (pass-if-equal 6 (source-line-for-user s2))
+ (pass-if-equal 4 (source-column s2)))
(sources
(error "unexpected sources" sources))))
- [Guile-commits] branch master updated (a04a024 -> 697f2b3), Andy Wingo, 2021/02/25
- [Guile-commits] 02/13: Remove top-marked? optimization from psyntax, Andy Wingo, 2021/02/25
- [Guile-commits] 09/13: Add syntax-sourcev, Andy Wingo, 2021/02/25
- [Guile-commits] 04/13: Ensure that (syntax ()) results in (), Andy Wingo, 2021/02/25
- [Guile-commits] 03/13: Fix module scoping for datum->syntax with no identifier, Andy Wingo, 2021/02/25
- [Guile-commits] 07/13: Commit updates from newest autoconf, Andy Wingo, 2021/02/25
- [Guile-commits] 11/13: Psyntax uses sourcev internally, Andy Wingo, 2021/02/25
- [Guile-commits] 06/13: Read Scheme via read-syntax,
Andy Wingo <=
- [Guile-commits] 01/13: Add quote-syntax, Andy Wingo, 2021/02/25
- [Guile-commits] 10/13: Assembler writes vector source properties, Andy Wingo, 2021/02/25
- [Guile-commits] 13/13: Shunt syntax-sourcev to (system syntax internal), Andy Wingo, 2021/02/25
- [Guile-commits] 12/13: read-syntax uses vector source representation, Andy Wingo, 2021/02/25
- [Guile-commits] 05/13: Fix read-syntax on vectors and arrays, Andy Wingo, 2021/02/25
- [Guile-commits] 08/13: Optimize run-time init and relocation procedure, Andy Wingo, 2021/02/25