public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Thomas Schwinge <tschwinge@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc/devel/rust/master] Merge #998 Date: Wed, 8 Jun 2022 12:17:49 +0000 (GMT) [thread overview] Message-ID: <20220608121749.34182380F3F7@sourceware.org> (raw) https://gcc.gnu.org/g:51c7cf4b974140d4ace6c3cb79de9a00bb2efcbb commit 51c7cf4b974140d4ace6c3cb79de9a00bb2efcbb Merge: 77a49507446 f02392c8b37 Author: bors[bot] <26634292+bors[bot]@users.noreply.github.com> Date: Fri Mar 11 08:24:43 2022 +0000 Merge #998 998: Parse macro expansion properly r=CohenArthur a=CohenArthur This PR adds a base for trying to parse statements or items in macro invocations. We are now able to parse multiple items / expressions / statements properly, but do not lower them properly, which is the last remaining task in #943 New macro parsing logic: ```mermaid flowchart TD; has_semi -- Yes --> stmt; has_semi -- No --> invocation; invocation -- Is Parens --> expr; invocation -- Is Square --> expr; invocation -- Is Curly --> stmt; ``` Closes #943 Closes #959 Closes #952 Co-authored-by: Arthur Cohen <arthur.cohen@embecosm.com> Diff: gcc/rust/ast/rust-ast.h | 119 ++++++++-- gcc/rust/ast/rust-macro.h | 8 - gcc/rust/expand/rust-macro-expand.cc | 308 ++++++++++++++++++------- gcc/rust/expand/rust-macro-expand.h | 18 +- gcc/rust/hir/rust-ast-lower-expr.h | 10 +- gcc/rust/hir/rust-ast-lower-implitem.h | 26 +-- gcc/rust/hir/rust-ast-lower-item.h | 13 +- gcc/rust/hir/rust-ast-lower-stmt.h | 13 +- gcc/rust/resolve/rust-ast-resolve-expr.cc | 8 - gcc/rust/resolve/rust-ast-resolve-expr.h | 2 - gcc/rust/resolve/rust-ast-resolve-implitem.h | 30 --- gcc/rust/resolve/rust-ast-resolve-item.h | 20 -- gcc/rust/resolve/rust-ast-resolve-stmt.h | 11 - gcc/rust/resolve/rust-ast-resolve-toplevel.h | 7 - gcc/testsuite/rust/compile/macro11.rs | 11 + gcc/testsuite/rust/compile/macro12.rs | 8 + gcc/testsuite/rust/compile/macro13.rs | 12 + gcc/testsuite/rust/compile/macro14.rs | 10 + gcc/testsuite/rust/compile/macro15.rs | 12 + gcc/testsuite/rust/compile/macro6.rs | 2 +- gcc/testsuite/rust/compile/macro7.rs | 4 +- gcc/testsuite/rust/compile/macro8.rs | 4 +- gcc/testsuite/rust/execute/torture/macros11.rs | 7 +- gcc/testsuite/rust/execute/torture/macros17.rs | 4 +- gcc/testsuite/rust/execute/torture/macros2.rs | 6 +- gcc/testsuite/rust/execute/torture/macros22.rs | 23 ++ gcc/testsuite/rust/execute/torture/macros3.rs | 10 +- gcc/testsuite/rust/execute/torture/macros7.rs | 8 +- gcc/testsuite/rust/execute/torture/macros8.rs | 8 +- gcc/testsuite/rust/execute/torture/macros9.rs | 8 +- 30 files changed, 475 insertions(+), 255 deletions(-)
reply other threads:[~2022-06-08 12:17 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20220608121749.34182380F3F7@sourceware.org \ --to=tschwinge@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ /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: linkBe 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; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).