[RFA/Ada] Allow 'thread' to be used as a variable name in expressions.
Joel Brobecker
brobecker@adacore.com
Sun Mar 10 15:33:00 GMT 2013
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
More information about the Gdb-patches
mailing list