Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1M0btn-0002RE-Do for mharc-grub-devel@gnu.org; Sun, 03 May 2009 09:38:31 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M0btl-0002QR-7O for grub-devel@gnu.org; Sun, 03 May 2009 09:38:29 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M0btg-0002OJ-3X for grub-devel@gnu.org; Sun, 03 May 2009 09:38:28 -0400 Received: from [199.232.76.173] (port=44734 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M0btf-0002OE-U5 for grub-devel@gnu.org; Sun, 03 May 2009 09:38:23 -0400 Received: from ti-out-0910.google.com ([209.85.142.188]:50173) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1M0btf-000620-48 for grub-devel@gnu.org; Sun, 03 May 2009 09:38:23 -0400 Received: by ti-out-0910.google.com with SMTP id b6so355566tic.10 for ; Sun, 03 May 2009 06:38:20 -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=cwgYfsnQl5v2jp4aVQEMRxv4VLn5tKB6CSti3ss6MGA=; b=tJBEQdItoAUAnWIN+ayfKbaSmIsTNf7PLvfmg61Rcvr6uWItxchAbac9xUL7QHem1D jCq51/DFZQSio5nTdghLxsnkR18MS4r9/VBUetLiZwz8DKaqtEefG0JlZqquXrqiYgVF y/MVN1zMJXm+T981OI/qJ80zncMBOqqr7QxMQ= 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=a1uTNbkawnkko29ibvxj8/0yeOhkLXr5ccbwoGPwGTfhCHKvfQjEATiY7p06k9z1wS ayFSZzohPN1Vs4h4QLnuj5YiLC0R+gRuPTlbRnFJOBWSbvGF9Eb/pDtWitBCo5QxQudU yChnMPp+pA00Y+zSTQ7LBmdFpQY1QtnJmT1G4= MIME-Version: 1.0 Received: by 10.110.14.3 with SMTP id 3mr345371tin.45.1241357900655; Sun, 03 May 2009 06:38:20 -0700 (PDT) In-Reply-To: References: Date: Sun, 3 May 2009 21:38:20 +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 13:38:29 -0000 Hi, Oh right, it looks more compact. Although you should test the corner cases to make sure no problem is introduced by the new code. On Sun, May 3, 2009 at 9:28 PM, Vladimir 'phcoder' Serbinenko wrote: > > On Sun, May 3, 2009 at 2:52 PM, Bean wrote: >> >> 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 t= he >> >> >> 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 >> >> > pieces >> >> > 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 i= n >> >> the source code to indicate its purpose. >> > >> > What about making it rely on order of rules? It should make it more >> > compact >> >> Hi, >> >> I'm sorry I don't quite follow, could you give an example ? > > Something like this. Compile tested only > >> >> -- >> Bean >> >> >> _______________________________________________ >> Grub-devel mailing list >> Grub-devel@gnu.org >> http://lists.gnu.org/mailman/listinfo/grub-devel > > > > -- > Regards > Vladimir 'phcoder' Serbinenko > > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > http://lists.gnu.org/mailman/listinfo/grub-devel > > --=20 Bean