Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1JOB7G-0001aQ-FY for mharc-grub-devel@gnu.org; Sun, 10 Feb 2008 07:17:02 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JOB7E-0001Xk-Fa for grub-devel@gnu.org; Sun, 10 Feb 2008 07:17:00 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JOB7C-0001V0-QD for grub-devel@gnu.org; Sun, 10 Feb 2008 07:17:00 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JOB7C-0001Ub-FK for grub-devel@gnu.org; Sun, 10 Feb 2008 07:16:58 -0500 Received: from ti-out-0910.google.com ([209.85.142.185]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JOB7C-0003jG-1g for grub-devel@gnu.org; Sun, 10 Feb 2008 07:16:58 -0500 Received: by ti-out-0910.google.com with SMTP id a20so184316tia.10 for ; Sun, 10 Feb 2008 04:16:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=9QTT62N4nJ0jLeSK8H63uu3HhO0WcLLqMAo0V2LIen0=; b=Fl0+PEsr8QwXLbg91RprPnt6XrywD+AuffPXmZdNVP4Cf28MhvIKO0d0032nu4/4jx6Yj7SDy/y5P1jaozhRDY4qH1nNsLj362N1xOaio+qbESuzwop3tuj1IKCczBAWc4rG+16n05UHLJptt0ZvFt6soLuzusXGoy1sbBxsdso= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=X98crKnctrxMojkB/k2pp1EULPHKkdFrv9R64EZq8hG7d+DHejmLXGC6xF4Ui2R9JGugR2X0N92vl/7DBcMCwkkYHS5hOv9tBDCGyz9gysUWxO0a2TSD9BN1S+pidwLS8G3h+1T3vdMBoA/fF/sbWel8ciecke31DbFUL0CpikM= Received: by 10.110.28.2 with SMTP id b2mr7925368tib.39.1202645815369; Sun, 10 Feb 2008 04:16:55 -0800 (PST) Received: by 10.110.62.19 with HTTP; Sun, 10 Feb 2008 04:16:55 -0800 (PST) Message-ID: Date: Sun, 10 Feb 2008 20:16:55 +0800 From: Bean To: "The development of GRUB 2" In-Reply-To: <20080210121017.GB1828@thorin> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20080209211552.GA9582@thorin> <20080210121017.GB1828@thorin> X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) Subject: Re: parser eats '=' after variable names X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Feb 2008 12:17:00 -0000 On Feb 10, 2008 8:10 PM, Robert Millan wrote: > > On Sun, Feb 10, 2008 at 05:55:25PM +0800, Bean wrote: > > On Feb 10, 2008 5:15 AM, Robert Millan wrote: > > > > > > It seems that the parser eats the extra '=' when used after a variable > > > evaluation: > > > > > > grub> set a=a > > > grub> echo $a > > > a > > > grub> echo $a= > > > > > > grub> > > > > > > This breaks e.g. variable comparison via "test $a=b". Does someone have an > > > idea on how to fix it? I assume it involves the bison stuff which is highly > > > confusing to me... :-/ > > > > This problem is caused by the lexer, the token is broken when a > > variable is found. so $a will be a token, and =b will be another one. > > I have written a patch some time ago, it works by constructing a > > GRUB_PARSER_TOKEN_VAR inside grub_script_yylex2, and return it to the > > parser. > > Ah, I thought all your lexer changes had been committed. Do you remember > the mail subject? The parser part have been committed, but the lexer part is not. the patch is very old, i think it can't be applied directly. -- Bean