From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ekaitz Zarraga Newsgroups: gmane.lisp.guile.devel Subject: Re: [PATCH v2 5/5] peg: Add fall-back parsing. Date: Mon, 14 Oct 2024 17:58:41 +0200 Message-ID: <4c1b640b-41f8-4d74-9889-1c1d69a845be@elenq.tech> References: <87seszdu1d.fsf@gnu.org> <20241014073109.19774-1-janneke@gnu.org> <20241014073109.19774-5-janneke@gnu.org> <87iktvdtkr.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33442"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Rutger van Beusekom To: Janneke Nieuwenhuizen , guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Mon Oct 14 17:59:26 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 1t0NTi-0008X3-CH for guile-devel@m.gmane-mx.org; Mon, 14 Oct 2024 17:59:26 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t0NTF-00017H-8s; Mon, 14 Oct 2024 11:58:57 -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 1t0NT8-00016u-Gj for guile-devel@gnu.org; Mon, 14 Oct 2024 11:58:51 -0400 Original-Received: from dane.soverin.net ([2a10:de80:1:4092:b9e9:229d:0:1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t0NT6-0004x8-9y; Mon, 14 Oct 2024 11:58:50 -0400 Original-Received: from smtp.soverin.net (c04smtp-lb01.int.sover.in [10.10.4.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dane.soverin.net (Postfix) with ESMTPS id 4XS22q1SqZzyRF; Mon, 14 Oct 2024 15:58:43 +0000 (UTC) Original-Received: from smtp.soverin.net (smtp.soverin.net [10.10.4.99]) by soverin.net (Postfix) with ESMTPSA id 4XS22p411mz3V; Mon, 14 Oct 2024 15:58:42 +0000 (UTC) Authentication-Results: smtp.soverin.net; dkim=pass (2048-bit key; unprotected) header.d=elenq.tech header.i=@elenq.tech header.a=rsa-sha256 header.s=soverin1 header.b=v/qmdTJi; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=elenq.tech; s=soverin1; t=1728921522; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=eFg1QyZg2f6h/9lctoluaMwtMhaddf2alh9iMjdWGrU=; b=v/qmdTJi/C2OjIlXBqYvqIRWHQhAzPGYEZcr0pST8LmHoDeU+xb5JhBCID7rvGJ0oNKttq tiyVO1y3cNLGaTEo2NYaZSBL8iXzWQ4XfTckqBJP8R4zmWQtU5QW7hE6mipzbpoXaw35xv XseauW1kNt6p45ypaOb7XqSIef8sCI0KFIRpQfhm9ZVo3puG2d0tVyFPO2fCxLL2MZcejs CHltmboDEnC9d9Kd3wOCD7CnBT5TdMVil5mkDzbTpwvTnk0THHJJO3Mvi9qg60v+gCLi0R iausM9Y6ySJ/JupyXuj55uuGlnfd3IWZiUBJnKXHU262AU54ckUQ6dIuUW2lIw== Content-Language: en-US, es-ES, eu Autocrypt: addr=ekaitz@elenq.tech; keydata= xsFNBGViSyIBEADY3g71uW/0CVaVm5/ObqTicQXXJRuh1uafIFiUUZoAp1V3V89b3LZ/m0cL 8YNHxTxsx8sKIMYTGlOvARAMiSpDvkmpf5pLn5T7+VvK90FOv/Pkp1tNNT+tvd0m/7C58+39 s7tN+XppbjVRtFuSXY0aFe8rpivZsKxv+tPUHUnQQszXvwgx0GQl8AX99IE+j75NJmBHFVg2 0geKa7QVymu669ix2+zU8vGoOKf5nIS0qG1m/vrtwR3ZuuyWX9/E/uP95ahX5ETWtjhTDbEm MEaRperwbczBewkdERJ34vRrverqKQA1xHXoPsx4NkLMocORFSSCJsveXcgWlU+pUIOYcKUA ARJjHhoWoUH4LZt5EOb7U17AaYMmATUXPCqq8G3jEXq6i0O1J1obCJGIRG02R9GiGp4zrVuv 2hmyoAmed4xYZAtf9WjcbwiunDkMGIxscdSlfEH/9dt7PGdEvkZ0dNSCTbp4ctMI4jAfobAL LReMSGx1CgPi01J61a/n/SgR66AiRJZCyC1u2V7AK1rBOAYzOU4UoePz+yF1I7crjZWAQVo6 DlmmXW+29l/lh2oK5jOuNEcvI6qi+tPCYxpDhUhZeYgqFU+/xgGlMj/XGvwuIFlpVg9ovFMg 6mxskOCVP9xNEp/qHiHqByYu5NRcITo/z/3BUimdXTT4KSq2cQARAQABzSJFa2FpdHogWmFy cmFnYSA8ZWthaXR6QGVsZW5xLnRlY2g+wsGOBBMBCAA4FiEEg/pnRVjAUpRlfkwZt5lM+Jly CyYFAmViSyICGwMFCwkIBwIGFQoJCAsCBBYCAwECH In-Reply-To: <87iktvdtkr.fsf@gnu.org> X-Spampanel-Class: ham Received-SPF: pass client-ip=2a10:de80:1:4092:b9e9:229d:0:1; envelope-from=ekaitz@elenq.tech; helo=dane.soverin.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:22738 Archived-At: On 2024-10-14 09:36, Janneke Nieuwenhuizen wrote: > Janneke Nieuwenhuizen writes: > >> From: Rutger van Beusekom >> >> This allows production of incomplete parse trees, without errors, e.g., >> for code completion. >> >> * module/ice-9/peg/codegen.scm (%peg:fall-back?): New exported >> parameter. >> (%enable-expect, %continuation, %final-continuation): New parameter. >> (final-continuation): New function. >> (cg-or-rest): New function. >> (cg-and-int): Recover from expectation failures, fall-back by skipping >> forward or escalating upward. >> (cg-*): Prepare fall-back %continuation. >> * test-suite/tests/peg.test ("Fall-back parser"): Test it. >> * doc/ref/api-peg.texi (PEG Internals): Document it. >> >> Co-authored-by: Janneke Nieuwenhuizen >> >> fall-back >> >> fall-back >> >> fallback > > Oops, find cleaned-up version attached. > > > Hi all, I think this change is not compatible with the PEG syntax. In PEG # is a line comment: https://bford.info/pub/lang/peg.pdf I think we should take a look to what PEG/LEG does to see if they implement the same idea and copy the syntax they use. If they do. https://github.com/gpakosz/peg/blob/upstream/src/peg.1 I'll take a deeper look to it, the rest of the commits seem good, but I'll also review in detail and propose something compatible with what I'm trying to push for in #73188. Thanks for sharing all these commits, they are very interesting and helpful. Ekaitz