GNU bug report logs -
#61305
[PATCH 0/2] Rewrite ast->string
Previous Next
Reported by: Arun Isaac <arunisaac <at> systemreboot.net>
Date: Mon, 6 Feb 2023 00:02:01 UTC
Severity: normal
Tags: patch
Done: Arun Isaac <arunisaac <at> systemreboot.net>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 61305 in the body.
You can then email your comments to 61305 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
skribilo-bugs <at> nongnu.org
:
bug#61305
; Package
skribilo
.
(Mon, 06 Feb 2023 00:02:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Arun Isaac <arunisaac <at> systemreboot.net>
:
New bug report received and forwarded. Copy sent to
skribilo-bugs <at> nongnu.org
.
(Mon, 06 Feb 2023 00:02:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
This patchset adds a test for ast->string and rewrites it as a
one-liner using string-join.
Arun Isaac (2):
tests: Test ast->string.
ast: Rewrite ast->string using string-join.
src/guile/skribilo/ast.scm | 12 ++----------
tests/ast.test | 5 +++++
2 files changed, 7 insertions(+), 10 deletions(-)
--
2.38.1
Information forwarded
to
skribilo-bugs <at> nongnu.org
:
bug#61305
; Package
skribilo
.
(Mon, 06 Feb 2023 00:04:01 GMT)
Full text and
rfc822 format available.
Message #8 received at 61305 <at> debbugs.gnu.org (full text, mbox):
* tests/ast.test ("ast->string"): New test.
---
tests/ast.test | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/tests/ast.test b/tests/ast.test
index 1110faf..ed09bb0 100644
--- a/tests/ast.test
+++ b/tests/ast.test
@@ -1,6 +1,7 @@
;;; Excercise the AST routines. -*- Scheme -*-
;;;
;;; Copyright (C) 2009, 2012, 2021 Ludovic Courtès <ludo <at> gnu.org>
+;;; Copyright (C) 2023 Arun Isaac <arunisaac <at> systemreboot.net>
;;;
;;; This file is part of Skribilo.
;;;
@@ -64,6 +65,10 @@
(null? (cdr body))))))
(null? (cdr body)))))
+(test-equal "ast->string"
+ "Blah."
+ (ast->string (document #:title "Foo" (chapter #:title "Bar" "Blah."))))
+
(test-assert "`find-down' returns the empty list"
(let* ((doc (document (chapter (section)) (chapter (section))))
(lst (find-down (lambda (n) (is-markup? n 'chapter)) doc)))
--
2.38.1
Information forwarded
to
skribilo-bugs <at> nongnu.org
:
bug#61305
; Package
skribilo
.
(Mon, 06 Feb 2023 00:04:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 61305 <at> debbugs.gnu.org (full text, mbox):
* src/guile/skribilo/ast.scm (ast->string): Rewrite using string-join.
---
src/guile/skribilo/ast.scm | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/src/guile/skribilo/ast.scm b/src/guile/skribilo/ast.scm
index 4a39ebf..003619f 100644
--- a/src/guile/skribilo/ast.scm
+++ b/src/guile/skribilo/ast.scm
@@ -3,6 +3,7 @@
;;; Copyright 2003, 2004, 2009 Erick Gallesio - I3S-CNRS/ESSI <eg <at> unice.fr>
;;; Copyright 2003, 2004 Manuel Serrano
;;; Copyright 2005, 2006, 2007, 2012, 2013, 2015, 2018 Ludovic Court�s <ludo <at> gnu.org>
+;;; Copyright 2023 Arun Isaac <arunisaac <at> systemreboot.net>
;;;
;;;
;;; This file is part of Skribilo.
@@ -206,16 +207,7 @@
(define-method (ast->string (ast <number>)) (number->string ast))
(define-method (ast->string (ast <pair>))
- (let ((out (open-output-string)))
- (let Loop ((lst ast))
- (cond
- ((null? lst)
- (get-output-string out))
- (else
- (display (ast->string (car lst)) out)
- (unless (null? (cdr lst))
- (display #\space out))
- (Loop (cdr lst)))))))
+ (string-join (map ast->string ast)))
--
2.38.1
Reply sent
to
Arun Isaac <arunisaac <at> systemreboot.net>
:
You have taken responsibility.
(Tue, 28 Feb 2023 00:01:02 GMT)
Full text and
rfc822 format available.
Notification sent
to
Arun Isaac <arunisaac <at> systemreboot.net>
:
bug acknowledged by developer.
(Tue, 28 Feb 2023 00:01:02 GMT)
Full text and
rfc822 format available.
Message #16 received at 61305-done <at> debbugs.gnu.org (full text, mbox):
Pushed!
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Tue, 28 Mar 2023 11:24:06 GMT)
Full text and
rfc822 format available.
This bug report was last modified 2 years and 46 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.