From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Janneke Nieuwenhuizen Newsgroups: gmane.lisp.guile.devel Subject: [PATCH v2 1/5] Remove trailing whitespace in PEG texinfo. Date: Mon, 14 Oct 2024 09:31:05 +0200 Message-ID: <20241014073109.19774-1-janneke@gnu.org> References: <87seszdu1d.fsf@gnu.org> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24833"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Ekaitz Zarraga , Rutger van Beusekom To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Mon Oct 14 09:32:44 2024 Return-path: Envelope-to: guile-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1t0FZM-0006Lo-8T for guile-devel@m.gmane-mx.org; Mon, 14 Oct 2024 09:32:44 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t0FYG-0008Uj-4I; Mon, 14 Oct 2024 03:31:36 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t0FXw-0008Qo-BR for guile-devel@gnu.org; Mon, 14 Oct 2024 03:31:16 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t0FXu-0007Sn-4s; Mon, 14 Oct 2024 03:31:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=g/XQ+X0biXKQ5OTfd3uUNZVaO5D7DQvvgrAcS9jtmVY=; b=sE8WeOc5TQwInYfhB2TR 4p69pWMEjEjrKyau+bUqhYLZFClfyUL4KdQvAmCS/XzM9C5HfqeKwIlIHrgdi86a+iTqgtqS4VjXj 76gNUCpHN5Y9IlmAb7byTfFrb/5+UwYUvRAQFoRDQOi2xAIUohzBnbysPQvxPRLhZAtXbOiHCLTWY MGcrmMMSylrY0d0ZXE/8N1opbpdeF1K/OceNXmEm6yqTj8my2WwjCkdV4aG8Mey8nnsLMPqcAFgaA deJEM7EZT/B2UcyQj3/Je9c3LzdKwpLwzZEW2+GrdgsldfbewGivA6UEbX0iQCUO+ow+wLGYnPkuE vo3S2snHGp5maQ==; X-Mailer: git-send-email 2.46.0 In-Reply-To: <87seszdu1d.fsf@gnu.org> X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.lisp.guile.devel:22736 Archived-At: From: Rutger van Beusekom * doc/ref/api-peg.texi (PEG API Reference): Remove trailing whitespace. --- doc/ref/api-peg.texi | 46 ++++++++++++++++++++++---------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/doc/ref/api-peg.texi b/doc/ref/api-peg.texi index d34ddc64c..0214f7ff1 100644 --- a/doc/ref/api-peg.texi +++ b/doc/ref/api-peg.texi @@ -221,11 +221,11 @@ character (in normal PEGs nonterminals can only be alphabetic). For example, if we: @lisp -(define-peg-string-patterns +(define-peg-string-patterns "as <- 'a'+ bs <- 'b'+ as-or-bs <- as/bs") -(define-peg-string-patterns +(define-peg-string-patterns "as-tag <-- 'a'+ bs-tag <-- 'b'+ as-or-bs-tag <-- as-tag/bs-tag") @@ -271,9 +271,9 @@ For Example, if we: @end lisp Then: @lisp -(match-pattern as-or-bs "aabbcc") @result{} +(match-pattern as-or-bs "aabbcc") @result{} # -(match-pattern as-or-bs-tag "aabbcc") @result{} +(match-pattern as-or-bs-tag "aabbcc") @result{} # @end lisp @@ -325,7 +325,7 @@ find a valid substring starting at index 0 and @code{search-for-pattern} keeps looking. They are both equally capable of ``parsing'' and ``matching'' given those constraints. -@deffn {Scheme Procedure} match-pattern nonterm string +@deffn {Scheme Procedure} match-pattern nonterm string Parses @var{string} using the PEG stored in @var{nonterm}. If no match was found, @code{match-pattern} returns false. If a match was found, a PEG match record is returned. @@ -344,19 +344,19 @@ nothing @lisp (define-peg-pattern as all (+ "a")) -(match-pattern as "aabbcc") @result{} +(match-pattern as "aabbcc") @result{} # (define-peg-pattern as body (+ "a")) -(match-pattern as "aabbcc") @result{} +(match-pattern as "aabbcc") @result{} # (define-peg-pattern as none (+ "a")) -(match-pattern as "aabbcc") @result{} +(match-pattern as "aabbcc") @result{} # (define-peg-pattern bs body (+ "b")) -(match-pattern bs "aabbcc") @result{} +(match-pattern bs "aabbcc") @result{} #f @end lisp @end deffn @@ -371,31 +371,31 @@ was found, a PEG match record is returned. @lisp (define-peg-pattern as body (+ "a")) -(search-for-pattern as "aabbcc") @result{} +(search-for-pattern as "aabbcc") @result{} # -(search-for-pattern (+ "a") "aabbcc") @result{} +(search-for-pattern (+ "a") "aabbcc") @result{} # -(search-for-pattern "'a'+" "aabbcc") @result{} +(search-for-pattern "'a'+" "aabbcc") @result{} # (define-peg-pattern as all (+ "a")) -(search-for-pattern as "aabbcc") @result{} +(search-for-pattern as "aabbcc") @result{} # (define-peg-pattern bs body (+ "b")) -(search-for-pattern bs "aabbcc") @result{} +(search-for-pattern bs "aabbcc") @result{} # -(search-for-pattern (+ "b") "aabbcc") @result{} +(search-for-pattern (+ "b") "aabbcc") @result{} # -(search-for-pattern "'b'+" "aabbcc") @result{} +(search-for-pattern "'b'+" "aabbcc") @result{} # (define-peg-pattern zs body (+ "z")) -(search-for-pattern zs "aabbcc") @result{} +(search-for-pattern zs "aabbcc") @result{} #f -(search-for-pattern (+ "z") "aabbcc") @result{} +(search-for-pattern (+ "z") "aabbcc") @result{} #f -(search-for-pattern "'z'+" "aabbcc") @result{} +(search-for-pattern "'z'+" "aabbcc") @result{} #f @end lisp @end deffn @@ -468,9 +468,9 @@ itself satisfies @var{tst}, @code{(list lst)} is returned (this is a flat list whose only element satisfies @var{tst}). @lisp -(context-flatten (lambda (x) (and (number? (car x)) (= (car x) 1))) '(2 2 (1 1 (2 2)) (2 2 (1 1)))) @result{} +(context-flatten (lambda (x) (and (number? (car x)) (= (car x) 1))) '(2 2 (1 1 (2 2)) (2 2 (1 1)))) @result{} (2 2 (1 1 (2 2)) 2 2 (1 1)) -(context-flatten (lambda (x) (and (number? (car x)) (= (car x) 1))) '(1 1 (1 1 (2 2)) (2 2 (1 1)))) @result{} +(context-flatten (lambda (x) (and (number? (car x)) (= (car x) 1))) '(1 1 (1 1 (2 2)) (2 2 (1 1)))) @result{} ((1 1 (1 1 (2 2)) (2 2 (1 1)))) @end lisp @@ -624,7 +624,7 @@ symbol for strings).. (entry "nobody:x:65534:65534:nobody:/nonexistent:/bin/sh") (entry "messagebus:x:103:107::/var/run/dbus:/bin/false")) (peg:tree (match-pattern tag-passwd "one entry")) -(tag-passwd +(tag-passwd (entry "one entry")) @end lisp @@ -841,7 +841,7 @@ number <-- [0-9]+") (apply next-func (car first)) (apply next-func (car rest))) ;; form (sum (((product ...) "+") ((product ...) "+")) (product ...)) - (car + (car (reduce ;; walk through the list and build a left-associative tree (lambda (l r) (list (list (cadr r) (car r) (apply next-func (car l))) -- 2.46.0