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 Trusted: "trusted",
18 Reft: "reft",
19 Invariant: "invariant",
20 RefinedBy: "refined_by",
21 }
22
23 Symbols {
24 Map,
25 Set,
26 hide,
27 int,
28 real,
29 }
30}
31
32pub mod kw {
34 #![allow(non_upper_case_globals)]
35
36 use rustc_span::Symbol;
37 pub use rustc_span::symbol::kw::*;
38
39 pub use super::kw_generated::*;
40
41 pub const Opaque: Symbol = rustc_span::symbol::sym::opaque;
44 pub const Local: Symbol = rustc_span::symbol::sym::local;
45}
46
47pub mod sym {
48 pub use rustc_span::sym::*;
49
50 pub use super::sym_generated::*;
51}
52
53pub fn is_reserved(sym: Symbol, edition: Edition) -> bool {
54 if sym == kw::SelfLower || sym == kw::SelfUpper || sym == kw::Crate {
56 return false;
57 }
58 sym.is_reserved(|| edition) || is_flux_reserved(sym)
59}
60
61fn is_flux_reserved(sym: Symbol) -> bool {
63 (kw::Bitvec <= sym && sym <= kw::Strg) || sym == kw::Opaque || sym == kw::Local
64}