pub trait SymbolTable: Send + Sync {
fn kind_of(&self, name: &str) -> Option<SymbolKind>;
}
#[derive(Debug, Default, Clone, Copy)]
pub struct NoSymbols;
impl SymbolTable for NoSymbols {
fn kind_of(&self, _name: &str) -> Option<SymbolKind> {
None
}
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct IncludedMacro {
pub from_offset: usize,
pub name: std::sync::Arc<str>,
pub definition: Option<SymbolKind>,
pub body_text: Option<std::sync::Arc<str>>,
pub parameters: Option<std::sync::Arc<str>>,
}
impl IncludedMacro {
pub fn defined_at(
from_offset: usize,
name: &str,
function_like: bool,
body: MacroBody,
) -> Self {
Self {
from_offset,
name: std::sync::Arc::from(name),
definition: Some(SymbolKind::Macro {
function_like,
body,
}),
body_text: None,
parameters: None,
}
}
pub fn defined_with_body(
from_offset: usize,
name: &str,
function_like: bool,
body: MacroBody,
body_text: Option<&str>,
) -> Self {
Self {
from_offset,
name: std::sync::Arc::from(name),
definition: Some(SymbolKind::Macro {
function_like,
body,
}),
body_text: body_text.map(std::sync::Arc::from),
parameters: None,
}
}
pub fn defined_with_body_and_parameters(
from_offset: usize,
name: &str,
function_like: bool,
body: MacroBody,
body_text: Option<&str>,
parameters: Option<&str>,
) -> Self {
Self {
parameters: parameters.map(std::sync::Arc::from),
..Self::defined_with_body(from_offset, name, function_like, body, body_text)
}
}
pub fn defined_with_shared_body(
from_offset: usize,
name: &str,
function_like: bool,
body: MacroBody,
body_text: Option<std::sync::Arc<str>>,
parameters: Option<std::sync::Arc<str>>,
) -> Self {
Self {
from_offset,
name: std::sync::Arc::from(name),
definition: Some(SymbolKind::Macro {
function_like,
body,
}),
body_text,
parameters,
}
}
pub fn undefined_at(from_offset: usize, name: &str) -> Self {
Self {
from_offset,
name: std::sync::Arc::from(name),
definition: None,
body_text: None,
parameters: None,
}
}
}
type InForceEntry = (
Option<bool>,
Option<std::sync::Arc<str>>,
std::sync::Arc<str>,
);
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct InForceBody {
pub name: std::sync::Arc<str>,
pub function_like: Option<bool>,
pub parameters: Option<std::sync::Arc<str>>,
pub body: std::sync::Arc<str>,
}
impl InForceBody {
pub fn shared(
name: std::sync::Arc<str>,
function_like: Option<bool>,
parameters: Option<std::sync::Arc<str>>,
body: std::sync::Arc<str>,
) -> Self {
InForceBody {
name,
function_like,
parameters,
body,
}
}
}
impl From<(Box<str>, Box<str>)> for InForceBody {
fn from((name, body): (Box<str>, Box<str>)) -> Self {
InForceBody {
name: std::sync::Arc::from(name),
function_like: None,
parameters: None,
body: std::sync::Arc::from(body),
}
}
}
impl From<(Box<str>, bool, Option<Box<str>>, Box<str>)> for InForceBody {
fn from(
(name, function_like, parameters, body): (Box<str>, bool, Option<Box<str>>, Box<str>),
) -> Self {
InForceBody {
name: std::sync::Arc::from(name),
function_like: Some(function_like),
parameters: parameters.map(std::sync::Arc::from),
body: std::sync::Arc::from(body),
}
}
}
impl From<(Box<str>, Option<bool>, Box<str>)> for InForceBody {
fn from((name, function_like, body): (Box<str>, Option<bool>, Box<str>)) -> Self {
InForceBody {
name: std::sync::Arc::from(name),
function_like,
parameters: None,
body: std::sync::Arc::from(body),
}
}
}
impl From<(Box<str>, bool, Box<str>)> for InForceBody {
fn from((name, function_like, body): (Box<str>, bool, Box<str>)) -> Self {
InForceBody {
name: std::sync::Arc::from(name),
function_like: Some(function_like),
parameters: None,
body: std::sync::Arc::from(body),
}
}
}
pub trait MacroFacts {
fn kind_of(&self, name: &str, offset: usize) -> Option<SymbolKind>;
fn body_text_of(&self, name: &str, offset: usize) -> Option<&str>;
fn parameters_of(&self, name: &str, offset: usize) -> Option<&std::sync::Arc<str>>;
fn body_text_in_force(&self, name: &str) -> Option<&str>;
fn parameters_in_force(&self, name: &str) -> Option<&str>;
fn body_in_force_is_object_like(&self, name: &str) -> bool;
fn knows(&self, name: &str) -> bool;
fn is_empty(&self) -> bool;
fn len(&self) -> usize;
fn for_each_definition<'s>(&'s self, visit: &mut dyn FnMut(DefinitionFacts<'s>));
fn for_each_body_in_force<'s>(&'s self, visit: &mut dyn FnMut(BodyFacts<'s>));
fn is_a_macro_at(&self, name: &str, offset: usize) -> bool {
matches!(self.kind_of(name, offset), Some(SymbolKind::Macro { .. }))
}
fn body_text_at_or_in_force(&self, name: &str, at: usize) -> Option<&str> {
self.body_text_of(name, at)
.or_else(|| self.body_text_in_force(name))
}
fn body_text_resolved<'s>(&'s self, name: &'s str, at: usize) -> Option<&'s str> {
let mut current = name;
let mut seen: Vec<&str> = Vec::new();
loop {
if seen.contains(¤t) || seen.len() >= BODY_CHAIN_LIMIT {
return None;
}
let text = self.body_text_at_or_in_force(current, at)?;
match a_sole_name_in(text) {
Some(next) => {
seen.push(current);
current = next;
}
None => return Some(text),
}
}
}
}
pub struct DefinitionFacts<'a> {
pub name: &'a str,
pub at: usize,
pub function_like: bool,
pub parameters: Option<&'a std::sync::Arc<str>>,
pub body_text: Option<&'a std::sync::Arc<str>>,
}
pub struct BodyFacts<'a> {
pub name: &'a str,
pub function_like: Option<bool>,
pub parameters: Option<&'a std::sync::Arc<str>>,
pub body: &'a std::sync::Arc<str>,
}
#[derive(Debug, Default)]
pub struct MacroEnvironment {
by_name: std::collections::HashMap<std::sync::Arc<str>, Vec<Binding>>,
bodies_in_force: std::collections::HashMap<std::sync::Arc<str>, InForceEntry>,
}
#[derive(Debug, Clone, PartialEq, Eq)]
struct Binding {
at: usize,
definition: Option<SymbolKind>,
body: Option<std::sync::Arc<str>>,
parameters: Option<std::sync::Arc<str>>,
}
impl MacroEnvironment {
pub fn from_included_macros(entries: impl IntoIterator<Item = IncludedMacro>) -> Self {
let mut by_name: std::collections::HashMap<std::sync::Arc<str>, Vec<Binding>> =
std::collections::HashMap::new();
for entry in entries {
by_name.entry(entry.name).or_default().push(Binding {
at: entry.from_offset,
definition: entry.definition,
body: entry.body_text,
parameters: entry.parameters,
});
}
for history in by_name.values_mut() {
history.sort_by_key(|binding| binding.at);
}
Self {
by_name,
bodies_in_force: std::collections::HashMap::new(),
}
}
pub fn with_bodies_in_force<I: Into<InForceBody>>(
mut self,
bodies: impl IntoIterator<Item = I>,
) -> Self {
self.bodies_in_force.extend(
bodies
.into_iter()
.map(Into::into)
.map(|body| (body.name, (body.function_like, body.parameters, body.body))),
);
self
}
fn binding_in_force(&self, name: &str, offset: usize) -> Option<&Binding> {
let history = self.by_name.get(name)?;
history[..history.partition_point(|binding| binding.at <= offset)].last()
}
}
impl MacroFacts for MacroEnvironment {
fn is_empty(&self) -> bool {
self.by_name.is_empty() && self.bodies_in_force.is_empty()
}
fn len(&self) -> usize {
self.by_name.len()
}
fn kind_of(&self, name: &str, offset: usize) -> Option<SymbolKind> {
self.binding_in_force(name, offset)?.definition
}
fn body_text_in_force(&self, name: &str) -> Option<&str> {
self.bodies_in_force.get(name).map(|(_, _, body)| &**body)
}
fn parameters_in_force(&self, name: &str) -> Option<&str> {
self.bodies_in_force
.get(name)
.and_then(|(_, list, _)| list.as_deref())
}
fn body_in_force_is_object_like(&self, name: &str) -> bool {
matches!(self.bodies_in_force.get(name), Some((Some(false), _, _)))
}
fn for_each_definition<'s>(&'s self, visit: &mut dyn FnMut(DefinitionFacts<'s>)) {
for (name, history) in &self.by_name {
for binding in history {
let Some(SymbolKind::Macro { function_like, .. }) = binding.definition else {
continue;
};
visit(DefinitionFacts {
name,
at: binding.at,
function_like,
parameters: binding.parameters.as_ref(),
body_text: binding.body.as_ref(),
});
}
}
}
fn for_each_body_in_force<'s>(&'s self, visit: &mut dyn FnMut(BodyFacts<'s>)) {
for (name, (function_like, parameters, body)) in &self.bodies_in_force {
visit(BodyFacts {
name,
function_like: *function_like,
parameters: parameters.as_ref(),
body,
});
}
}
fn body_text_of(&self, name: &str, offset: usize) -> Option<&str> {
self.binding_in_force(name, offset)?.body.as_deref()
}
fn parameters_of(&self, name: &str, offset: usize) -> Option<&std::sync::Arc<str>> {
self.binding_in_force(name, offset)?.parameters.as_ref()
}
fn knows(&self, name: &str) -> bool {
self.by_name.contains_key(name)
}
}
pub const BODY_CHAIN_LIMIT: usize = 8;
fn a_sole_name_in(text: &str) -> Option<&str> {
use crate::{CppLexer, LexerConfig};
let mut errors = Vec::new();
let mut lexer = CppLexer::new(text, LexerConfig::default(), &mut errors);
let mut significant = lexer.tokenize().into_iter().filter(|token| {
!matches!(
token.kind,
crate::CppTokenKind::Whitespace
| crate::CppTokenKind::Newline
| crate::CppTokenKind::LineContinuation
| crate::CppTokenKind::LineComment
| crate::CppTokenKind::BlockComment
)
});
let first = significant.next()?;
if first.kind != crate::CppTokenKind::Identifier {
return None;
}
if significant.next().is_some() {
return None;
}
text.get(first.range.start_offset..first.range.end_offset())
}
fn heads_a_braced_block(kind: Option<crate::CppTokenKind>) -> bool {
use crate::CppTokenKind;
matches!(
kind,
Some(
CppTokenKind::NamespaceKeyword
| CppTokenKind::ClassKeyword
| CppTokenKind::StructKeyword
| CppTokenKind::UnionKeyword
| CppTokenKind::EnumKeyword
| CppTokenKind::ExternKeyword
| CppTokenKind::TryKeyword
| CppTokenKind::CatchKeyword
| CppTokenKind::DoKeyword
| CppTokenKind::SwitchKeyword
| CppTokenKind::IfKeyword
| CppTokenKind::ElseKeyword
| CppTokenKind::ForKeyword
| CppTokenKind::WhileKeyword
)
)
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum BodyShape {
OpensANamespace(Vec<String>),
ClosesABlock,
OpensABlock,
QualifiesAName,
Other,
}
impl BodyShape {
pub fn namespace_segments(&self) -> Option<&[String]> {
match self {
BodyShape::OpensANamespace(segments) => Some(segments),
_ => None,
}
}
pub fn opens_a_brace(&self) -> bool {
matches!(self, BodyShape::OpensANamespace(_) | BodyShape::OpensABlock)
}
pub fn closes_a_block(&self) -> bool {
matches!(self, BodyShape::ClosesABlock)
}
pub fn is_structural(&self) -> bool {
matches!(
self,
BodyShape::OpensANamespace(_) | BodyShape::ClosesABlock
)
}
pub fn opens_a_block(&self) -> bool {
matches!(self, BodyShape::OpensABlock)
}
pub fn qualifies_a_name(&self) -> bool {
matches!(self, BodyShape::QualifiesAName)
}
pub fn a_reading_uses_this(&self) -> bool {
!matches!(self, BodyShape::Other)
}
}
pub trait MacroBodies {
fn body_at(&self, name: &str, at: usize) -> Option<std::borrow::Cow<'_, str>>;
}
pub struct NothingAtAll;
impl MacroBodies for NothingAtAll {
fn body_at(&self, _name: &str, _at: usize) -> Option<std::borrow::Cow<'_, str>> {
None
}
}
impl<T: MacroFacts + ?Sized> MacroBodies for T {
fn body_at(&self, name: &str, at: usize) -> Option<std::borrow::Cow<'_, str>> {
self.body_text_at_or_in_force(name, at)
.map(std::borrow::Cow::Borrowed)
}
}
#[allow(dead_code)]
fn expands_to_nothing(bodies: &(impl MacroBodies + ?Sized), name: &str, at: usize) -> bool {
bodies
.body_at(name, at)
.is_some_and(|body| body.trim().is_empty())
}
const MAX_EXPANSIONS_IN_A_HEAD: usize = 4;
pub fn shape_of_a_body(text: &str) -> BodyShape {
shape_of_a_body_at(text, &NothingAtAll, 0)
}
pub fn a_body_opens_an_inline_namespace(text: &str) -> bool {
use crate::{CppLexer, CppTokenKind, LexerConfig};
let mut errors = Vec::new();
let mut lexer = CppLexer::new(text, LexerConfig::default(), &mut errors);
let mut significant = lexer
.tokenize()
.into_iter()
.map(|token| token.kind)
.filter(|kind| {
!matches!(
kind,
CppTokenKind::Whitespace
| CppTokenKind::Newline
| CppTokenKind::LineContinuation
| CppTokenKind::LineComment
| CppTokenKind::BlockComment
)
});
significant.next() == Some(CppTokenKind::InlineKeyword)
&& significant.next() == Some(CppTokenKind::NamespaceKeyword)
}
pub fn shape_of_a_body_at(
text: &str,
bodies: &(impl MacroBodies + ?Sized),
at: usize,
) -> BodyShape {
use crate::{CppLexer, CppTokenKind, LexerConfig};
type Spelled = (CppTokenKind, String);
fn significant(source: &str) -> Vec<Spelled> {
let mut errors = Vec::new();
let mut lexer = CppLexer::new(source, LexerConfig::default(), &mut errors);
lexer
.tokenize()
.into_iter()
.filter(|token| {
!matches!(
token.kind,
CppTokenKind::Whitespace
| CppTokenKind::Newline
| CppTokenKind::LineContinuation
| CppTokenKind::LineComment
| CppTokenKind::BlockComment
)
})
.map(|token| {
let spelling =
source[token.range.start_offset..token.range.end_offset()].to_string();
(token.kind, spelling)
})
.collect()
}
let mut stream: Vec<Spelled> = Vec::new();
let mut pending: std::collections::VecDeque<Spelled> = significant(text).into();
let mut left_to_expand = MAX_EXPANSIONS_IN_A_HEAD;
while let Some((kind, spelling)) = pending.pop_front() {
let at_the_head = !stream
.iter()
.any(|(kind, _)| *kind == CppTokenKind::LeftBrace);
if at_the_head && kind == CppTokenKind::Identifier && left_to_expand > 0 {
match bodies.body_at(&spelling, at) {
Some(body) if body.trim().is_empty() => continue,
Some(body) => {
left_to_expand -= 1;
for spliced in significant(&body).into_iter().rev() {
pending.push_front(spliced);
}
continue;
}
None => {}
}
}
stream.push((kind, spelling));
}
let kinds: Vec<CppTokenKind> = stream.iter().map(|(kind, _)| *kind).collect();
if kinds.as_slice() == [CppTokenKind::RightBrace] {
return BodyShape::ClosesABlock;
}
if kinds.last() == Some(&CppTokenKind::Scope) {
return BodyShape::QualifiesAName;
}
if kinds.last() != Some(&CppTokenKind::LeftBrace) {
return BodyShape::Other;
}
let mut head = if kinds.first() == Some(&CppTokenKind::InlineKeyword) {
1
} else {
0
};
if kinds.get(head) == Some(&CppTokenKind::ExternKeyword)
&& kinds.get(head + 1) == Some(&CppTokenKind::StringLiteral)
&& kinds.get(head + 2) == Some(&CppTokenKind::LeftBrace)
{
head += 3;
if kinds.get(head) == Some(&CppTokenKind::InlineKeyword) {
head += 1;
}
}
if kinds.get(head) != Some(&CppTokenKind::NamespaceKeyword) {
return if heads_a_braced_block(kinds.first().copied()) {
BodyShape::OpensABlock
} else {
BodyShape::Other
};
}
let mut segments = Vec::new();
for (kind, spelling) in &stream[head + 1..stream.len() - 1] {
match kind {
CppTokenKind::Identifier => segments.push(spelling.clone()),
CppTokenKind::Scope => {}
_ => return BodyShape::Other,
}
}
BodyShape::OpensANamespace(segments)
}
#[derive(Debug, Default, Clone)]
pub struct SymbolMap {
entries: std::collections::HashMap<Box<str>, SymbolKind>,
}
impl SymbolMap {
pub fn new() -> Self {
SymbolMap::default()
}
pub fn insert(&mut self, name: &str, kind: SymbolKind) {
self.entries.insert(name.into(), kind);
}
pub fn with(mut self, name: &str, kind: SymbolKind) -> Self {
self.insert(name, kind);
self
}
pub fn len(&self) -> usize {
self.entries.len()
}
pub fn is_empty(&self) -> bool {
self.entries.is_empty()
}
}
impl SymbolTable for SymbolMap {
fn kind_of(&self, name: &str) -> Option<SymbolKind> {
self.entries.get(name).copied()
}
}
impl<T: SymbolTable + ?Sized> SymbolTable for &T {
fn kind_of(&self, name: &str) -> Option<SymbolKind> {
(**self).kind_of(name)
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum SymbolKind {
Type,
Template,
Macro {
function_like: bool,
body: MacroBody,
},
Function,
Variable,
Namespace,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum MacroBody {
Specifier,
Statement,
Block,
Expression,
Type,
Unknown,
}
#[cfg(test)]
mod tests {
use super::{
BodyShape, IncludedMacro, MacroBody, MacroEnvironment, MacroFacts, NoSymbols, SymbolKind,
SymbolMap, SymbolTable, shape_of_a_body,
};
#[test]
fn only_two_body_shapes_are_structural() {
let segments = |text: &str| {
shape_of_a_body(text)
.namespace_segments()
.map(<[String]>::to_vec)
};
assert_eq!(segments("namespace std {"), Some(vec!["std".to_string()]));
assert_eq!(
segments("namespace {"),
Some(Vec::new()),
"unnamed, and still a scope"
);
assert_eq!(
segments("namespace a :: b {"),
Some(vec!["a".to_string(), "b".to_string()]),
"a nested name is one declaration that opens one scope per segment"
);
assert_eq!(
segments("namespace std /* the library */ {"),
Some(vec!["std".to_string()]),
"a comment is not part of the body"
);
assert_eq!(
segments("namespace\\\n std {"),
Some(vec!["std".to_string()]),
"and neither is a line continuation"
);
assert!(shape_of_a_body("}").closes_a_block());
assert!(
shape_of_a_body(" } ").closes_a_block(),
"trivia is dropped first"
);
assert_eq!(
segments("inline namespace _V2 {"),
Some(vec!["_V2".to_string()]),
"the keyword in front of `namespace` does not change what the body opens"
);
for other in [
"",
"std",
"__8",
"namespace std",
"namespace std = other;",
"};",
"{",
"((a) > (b) ? (a) : (b))",
] {
assert_eq!(
shape_of_a_body(other),
BodyShape::Other,
"{other:?} is not one of the shapes a construct is read from"
);
}
for opener in [
"try {",
"do {",
"switch (x) {",
"if (a) {",
"extern \"C\" {",
] {
assert_eq!(
shape_of_a_body(opener),
BodyShape::OpensABlock,
"{opener:?} opens a brace and names nothing"
);
assert!(shape_of_a_body(opener).opens_a_brace());
assert!(
!shape_of_a_body(opener).is_structural(),
"…and opens no scope"
);
assert!(shape_of_a_body(opener).namespace_segments().is_none());
}
assert_eq!(
shape_of_a_body("namespace {").namespace_segments(),
Some(&[][..])
);
assert!(shape_of_a_body("namespace {").is_structural());
assert!(shape_of_a_body("namespace {").opens_a_brace());
assert!(!shape_of_a_body("namespace std").is_structural());
assert!(
shape_of_a_body("namespace std")
.namespace_segments()
.is_none()
);
}
#[test]
fn a_body_that_is_another_macros_name_is_followed() {
let environment = MacroEnvironment::from_included_macros([]).with_bodies_in_force([
(
Box::from("_TRY_IO_BEGIN"),
Box::from("_TRY_BEGIN // begin try block"),
),
(Box::from("_TRY_BEGIN"), Box::from("try {")),
(Box::from("_A"), Box::from("_B")),
(Box::from("_B"), Box::from("_A")),
(Box::from("_CALL"), Box::from("_CATCH_ALL _CATCH_END")),
]);
assert_eq!(
environment.body_text_resolved("_TRY_IO_BEGIN", 0),
Some("try {")
);
assert_eq!(
environment.body_text_resolved("_TRY_BEGIN", 0),
Some("try {")
);
assert_eq!(
environment.body_text_resolved("_CALL", 0),
Some("_CATCH_ALL _CATCH_END")
);
assert_eq!(environment.body_text_resolved("_A", 0), None);
assert_eq!(environment.body_text_resolved("_UNKNOWN", 0), None);
}
#[test]
fn a_macro_from_an_include_is_in_force_only_from_its_own_offset() {
let environment = MacroEnvironment::from_included_macros([
IncludedMacro::defined_at(100, "BOOL_OPTION", true, MacroBody::Statement),
IncludedMacro::undefined_at(300, "BOOL_OPTION"),
]);
assert_eq!(environment.len(), 1, "one name, one history");
assert!(
!environment.is_a_macro_at("BOOL_OPTION", 99),
"not yet included"
);
assert!(
environment.is_a_macro_at("BOOL_OPTION", 100),
"the offset it becomes visible at is its own"
);
assert!(
environment.is_a_macro_at("BOOL_OPTION", 299),
"still in force"
);
assert!(
!environment.is_a_macro_at("BOOL_OPTION", 300),
"an `#undef` takes it away again"
);
assert!(
environment.knows("BOOL_OPTION"),
"…and 'not a macro here' is an answer, not an absence"
);
assert!(
!environment.knows("SOMETHING_ELSE"),
"a name it never heard of"
);
}
#[test]
fn the_environment_sorts_what_it_is_given() {
let environment = MacroEnvironment::from_included_macros([
IncludedMacro::undefined_at(300, "M"),
IncludedMacro::defined_at(100, "M", false, MacroBody::Specifier),
]);
assert!(environment.is_a_macro_at("M", 150));
assert!(!environment.is_a_macro_at("M", 350));
}
#[test]
fn a_map_answers_what_was_inserted_and_nothing_else() {
let mut symbols = SymbolMap::new();
symbols.insert(
"MY_API",
SymbolKind::Macro {
function_like: false,
body: MacroBody::Specifier,
},
);
symbols.insert("Widget", SymbolKind::Type);
assert_eq!(symbols.kind_of("Widget"), Some(SymbolKind::Type));
assert!(matches!(
symbols.kind_of("MY_API"),
Some(SymbolKind::Macro {
function_like: false,
body: MacroBody::Specifier
})
));
assert_eq!(
symbols.kind_of("g"),
None,
"a name the table has never heard of is unknown, not a `no`"
);
assert_eq!(symbols.len(), 2);
assert!(SymbolMap::new().is_empty());
}
#[test]
fn the_interface_is_object_safe_and_shared() {
let table: &dyn SymbolTable = &NoSymbols;
assert_eq!(table.kind_of("anything"), None);
let map = SymbolMap::new().with("Widget", SymbolKind::Type);
let borrowed: &dyn SymbolTable = ↦
assert_eq!(borrowed.kind_of("Widget"), Some(SymbolKind::Type));
fn assert_send_sync<T: Send + Sync>() {}
assert_send_sync::<SymbolMap>();
assert_send_sync::<NoSymbols>();
assert_send_sync::<SymbolKind>();
}
}