[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] branch master updated: Fix some srfi-105 parsing errors
From: |
Andy Wingo |
Subject: |
[Guile-commits] branch master updated: Fix some srfi-105 parsing errors |
Date: |
Wed, 03 Mar 2021 16:57:27 -0500 |
This is an automated email from the git hooks/post-receive script.
wingo pushed a commit to branch master
in repository guile.
The following commit(s) were added to refs/heads/master by this push:
new ea86a5c Fix some srfi-105 parsing errors
ea86a5c is described below
commit ea86a5c6d2f22e331751a685fd6b2c3e2b4d7f8e
Author: Andy Wingo <wingo@pobox.com>
AuthorDate: Wed Mar 3 22:56:58 2021 +0100
Fix some srfi-105 parsing errors
* module/ice-9/read.scm (%read): Fix parsing errors.
---
module/ice-9/read.scm | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/module/ice-9/read.scm b/module/ice-9/read.scm
index 639b76a..ee39dfd 100644
--- a/module/ice-9/read.scm
+++ b/module/ice-9/read.scm
@@ -190,17 +190,18 @@
(and (pair? ls)
(let ((op (car ls))
(ls (cdr ls)))
- (if (null? ls)
- (list op x)
+ (if (and (pair? ls) (null? (cdr ls)))
+ (cons* op x ls)
(let ((tail (extract-infix-list ls)))
(and tail
- (equal? op (car tail))
+ (equal? (strip-annotation op)
+ (strip-annotation (car tail)))
(cons* op x (cdr tail))))))))))
(cond
- ((or (not (eqv? rdelim #\}))) ret) ; Only on {...} lists.
- ((null? ret) ret) ; {} => ()
- ((null? (cdr ret)) (car ret)) ; {x} => x
- ((null? (cddr ret)) ret) ; {x y} => (x y)
+ ((not (eqv? rdelim #\})) ret) ; Only on {...} lists.
+ ((not (pair? ret)) ret) ; {} => ()
+ ((not (pair? (cdr ret))) (car ret)); {x} => x
+ ((not (pair? (cddr ret))) ret) ; {x y} => (x y)
((extract-infix-list ret)) ; {x + y + ... + z} => (+ x y ... z)
(else (cons '$nfx$ ret)))) ; {x y . z} => ($nfx$ x y . z)
(define curly? (eqv? rdelim #\}))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Guile-commits] branch master updated: Fix some srfi-105 parsing errors,
Andy Wingo <=