From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31614 invoked by alias); 10 Mar 2013 15:33:57 -0000 Received: (qmail 31606 invoked by uid 22791); 10 Mar 2013 15:33:57 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_HOSTKARMA_NO,TW_YY X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 10 Mar 2013 15:33:51 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 0B11A1C7F0D; Sun, 10 Mar 2013 11:33:51 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id rBpKHPbRVsOK; Sun, 10 Mar 2013 11:33:50 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 871A11C7E92; Sun, 10 Mar 2013 11:33:50 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 4D92CC15B9; Sun, 10 Mar 2013 11:33:48 -0400 (EDT) Date: Sun, 10 Mar 2013 15:33:00 -0000 From: Joel Brobecker To: Paul Hilfinger Cc: gdb-patches@sourceware.org Subject: Re: [RFA/Ada] Allow 'thread' to be used as a variable name in expressions. Message-ID: <20130310153348.GC3264@adacore.com> References: <20130310075951.B94553FF09@kwai.gnat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130310075951.B94553FF09@kwai.gnat.com> User-Agent: Mutt/1.5.21 (2010-09-15) Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2013-03/txt/msg00424.txt.bz2 Hi Paul, > gdb/ChangeLog: > > * ada-lex.l (rules): Only recognize 'thread' as a > delimiter when followed by numerals, as for c-exp.y. > Use new rewind_to_char function to rewind the input for > expression-delimiting tokens. > (rewind_to_char): New function. Just a few nits... The text in the ChangeLog entry should be left-aligned on the tab, so: * ada-lex.l (rules): Only recognize 'thread' as a delimiter when followed by numerals, as for c-exp.y. Use new rewind_to_char function to rewind the input for expression-delimiting tokens. (rewind_to_char): New function. There are a few formatting issues that I will highlight below, but also, could you add a couple of regression tests? > +static void rewind_to_char(int); Space before '('. > +/* Back up lexptr by yyleng and then to the rightmost occurrence of character > + CH, case-folded (there must be one). WARNING: since lexptr points to the > + next input character that Flex has not yet transferred to its > + internal buffer, the use of this function depends on the assumption > + that Flex calls YY_INPUT only when it is logically necessary to do so > + (thus, there is no reading ahead farther than needed to identify > + the next token.) */ Would you mind reformatting this comment to 70 characters only? Exceeding that limit up to 80 is acceptable if it helps readability. > +static void > +rewind_to_char(int ch) Missing space before '('. > +{ > + lexptr -= yyleng; > + while (toupper(*lexptr) != toupper(ch)) Likewise... Thank you, -- Joel