Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-31 10:12:00

0001 // Protocol Buffers - Google's data interchange format
0002 // Copyright 2024 Google LLC.  All rights reserved.
0003 //
0004 // Use of this source code is governed by a BSD-style
0005 // license that can be found in the LICENSE file or at
0006 // https://developers.google.com/open-source/licenses/bsd
0007 
0008 #ifndef GOOGLE_PROTOBUF_COMPILER_RUST_RUST_KEYWORDS_H__
0009 #define GOOGLE_PROTOBUF_COMPILER_RUST_RUST_KEYWORDS_H__
0010 
0011 #include "absl/strings/string_view.h"
0012 
0013 namespace google {
0014 namespace protobuf {
0015 namespace compiler {
0016 namespace rust {
0017 
0018 // Returns true if the provided name is legal to use as a raw identifier name
0019 // by prefixing with r#
0020 // https://doc.rust-lang.org/reference/identifiers.html#raw-identifiers
0021 bool IsLegalRawIdentifierName(absl::string_view str_without_r_prefix);
0022 
0023 // Returns true if the provided str is a Rust 2021 Edition keyword and cannot be
0024 // used as an identifier. These symbols can be used with an r# prefix unless
0025 // IsLegalRawIdentifierName returns false. This function should always match the
0026 // behavior for the corresponding Edition that our emitted crates use.
0027 bool IsRustKeyword(absl::string_view str);
0028 
0029 }  // namespace rust
0030 }  // namespace compiler
0031 }  // namespace protobuf
0032 }  // namespace google
0033 
0034 #endif  // GOOGLE_PROTOBUF_COMPILER_RUST_RUST_KEYWORDS_H__