From: Tom Tromey <tom@tromey.com>
To: "Leszek Swirski via gdb-patches" <gdb-patches@sourceware.org>
Cc: Leszek Swirski <leszeks@google.com>
Subject: Re: [PATCH v2] Do not classify C struct members as a filename
Date: Thu, 25 Jan 2018 16:00:00 -0000 [thread overview]
Message-ID: <87zi52gc8u.fsf@tromey.com> (raw)
In-Reply-To: <20180124165107.186980-1-leszeks@google.com> (Leszek Swirski via gdb-patches's message of "Wed, 24 Jan 2018 16:51:07 +0000")
>>>>> "Leszek" == Leszek Swirski via gdb-patches <gdb-patches@sourceware.org> writes:
Leszek> There is existing logic in C/C++ expression parsing to avoid classifying
Leszek> names as a filename when they are a field on the this object. This
Leszek> change extends this logic to also avoid classifying names after a
Leszek> struct-op (-> or .) as a filename, which otherwise causes a syntax
Leszek> error.
Nice, thanks for doing this.
Leszek> - if (parse_completion && tokentab2[i].token == ARROW)
Leszek> + if (tokentab2[i].token == ARROW)
Leszek> - if (parse_completion)
Leszek> - last_was_structop = 1;
Leszek> + last_was_structop = 1;
This change makes sense (and thanks for updating that comment as well),
but I wonder whether this changes the behavior in some case. Elsewhere
in lex_one_token there is a check of saw_structop:
else if (saw_structop)
return COMPLETE;
Previously this return could only be taken if parse_completion was set,
but now I think it could be taken in other situations.
So, I suspect "parse_completion &&" should be stuck in there.
Tom
next prev parent reply other threads:[~2018-01-25 16:00 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-24 16:51 Leszek Swirski via gdb-patches
2018-01-25 2:39 ` Simon Marchi
2018-01-25 10:04 ` Leszek Swirski via gdb-patches
2018-01-25 14:52 ` Simon Marchi
2018-01-25 15:09 ` [PATCH v3] " Leszek Swirski via gdb-patches
2018-01-25 16:00 ` Tom Tromey [this message]
2018-01-25 16:20 ` [PATCH v4] " Leszek Swirski via gdb-patches
2018-02-02 3:35 ` Simon Marchi
2018-01-25 16:39 ` [PATCH v2] " Leszek Swirski via gdb-patches
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87zi52gc8u.fsf@tromey.com \
--to=tom@tromey.com \
--cc=gdb-patches@sourceware.org \
--cc=leszeks@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox