Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1M0bBn-0006en-Ik for mharc-grub-devel@gnu.org; Sun, 03 May 2009 08:53:03 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M0bBl-0006eh-FG for grub-devel@gnu.org; Sun, 03 May 2009 08:53:01 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M0bBh-0006dW-Nq for grub-devel@gnu.org; Sun, 03 May 2009 08:53:01 -0400 Received: from [199.232.76.173] (port=53657 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M0bBh-0006dP-KS for grub-devel@gnu.org; Sun, 03 May 2009 08:52:57 -0400 Received: from ti-out-0910.google.com ([209.85.142.185]:50386) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1M0bBh-0006Fr-3X for grub-devel@gnu.org; Sun, 03 May 2009 08:52:57 -0400 Received: by ti-out-0910.google.com with SMTP id b6so354276tic.10 for ; Sun, 03 May 2009 05:52:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=zYTl4S7bUZzQQ5lakhJQqiIuZmQyRJPZ5E0mK26J9xA=; b=GzIKPiUROr6NfjpwDjR6F/KZqIzM4tloy59xkXQ5wC8goEaQ3Jo6DYxtmbI+NoVvhl xZJMoU/FGvhy/z4V5i5aN8TLI+hgjTf3aVJy9iVZaArcQsVheZgzI1VIKy/Ahuswzevb A0y9ZNmBQmV9fuiwui1RaZp4aWu4y4Ng0OlSk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=YFSjZm95Ps4b9EwGZE42bOmWm7QWRwgZ+2P2IwCnnphe8brBUJVsZWR9e56qdC+lPk Q9bdJo00/UuwHkqVDwQ1Zl1TnuoxyI2mW9FWc2HQ3rbGlq4Qjb3XbOr50Bny7xclpAUb v0/ELvvehlaN5iNbPSVii1DD8koky/qY6UREE= MIME-Version: 1.0 Received: by 10.110.62.4 with SMTP id k4mr350705tia.18.1241355175033; Sun, 03 May 2009 05:52:55 -0700 (PDT) In-Reply-To: References: Date: Sun, 3 May 2009 20:52:54 +0800 Message-ID: From: Bean To: The development of GRUB 2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: Re: [BUGFIX] lexer waits for space to terminate the varname 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, 03 May 2009 12:53:02 -0000 On Sun, May 3, 2009 at 8:39 PM, Vladimir 'phcoder' Serbinenko wrote: > > > On Sun, May 3, 2009 at 2:37 PM, Bean wrote: >> >> Hi, >> >> On Sun, May 3, 2009 at 5:12 PM, Vladimir 'phcoder' Serbinenko >> wrote: >> > Hello >> > >> > On Sat, May 2, 2009 at 4:08 PM, Bean wrote: >> >> >> >> Hi, >> >> >> >> I think there is problem with this patch. Consider ${aa}, the closing >> >> character "}" would be left out. >> >> >> >> Although you can remedy this by swapping: >> >> >> >> =A0{ GRUB_PARSER_STATE_VARNAME, GRUB_PARSER_STATE_TEXT, ' ', 1}, >> >> =A0{ GRUB_PARSER_STATE_VARNAME2, GRUB_PARSER_STATE_TEXT, '}', 0}, >> > >> > It's not the same starting state. However similar issue exists with ' = ' >> > and >> > '\"' >> >> Oh right, I copy the wrong sample. >> >> >> >> >> so that '}' would be handled before ' ', but it's still not a good >> >> practice, as you have added a logic in code that would depend on the >> >> order of state_transitions, which is not apparent for casual code >> >> viewer. >> > >> > Perhaps we should switch to just ordering the transition rules instead >> > of >> > separate code for default value >> >> >> >> Also, ' ' might be used for other transition in the future, >> >> this code could break that. I suggest you use {} to enclose the >> >> variable that doesn't terminated with space, >> > >> > It can be a workaround=A0 but the bug is still here. The following pie= ces >> > of >> > code fail: >> > 1) echo $hello; >> > 2) echo $hello >> > >> >> Yeah, and there are other varieties as well, such as -. Perhaps it'd >> be simpler to use your fix for now, but you should add some comment in >> the source code to indicate its purpose. > > What about making it rely on order of rules? It should make it more compa= ct Hi, I'm sorry I don't quite follow, could you give an example ? --=20 Bean