From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Noah Lavine Newsgroups: gmane.lisp.guile.devel Subject: Re: PEG Parser Date: Thu, 27 Jan 2011 00:17:50 -0500 Message-ID: References: <87bp3fi5cp.fsf@gnu.org> <87aaisr6sn.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1296105494 22931 80.91.229.12 (27 Jan 2011 05:18:14 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 27 Jan 2011 05:18:14 +0000 (UTC) Cc: =?ISO-8859-1?Q?Ludovic_Court=E8s?= , guile-devel@gnu.org To: Michael Lucy Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Thu Jan 27 06:18:10 2011 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PiKF6-0006mu-UF for guile-devel@m.gmane.org; Thu, 27 Jan 2011 06:18:08 +0100 Original-Received: from localhost ([127.0.0.1]:53150 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PiKF2-0004qm-BK for guile-devel@m.gmane.org; Thu, 27 Jan 2011 00:17:56 -0500 Original-Received: from [140.186.70.92] (port=43173 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PiKEz-0004ps-AP for guile-devel@gnu.org; Thu, 27 Jan 2011 00:17:54 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PiKEx-0002xS-Rt for guile-devel@gnu.org; Thu, 27 Jan 2011 00:17:52 -0500 Original-Received: from mail-yw0-f41.google.com ([209.85.213.41]:53844) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PiKEx-0002x7-Of; Thu, 27 Jan 2011 00:17:51 -0500 Original-Received: by ywj3 with SMTP id 3so547875ywj.0 for ; Wed, 26 Jan 2011 21:17:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=T7TMFGhewiNCm06B+017sDeUi5+qDNu4zhaEckh6G8M=; b=Pyey2ToRWVTYUAb3Gm9HItp4ZowfY5ZIUhj6i66jB9bYfyGELB6z2ieSs2Q7gpb+ZW Dps1iwqKUlyfF7ze1xkqJCG3lsbKKNTSFVnRonX2GP185xY++LHvhk7Fh8UDOEc2jmYB zZHmX/hOBGm6zFjWSanU4Q4Xje7BxmXRJnFrE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=AfRlYTsg66ElYk6I2LthC27UZJ8/SEp/g1Gp4tekkW7wl/a6DuhYdzTKzarYwDYbJT slKBbSCJREvekZ7QDcyPdV2nMlKGKtshJKC+EFZkNVTWT5PZJNjpJDVOvUFfiCqUsCuz 96wFy1a+mNHqGcgTLgYyxZL6C666X1WhJ3dRg= Original-Received: by 10.236.95.41 with SMTP id o29mr974287yhf.29.1296105470973; Wed, 26 Jan 2011 21:17:50 -0800 (PST) Original-Received: by 10.147.32.7 with HTTP; Wed, 26 Jan 2011 21:17:50 -0800 (PST) In-Reply-To: X-Google-Sender-Auth: rIEAXuNuBi7i8bgnKnxQBRT0iNI X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:11354 Archived-At: Hi, > It flattens until you have a list where each element either: > 1. Is an atom. > or 2. Is a list whose first element is in the list of keywords. > > So the car of the argument will change if it's a list that doesn't > start with the right keyword. =A0E.g.: > (keyword-flatten '(a) '((c (a b)) (a b) (b a))) -> > (c (a b) (a b) b a) I see. > That's odd. =A0Could you paste in the lambda expression it generates? Wait, actually, I realized it was my own error. My test function was using nonterminals, but I had only done (define grammar-string ....), not (define-grammar grammar-string). I think the generated code tried to call the nonterminals that should have been there, and threw an error when it didn't find them. The peg matcher is really awesome. I am glad to be able to use it soon. Noah