bug#71300: [PATCH v3] doc: Document SRFI 64.

2024-12-22 Thread Maxim Cournoyer
Hi,

Finally acting on this, now that it's already been merged by Ludovic
^^'.

"Dr. Arne Babenhauserheide"  writes:

> Maxim Cournoyer  writes:
>
>> diff --git a/doc/ref/srfi-modules.texi b/doc/ref/srfi-modules.texi
>> index 02da3e2f2..4d408d6cb 100644
>> --- a/doc/ref/srfi-modules.texi
>> +++ b/doc/ref/srfi-modules.texi
>> @@ -55,7 +56,7 @@ get the relevant SRFI documents from the SRFI home page
>>  * SRFI-60:: Integers as bits.
>>  * SRFI-61:: A more general `cond' clause
>>  * SRFI-62:: S-expression comments.
>> -* SRFI-64:: A Scheme API for test suites.
>> +* SRFI 64:: A Scheme API for test suites.
>
> If you change this for one, please harmonize the others (with or without
> -). Consistency wins here.

Ludovic kept the current convention, so that's tackled.

>> @@ -5290,12 +5291,827 @@ needed to get SRFI-61 itself.  Extended @code{cond} 
>> is documented in
> …
>> +There are other testing frameworks written in Scheme, including
>> +@url{https://docs.racket-lang.org/rackunit/, RackUnit}.  However
>> +RackUnit is not portable.  It is also a bit on the verbose side.  It
>> +would be useful to have a bridge between this framework and RackUnit so
>> +RackUnit tests could run under this framework and vice versa.  There
>> +exists also at least one Scheme wrapper providing a Scheme interface to
>> +the ``standard'' @url{https://www.junit.org/, JUnit} API for Java.  It
>> +would be useful to have a bridge so that tests written using this
>> +framework can run under a JUnit runner.  Neither of these features are
>> +part of this specification.
>
> Is this relevant for Guile?
> If not, I’d take the racket specific part out.

It's relevant to the context in which this SRFI was created.  Not
critical for Guile, but maybe nice for the reader wanting to know the
full story.  I don't feel strongly about removing it though.

>> +This API makes use of implicit dynamic state, including an implicit
>> +``test runner''.  This makes the API convenient and terse to use, but it
>> +may be a little less elegant and ``compositional'' than using explicit
>> +test objects, such as JUnit-style frameworks.  It is not claimed to
>> +follow either object-oriented or functional design principles, but I
>> +hope it is useful and convenient to use and extend.
>
> This sub-sentence ("but I hope...") isn’t needed here, I think.

I turned it into 'but it is hoped', i.e. neutral tone at least.

>> +Test cases are executed in the context of a @dfn{test runner}, which is
>> +a object that accumulates and reports test results.  This
>> specification
>
> Typo: a object -> an object
>
> (this might also be a good change/PR for srfi 64 itself ⇒ upstream)

Thanks.  Fixed, and an upstream PR already submitted for this one and
others you found:
.

>> +defines how to create and use custom test runners, but implementations
>> +should also provide a default test runner.  It is suggested (but not
>
> Does Guile provide a default test runner?
> ⇒ that may be good to note instead of "should also".

I've added to this paragraph documenting what the implementation in
Guile does:

--8<---cut here---start->8---
modified   doc/ref/srfi-modules.texi
@@ -5393,7 +5393,25 @@ should also provide a default test runner.  It is 
suggested (but not
 required) that loading the above file in a top-level environment will
 cause the tests to be executed using an implementation-specified default
 test runner, and @code{test-end} will cause a summary to be displayed in
-an implementation-specified manner.
+an implementation-specified manner.  The SRFI 64 implementation used in
+Guile provides such a default test runner; running the above snippet at
+the REPL prints:
+
+@example
+*** Entering test group: vec-test ***
+$1 = #t
+* PASS:
+$2 = ((pass . 1))
+* PASS:
+$3 = ((pass . 2))
+* PASS:
+$4 = ((pass . 3))
+*** Leaving test group: vec-test ***
+*** Test suite finished. ***
+*** # of expected passes: 3
+@end example
+
+It also returns the @code{} object.

 @subsubheading Simple test-cases
--8<---cut here---end--->8---


>> +required) that loading the above file in a top-level environment will
>> +cause the tests to be executed using an implementation-specified default
>> +test runner, and @code{test-end} will cause a summary to be displayed in
>> +an implementation-specified manner.
> …
>> +For testing approximate equality of inexact reals
>> +we can use @code{test-approximate}:
>> +
>> +@deffn {Scheme Syntax} test-approximate [test-name] expected test-expr error
>> +
>> +This is equivalent to (except that each argument is only evaluated
>> +once):
>> +
>> +@lisp
>> +(test-assert [test-name]
>> +  (and (>= test-expr (- expected error))
>> +   (<= test-expr (+ expected error
>> +@end lisp
>> +@end deffn
>
> It would be nice

bug#75041: [PATCH] doc/srfi-64: Fix typos and add examples.

2024-12-22 Thread Maxim Cournoyer
* doc/ref/srfi-modules.texi (SRFI-64 Writing Basic Test Suites): Fix
typo.  Add default test runner example.  Add test-approximate and
test-error examples.  Document valid error types in Guile for test-error.
(SRFI-64 Conditonal Test Suites and Other Advanced Features): Fix typo.

Suggested-by: Arne Babenhauserheide 
---
 doc/ref/srfi-modules.texi | 83 +--
 1 file changed, 80 insertions(+), 3 deletions(-)

diff --git a/doc/ref/srfi-modules.texi b/doc/ref/srfi-modules.texi
index d77bc1c90..537ec9059 100644
--- a/doc/ref/srfi-modules.texi
+++ b/doc/ref/srfi-modules.texi
@@ -5387,13 +5387,31 @@ is also easy to add new tests, without having to name 
individual tests
 (though that is optional).
 
 Test cases are executed in the context of a @dfn{test runner}, which is
-a object that accumulates and reports test results.  This specification
+an object that accumulates and reports test results.  This specification
 defines how to create and use custom test runners, but implementations
 should also provide a default test runner.  It is suggested (but not
 required) that loading the above file in a top-level environment will
 cause the tests to be executed using an implementation-specified default
 test runner, and @code{test-end} will cause a summary to be displayed in
-an implementation-specified manner.
+an implementation-specified manner.  The SRFI 64 implementation used in
+Guile provides such a default test runner; running the above snippet at
+the REPL prints:
+
+@example
+*** Entering test group: vec-test ***
+$1 = #t
+* PASS:
+$2 = ((pass . 1))
+* PASS:
+$3 = ((pass . 2))
+* PASS:
+$4 = ((pass . 3))
+*** Leaving test group: vec-test ***
+*** Test suite finished. ***
+*** # of expected passes: 3
+@end example
+
+It also returns the @code{} object.
 
 @subsubheading Simple test-cases
 
@@ -5455,6 +5473,14 @@ once):
   (and (>= test-expr (- expected error))
(<= test-expr (+ expected error
 @end lisp
+
+Here's an example:
+@lisp
+(test-approximate "is 22/7 within 1% of π?"
+ 3.1415926535
+ 22/7
+ 1/100)
+@end lisp
 @end deffn
 
 @subsubheading Tests for catching errors
@@ -5492,8 +5518,59 @@ classes:
 
 An implementation that cannot catch exceptions should skip
 @code{test-error} forms.
+
+@cindex test-error error types
+@cindex error types, test-error, srfi-64
+The SRFI-64 implementation in Guile supports specifying @var{error-type}
+as either:
+@iterate
+@item
+@code{#f}, meaning the test is @emph{not} expected to produce an error
+@item
+@code{#t}, meaning the test is expected to produce an error, of any type
+@item
+A native exception type, as created via @code{make-exception-type} or
+@code{make-condition-type} from SRFI-35
+@item
+A predicate, which will be applied to the exception caught
+to determine whether is it of the right type
+@item
+A symbol, for the exception kind of legacy
+@code{make-exception-from-throw} style exceptions.
 @end deffn
 
+Below are some examples valid in Guile:
+
+@lisp
+(test-error "expect old-style exception kind"
+ 'numerical-overflow
+ (/ 1 0))
+@end lisp
+
+@lisp
+(use-modules (ice-9 exceptions)) ;for standard exception types
+
+(test-error "expect a native exception type"
+ &warning
+ (raise-exception (make-warning)))
+
+(test-error "expect a native exception, using predicate"
+ warning?
+ (raise-exception (make-warning)))
+@end lisp
+
+@lisp
+(use-modules (srfi srfi-35))
+
+(test-error "expect a serious SRFI 35 condition type"
+ &serious
+ (raise-exception (condition (&serious
+
+(test-error "expect a serious SRFI 35 condition type, using predicate"
+ serious-condition?
+ (raise-exception (condition (&serious
+@end lisp
+
 @subsubheading Testing syntax
 
 Testing syntax is tricky, especially if we want to check that invalid
@@ -5617,7 +5694,7 @@ or specifying that some tests are @emph{expected} to fail.
 @subsubheading Test specifiers
 
 Sometimes we want to only run certain tests, or we know that certain
-tests are expected to fail.  A @dfn{test specifier} is one-argument
+tests are expected to fail.  A @dfn{test specifier} is a one-argument
 function that takes a test-runner and returns a boolean.  The specifier
 may be run before a test is performed, and the result may control
 whether the test is executed.  For convenience, a specifier may also be

base-commit: f6359a4715d023761454f1bf945633ce4cca98fc
-- 
2.46.0






bug#73188: PEG parser does not support full PEG grammar

2024-12-22 Thread Ekaitz Zarraga

hi!

I didn't realize but you pushed the v4, and I detected a bug in it so I 
sent v5.


The bug is in the [^...] implementation.

v5 fixes it and it even simplifies the code.

Please revert 25504ba21 and apply the v5 instead.





bug#73188: [PATCH 1/3] PEG: fix [^...]

2024-12-22 Thread Ekaitz Zarraga
---
 module/ice-9/peg/string-peg.scm | 16 
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/module/ice-9/peg/string-peg.scm b/module/ice-9/peg/string-peg.scm
index 0026f8930..745d8e8e7 100644
--- a/module/ice-9/peg/string-peg.scm
+++ b/module/ice-9/peg/string-peg.scm
@@ -301,11 +301,19 @@ EndOfFile < !.
 (define (Literal->defn lst for-syntax)
   (apply string (map (lambda (x) (Char->defn x for-syntax)) (cdr lst
 
-;; (NotInClass ...)
-;;  `-> (and ...)
+;; (NotInClass (Range ...) (Range ...))
+;;  `-> (and (followed-by (not-in-range ...))
+;;   (followed-by (not-in-range ...))
+;;   ...
+;;   (not-in-range ...))
+;; NOTE: the order doesn't matter, because all `not-in-range`s will always
+;; parse exactly one character, but all the elements but the last need not to
+;; consume the input.
 (define (NotInClass->defn lst for-syntax)
-  #`(and #,@(map (lambda (x) (NotInRange->defn x for-syntax))
- (cdr lst
+  #`(and
+  #,@(map (lambda (x) #`(followed-by #,(NotInRange->defn x for-syntax)))
+  (cddr lst))
+  #,(NotInRange->defn (cadr lst) for-syntax)))
 
 ;; (Class ...)
 ;;  `-> (or ...)
-- 
2.46.0






bug#73188: [PATCH 3/3] PEG: add large string-peg patch

2024-12-22 Thread Ekaitz Zarraga
---
 test-suite/tests/peg.test | 117 --
 1 file changed, 113 insertions(+), 4 deletions(-)

diff --git a/test-suite/tests/peg.test b/test-suite/tests/peg.test
index d9e3e1b22..d8d047288 100644
--- a/test-suite/tests/peg.test
+++ b/test-suite/tests/peg.test
@@ -86,7 +86,7 @@
 End <-- '*)'
 C <- Begin N* End
 N <- C / (!Begin !End Z)
-Z <- [^X-Z]") ;; Forbid some characters to test not-in-range
+Z <- .")
 
 ;; A short /etc/passwd file.
 (define *etc-passwd*
@@ -126,9 +126,6 @@ SLASH < '/'")
 (match-pattern C "(*blah*)")
 (make-prec 0 8 "(*blah*)"
   '((Begin "(*") "blah" (End "*)")
-  (pass-if
-   "simple comment with forbidden char"
-   (not (match-pattern C "(*blYh*)")))
   (pass-if
"simple comment padded"
(equal?
@@ -288,3 +285,115 @@ number <-- [0-9]+")
(equal? (eq-parse "1+1/2*3+(1+1)/2")
   '(+ (+ 1 (* (/ 1 2) 3)) (/ (+ 1 1) 2)
 
+
+(define html-grammar
+"
+# Based on code from https://github.com/Fantom-Factory/afHtmlParser
+# 2014-2023 Steve Eynon. This code was originally released under the following
+# terms:
+#
+#  Permission to use, copy, modify, and/or distribute this software for any
+#  purpose with or without fee is hereby granted, provided that the above
+#  copyright notice and this permission notice appear in all copies.
+#
+#  THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL
+#  WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
+#  OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE
+#  FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
+#  DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
+#  IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
+#  OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+# PEG Rules for parsing well formed HTML 5 documents
+# https://html.spec.whatwg.org/multipage/syntax.html
+
+html<-- bom? blurb* doctype? blurb* xmlProlog? blurb* elem blurb*
+bom <-- \"\\uFEFF\"
+xmlProlog   <-- \"\" .)+ \"?>\"
+
+#  Doctype 
+
+doctype   <-- \"\"
+doctypePublicId   <-- [ \\t\\n\\f\\r]+  \"PUBLIC\" [ \\t\\n\\f\\r]+   
((\"\\\"\" [^\"]* \"\\\"\") / (\"'\" [^']* \"'\"))
+doctypeSystemId   <-- [ \\t\\n\\f\\r]+ (\"SYSTEM\" [ \\t\\n\\f\\r]+)? 
((\"\\\"\" [^\"]* \"\\\"\") / (\"'\" [^']* \"'\"))
+
+#  Elems 
+
+elem  <-- voidElem / rawTextElem / escRawTextElem / 
selfClosingElem / normalElem
+voidElem  <-- \"<\"  voidElemName   attributes  \">\"
+rawTextElem   <-- \"<\"  rawTextElemNameattributes  \">\" 
rawTextContent endElem
+escRawTextElem<-- \"<\"  escRawTextElemName attributes  \">\" 
escRawTextContent endElem
+selfClosingElem   <-- \"<\"  elemName   attributes \"/>\"
+normalElem<-- \"<\"  elemName   attributes  \">\" 
normalContent? endElem?
+endElem   <-- \"\"
+
+elemName<-- [a-zA-Z] [^\\t\\n\\f />]*
+voidElemName<-- \"area\" / \"base\" / \"br\" / \"col\" / \"embed\" /
+  \"hr\" / \"img\" / \"input\" / \"keygen\" / \"link\" /
+  \"meta\" / \"param\" / \"source\" / \"track\" / \"wbr\"
+rawTextElemName <-- \"script\" / \"style\"
+escRawTextElemName  <-- \"textarea\" / \"title\"
+
+rawTextContent  <-- (!(\"\" / \"\") .)+
+escRawTextContent   <-- ((!(\"\" / \"\" / \"&\") .)+ / 
charRef)*
+normalContent   <-- !\"] ([ \\t]+ / doubleQuoteAttr / singleQuoteAttr / 
unquotedAttr / emptyAttr))*
+attrName  <-- [^ \\t\\n\\r\\f\"'>/=]+
+emptyAttr <-- attrName+
+unquotedAttr  <-- attrName [ \\t]* \"=\" [ \\t]*  (charRef / [^ 
\\t\\n\\r\\f\"'=<>`&]+)+
+singleQuoteAttr   <-- attrName [ \\t]* \"=\" [ \\t]* \"'\"  (charRef / 
[^'&]+)* \"'\"
+doubleQuoteAttr   <-- attrName [ \\t]* \"=\" [ \\t]* \"\\\"\" (charRef / 
[^\"&]+)* \"\\\"\"
+
+#  Character References 
+
+charRef <-- &\"&\" (decNumCharRef / hexNumCharRef / namedCharRef / 
borkedRef)
+namedCharRef<-- \"&\"   [^;>]+ \";\"
+decNumCharRef   <-- \"&#\"  [0-9]+ \";\"
+hexNumCharRef   <-- \"&#x\" [a-fA-F0-9]+ \";\"
+borkedRef   <-- \"&\"  &[ \\t]
+
+#  Misc 
+
+cdata   <-- \"\" .)+ \"]]>\"
+comment <-- \"\"
+blurb   <-- [ \\t\\n\\f\\r]+ / comment")
+
+(define html-example "
+
+
+
+Example Domain
+
+
+
+
+body {
+background-color: #f0f0f2;
+margin: 0;
+padding: 0;
+}
+
+
+
+
+
+Example Domain
+This domain is for use in illustrative examples in documents. You may
+use this domain in literature without prior coordination or asking for
+permission. https://www.iana.org/domains/example\";>More
+information...
+
+
+
+")
+
+(with-test-prefix "Parsing with complex grammars"
+  (eeval `(define-peg-string-patterns ,html-grammar))
+  (pass-if
+"HTML parsing"
+(equal?
+  

bug#73188: [PATCH 2/3] PEG: string-peg: better support for escaping

2024-12-22 Thread Ekaitz Zarraga
---
 module/ice-9/peg/string-peg.scm | 26 +++---
 1 file changed, 23 insertions(+), 3 deletions(-)

diff --git a/module/ice-9/peg/string-peg.scm b/module/ice-9/peg/string-peg.scm
index 745d8e8e7..9891f2ae5 100644
--- a/module/ice-9/peg/string-peg.scm
+++ b/module/ice-9/peg/string-peg.scm
@@ -67,9 +67,10 @@ Literal <-- SQUOTE (!SQUOTE Char)* SQUOTE Spacing
 NotInClass <-- OPENBRACKET NOTIN  (!CLOSEBRACKET Range)* CLOSEBRACKET Spacing
 Class <-- OPENBRACKET !NOTIN  (!CLOSEBRACKET Range)* CLOSEBRACKET Spacing
 Range <-- Char DASH Char / Char
-Char <-- '' [nrt'\"\\[\\]]
+Char <-- '' [nrtf'\"\\[\\]]
/ '' [0-7][0-7][0-7]
/ '' [0-7][0-7]?
+   / '' 'u' HEX HEX HEX HEX
/ !'' .
 
 # NOTE: `<--` and `<` are extensions
@@ -79,6 +80,7 @@ DQUOTE < [\"]
 DASH < '-'
 OPENBRACKET < '['
 CLOSEBRACKET < ']'
+HEX <- [0-9a-fA-F]
 NOTIN < '^'
 SLASH < '/' Spacing
 AND <-- '&' Spacing
@@ -92,7 +94,7 @@ DOT <-- '.' Spacing
 
 Spacing < (Space / Comment)*
 Comment < '#' (!EndOfLine .)* EndOfLine
-Space < ' ' / '\t' / EndOfLine
+Space < ' ' / '\\t' / EndOfLine
 EndOfLine < '\\r\\n' / '\\n' / '\\r'
 EndOfFile < !.
 ")
@@ -144,12 +146,15 @@ EndOfFile < !.
 (define-sexp-parser Range all
   (or (and Char DASH Char) Char))
 (define-sexp-parser Char all
-  (or (and "\\" (or "n" "r" "t" "'" "\"" "[" "]" "\\"))
+  (or (and "\\" (or "n" "r" "t" "f" "'" "\"" "[" "]" "\\"))
   (and "\\" (range #\0 #\7) (range #\0 #\7) (range #\0 #\7))
   (and "\\" (range #\0 #\7) (? (range #\0 #\7)))
+  (and "\\" "u" HEX HEX HEX HEX)
   (and (not-followed-by "\\") peg-any)))
 (define-sexp-parser LEFTARROW body
   (and (or "<--" "<-" "<") Spacing)) ; NOTE: <-- and < are extensions
+(define-sexp-parser HEX body
+  (or (range #\0 #\9) (range #\a #\f) (range #\A #\F)))
 (define-sexp-parser NOTIN none
   (and "^"))
 (define-sexp-parser SLASH none
@@ -372,12 +377,27 @@ EndOfFile < !.
  (* (- (char->integer x) (char->integer #\0)) y))
(reverse (string->list charstr 1))
'(1 8 64)
+  ((char=? #\u (string-ref charstr 1))
+   (integer->char
+ (reduce + 0
+ (map
+   (lambda (x y)
+ (* (cond
+  ((char-numeric? x)
+   (- (char->integer x) (char->integer #\0)))
+  ((char-alphabetic? x)
+   (+ 10 (- (char->integer x) (char->integer #\a)
+y))
+   (reverse (string->list (string-downcase charstr) 2))
+   '(1 16 256 4096)
   (else
 (case (string-ref charstr 1)
   ((#\n) #\newline)
   ((#\r) #\return)
   ((#\t) #\tab)
+  ((#\f) #\page)
   ((#\') #\')
+  ((#\") #\")
   ((#\]) #\])
   ((#\\) #\\)
   ((#\[) #\[))
-- 
2.46.0






bug#75040: [PATCH] Remove lib/malloc/.dirstamp and register to .gitignore.

2024-12-22 Thread Maxim Cournoyer
* lib/malloc/.dirstamp: Delete file.
* .gitignore: Register.
---
 .gitignore   | 2 +-
 lib/malloc/.dirstamp | 0
 2 files changed, 1 insertion(+), 1 deletion(-)
 delete mode 100644 lib/malloc/.dirstamp

diff --git a/.gitignore b/.gitignore
index 7706a0879..8180beb12 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
+.dirstamp
 *.o
 *.info
 *.info-[0-9]*
@@ -126,7 +127,6 @@ INSTALL
 /lib/sys/uio.h
 /lib/time.h
 /lib/unistd.h
-/lib/unistr/.dirstamp
 /lib/unistr.h
 /lib/unitypes.h
 /lib/unused-parameter.h
diff --git a/lib/malloc/.dirstamp b/lib/malloc/.dirstamp
deleted file mode 100644
index e69de29bb..0

base-commit: f6359a4715d023761454f1bf945633ce4cca98fc
-- 
2.46.0






bug#74840: [PATCH] doc: srfi-19: Use `day' instead of `date' for `make-date'.

2024-12-22 Thread Ludovic Courtès
Tomas Volf <~@wolfsden.cz> skribis:

> Looking at the SRFI-19 specification, the argument is called `day', not
> `date'.  Even the accessor is called `date-day'.  So adjust the
> documentation to match.
>
> Also adjust the (web http) module, which was using `date' as well.
>
> * doc/ref/srfi-modules.texi (SRFI-19 Date): Use `day' instead of `date'.
> * module/web/http.scm (parse-rfc-822-date, parse-rfc-850-date)
> (parse-asctime-date): Same.

Applied, thanks!





bug#74841: [PATCH] srfi-19: Fix ~V converter in date->string.

2024-12-22 Thread Ludovic Courtès
Hi,

Tomas Volf <~@wolfsden.cz> skribis:

> The ~V is supposed to print ISO week number, not a week number.  This
> commit fixes that.
>
> * module/srfi/srfi-19.scm (date-week-number-iso): New procedure taken
> from the reference implementation.
> (directives)<#\V>: Use it.
> * test-suite/tests/srfi-19.test ("date->string ~V"): Add tests taken
> from the reference test suite.

The manual just reads this:

 ~U week of year, Sunday first day of week, ‘00’ to
‘52’
 ~V week of year, Monday first day of week, ‘01’ to
‘53’

Should it be fixed or clarified?

> +(define (date-week-number-iso date)

Please add a docstring.

> +  (let ((convert (λ (lst)
> +   (date->string
> +(make-date 0 0 0 0
> +   (caddr lst) (cadr lst) (car lst)

Please use ‘match-lambda’.

> +(with-test-prefix "date->string ~V"
> +  (pass-if-equal "Thursday, week 53" "53"

If these are from the SRFI-19 spec, could you add a comment to say so?

Thanks,
Ludo’.





bug#73188: PEG parser does not support full PEG grammar

2024-12-22 Thread Ludovic Courtès
Hi Ekaitz,

Apologies for applying the wrong version of the patch series!

I pushed the 3 patches you just sent:

  6750f6cc8 * PEG: string-peg: Add HTML5 grammar test.
  38ad26497 * PEG: string-peg: Better support for escaping.
  c86a48a92 * PEG: string-peg: Fix [^...] interpretation.

I added commit logs that follow the project’s conventions (same as
Guix).

In the future, when a patch fixes a bug, please include a test case that
reproduces the bug being fixed; possibly add information in the commit
log about the commit that introduced the bug/regression.  This is useful
to get a good understanding of the situation.  (I understand in this
case the problem was mostly me applying an earlier version.)

And bonus points if you provide commit logs.  :-)

Thank you!

Ludo’.





bug#71300: [PATCH v3] doc: Document SRFI 64.

2024-12-22 Thread Ludovic Courtès
Hi Maxim,

Maxim Cournoyer  skribis:

> This is an import of the 'Abstract', 'Rationale', and 'Specification'
> sections from the upstream specification text, with some manual
> adjustment.
>
> * doc/ref/srfi-modules.texi (SRFI 64): New subsection.

Finally applied with the typographical changes below, for consistency
with (most of) the rest of the manual.

Thanks,
Ludo’.

diff --git a/doc/ref/srfi-modules.texi b/doc/ref/srfi-modules.texi
index 4bad8abbf..db54428ad 100644
--- a/doc/ref/srfi-modules.texi
+++ b/doc/ref/srfi-modules.texi
@@ -56,7 +56,7 @@ get the relevant SRFI documents from the SRFI home page
 * SRFI-60:: Integers as bits.
 * SRFI-61:: A more general `cond' clause
 * SRFI-62:: S-expression comments.
-* SRFI 64:: A Scheme API for test suites.
+* SRFI-64:: Writing test suites.
 * SRFI-67:: Compare procedures
 * SRFI-69:: Basic hash tables.
 * SRFI-71:: Extended let-syntax for multiple values.
@@ -5295,22 +5295,23 @@ S-expression comments by default.
 
 @c This SRFI 64 documentation was "snarfed" from upstream specification
 @c HTML document using the 'snarfi' script.
-@node SRFI 64
-@subsection SRFI 64: A Scheme API for test suites
-@cindex SRFI 64
+@node SRFI-64
+@subsection SRFI-64: A Scheme API for Test Suites
+@cindex SRFI-64, test suites
+@cindex test suites, SRFI-64
 
 @menu
-* SRFI 64 Abstract::
-* SRFI 64 Rationale::
-* SRFI 64 Writing basic test suites::
-* SRFI 64 Conditonal test-suites and other advanced features::
-* SRFI 64 Test-runner::
-* SRFI 64 Test results::
-* SRFI 64 Writing a new test-runner::
+* SRFI-64 Abstract::
+* SRFI-64 Rationale::
+* SRFI-64 Writing Basic Test Suites::
+* SRFI-64 Conditonal Test Suites and Other Advanced Features::
+* SRFI-64 Test Runner::
+* SRFI-64 Test Results::
+* SRFI-64 Writing a New Test Runner::
 @end menu
 
-@node SRFI 64 Abstract
-@subsubsection SRFI 64 Abstract
+@node SRFI-64 Abstract
+@subsubsection SRFI-64 Abstract
 
 This defines an API for writing @dfn{test suites}, to make it easy to
 portably test Scheme APIs, libraries, applications, and implementations.
@@ -5319,8 +5320,8 @@ context of a @dfn{test-runner}.  This specification also supports
 writing new test-runners, to allow customization of reporting and
 processing the result of running test suites.
 
-@node SRFI 64 Rationale
-@subsubsection SRFI 64 Rationale
+@node SRFI-64 Rationale
+@subsubsection SRFI-64 Rationale
 
 The Scheme community needs a standard for writing test suites.  Every
 SRFI or other library should come with a test suite.  Such a test suite
@@ -5359,8 +5360,8 @@ syntax is to allow specific tests to be skipped without evaluating
 sub-expressions, or for implementations to add features such as printing
 line numbers or catching exceptions.
 
-@node SRFI 64 Writing basic test suites
-@subsubsection SRFI 64 Writing basic test suites
+@node SRFI-64 Writing Basic Test Suites
+@subsubsection SRFI-64 Writing Basic Test Suites
 
 Let's start with a simple example.  This is a complete self-contained
 test-suite.
@@ -5607,8 +5608,8 @@ For example:
 @end lisp
 @end deffn
 
-@node SRFI 64 Conditonal test-suites and other advanced features
-@subsubsection SRFI 64 Conditonal test-suites and other advanced features
+@node SRFI-64 Conditonal Test Suites and Other Advanced Features
+@subsubsection SRFI-64 Conditonal Test Suites and Other Advanced Features
 
 The following describes features for controlling which tests to execute,
 or specifying that some tests are @emph{expected} to fail.
@@ -5716,8 +5717,8 @@ not test execution.  For example:
 @end lisp
 @end deffn
 
-@node SRFI 64 Test-runner
-@subsubsection SRFI 64 Test-runner
+@node SRFI-64 Test Runner
+@subsubsection SRFI-64 Test Runner
 
 A @dfn{test-runner} is an object that runs a test-suite, and manages the
 state.  The test group path, and the sets skip and expected-fail
@@ -5787,14 +5788,14 @@ Executes each @var{decl-or-expr} in order in a context where the current
 test-runner is @var{runner}.
 @end deffn
 
-@node SRFI 64 Test results
-@subsubsection SRFI 64 Test results
+@node SRFI-64 Test Results
+@subsubsection SRFI-64 Test Results
 
 Running a test sets various status properties in the current test-runner.
 This can be examined by a custom test-runner,
 or (more rarely) in a test-suite.
 
-@subsubheading Result kind
+@subsubheading Result Kind
 
 Running a test may yield one of the following
 status symbols:
@@ -5912,13 +5913,13 @@ The error value, if an error was signalled and it is known.
 The actual error value is implementation-defined.
 @end table
 
-@node SRFI 64 Writing a new test-runner
-@subsubsection SRFI 64 Writing a new test-runner
+@node SRFI-64 Writing a New Test Runner
+@subsubsection SRFI-64 Writing a New Test Runner
 
 This section specifies how to write a test-runner.  It can be ignored if
 you just want to write test-cases.
 
-@subsubh

bug#74696: [PATCH 1/1] srfi-1: map!: Re-use cons cells of first argument.

2024-12-22 Thread Ludovic Courtès
Hi Juliana,

Juliana Sims  skribis:

> * module/srfi/srfi-1.scm (map!): Re-use cons cells of first argument.

Could you add a couple of tests under ‘test-suite/tests/srfi-1.test’?

Apart from that it looks good to me.  Thank you!

Ludo’.





bug#73188: PEG parser does not support full PEG grammar

2024-12-22 Thread Ekaitz Zarraga
The three previous messages (SORRY) add the changes that were missing in 
when v4 was applied instead of v5.






bug#71300: [PATCH v3] doc: Document SRFI 64.

2024-12-22 Thread Maxim Cournoyer
Hi Ludovic,

Ludovic Courtès  writes:

> Hi Maxim,
>
> Maxim Cournoyer  skribis:
>
>> This is an import of the 'Abstract', 'Rationale', and 'Specification'
>> sections from the upstream specification text, with some manual
>> adjustment.
>>
>> * doc/ref/srfi-modules.texi (SRFI 64): New subsection.
>
> Finally applied with the typographical changes below, for consistency
> with (most of) the rest of the manual.

Yay!  Thank you.  I won't need to refer to the old HTML page anymore
:-).

-- 
Maxim