This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA/Ada] Allow 'thread' to be used as a variable name in expressions.
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Paul Hilfinger <Hilfinger at adacore dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Sun, 10 Mar 2013 08:33:48 -0700
- Subject: Re: [RFA/Ada] Allow 'thread' to be used as a variable name in expressions.
- References: <20130310075951.B94553FF09@kwai.gnat.com>
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