1use flux_macros::symbols;
2use rustc_span::{Symbol, edition::Edition};
3
4symbols! {
5 Keywords {
6 Bitvec: "bitvec",
7 Exists: "exists",
8 Forall: "forall",
9 Hrn: "hrn",
10 Hdl: "hdl",
11 Requires: "requires",
12 Ensures: "ensures",
13 Property: "property",
14 Qualifier: "qualifier",
15 Sort: "sort",
16 Strg: "strg",
17 }
18
19 Symbols {
20 Map,
21 Set,
22 hide,
23 int,
24 real,
25 }
26}
27
28pub mod kw {
30 #![allow(non_upper_case_globals)]
31
32 use rustc_span::Symbol;
33 pub use rustc_span::symbol::kw::*;
34
35 pub use super::kw_generated::*;
36
37 pub const Opaque: Symbol = rustc_span::symbol::sym::opaque;
40 pub const Local: Symbol = rustc_span::symbol::sym::local;
41}
42
43pub mod sym {
44 pub use rustc_span::sym::*;
45
46 pub use super::sym_generated::*;
47}
48
49pub fn is_reserved(sym: Symbol, edition: Edition) -> bool {
50 if sym == kw::SelfLower || sym == kw::SelfUpper || sym == kw::Crate {
52 return false;
53 }
54 sym.is_reserved(|| edition) || is_flux_reserved(sym)
55}
56
57fn is_flux_reserved(sym: Symbol) -> bool {
59 (kw::Bitvec <= sym && sym <= kw::Strg) || sym == kw::Opaque || sym == kw::Local
60}