[PING] [PATCH] D: Fix classification of module.type in lexer

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[PING] [PATCH] D: Fix classification of module.type in lexer

Iain Buclaw
Small ping on this.  I'm confident about the source change is pretty
much obvious, just want to make sure that the test is ok too.

---
The two-tier lexer, whose job is to resolve fully qualified names
missed a case where 'module.type' was not being classified as one
token.  And so when the Yacc grammar kicks in, it resolved the tokens
as "TypeExp . IdentifierExp", which then will never match the rule for
cast expressions "( TypeExp ) UnaryExpression".

Adding a case for TYPE_CODE_MODULE in type_aggregate_p means that
classify_inner_name will get a chance to look-up the symbol.

This was noticed when someone tried 'watch -l', and got the rather
confusing response:

A syntax error in expression, near `) 0x000000010'.

So it's been included in the testsuite, along with another test that
does effectively the same expression explicitly.

dlang-watch-location.patch (5K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [PING] [PATCH] D: Fix classification of module.type in lexer

Yao Qi
Iain Buclaw <[hidden email]> writes:

> + subprogram {
> +    {name "D main"}
> +    {linkage_name "_Dmain"}
> +    {external 1 flag_present}
> +    {low_pc dmain_start addr}
> +    {high_pc dmain_end addr}

Can you use MACRO_AT_func so that you don't need "dmain_start" and
"dmain_end" in gdb.dlang/watch-loc.c.

--
Yao (齐尧)
Reply | Threaded
Open this post in threaded view
|

Re: [PING] [PATCH] D: Fix classification of module.type in lexer

Iain Buclaw
On 16 March 2017 at 15:21, Yao Qi <[hidden email]> wrote:

> Iain Buclaw <[hidden email]> writes:
>
>> +             subprogram {
>> +                 {name "D main"}
>> +                 {linkage_name "_Dmain"}
>> +                 {external 1 flag_present}
>> +                 {low_pc dmain_start addr}
>> +                 {high_pc dmain_end addr}
>
> Can you use MACRO_AT_func so that you don't need "dmain_start" and
> "dmain_end" in gdb.dlang/watch-loc.c.
>
Yes, I can, thanks.


Iain.

dlang-watch-location-1.patch (5K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [PING] [PATCH] D: Fix classification of module.type in lexer

Yao Qi
Iain Buclaw <[hidden email]> writes:

> Yes, I can, thanks.

Patch is good to me.

--
Yao (齐尧)