]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gccrs: Add a list of weak keyword
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Thu, 16 Nov 2023 14:02:11 +0000 (15:02 +0100)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 30 Jan 2024 11:36:45 +0000 (12:36 +0100)
Retrieving a weak keyword value is done using raw values. Introducing a
list of weak keywords means this could change.

gcc/rust/ChangeLog:

* util/rust-keyword-values.h (class WeakKeywords): Add new class with
weak keyword constexpr.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
gcc/rust/util/rust-keyword-values.h

index 769b2100c41f7e4bb914bb6b2efed79999c8b18e..4a6f1df525d0cc9e04e08452f28dfd7fb9bbfbb6 100644 (file)
@@ -41,6 +41,20 @@ public:
 #undef RS_TOKEN
 };
 
+class WeakKeywords
+{
+public:
+  static constexpr auto &AUTO = "auto";
+  static constexpr auto &BUILTIN = "builtin";
+  static constexpr auto &CATCH = "catch";
+  static constexpr auto &DEFAULT = "default";
+  static constexpr auto &GEN = "gen";
+  static constexpr auto &MACRO_RULES = "macro_rules";
+  static constexpr auto &RAW = "raw";
+  static constexpr auto &UNION = "union";
+  static constexpr auto &YEET = "yeet";
+};
+
 } // namespace Values
 } // namespace Rust