From 000dca3b6b6019f11a03941ee1cf5ed5aa3ddd8f Mon Sep 17 00:00:00 2001 From: Griffin Berlstein Date: Mon, 13 Jan 2025 17:11:34 -0500 Subject: [PATCH] add a warning if the old-style of `pos` is written --- calyx-frontend/src/attribute.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/calyx-frontend/src/attribute.rs b/calyx-frontend/src/attribute.rs index f79542b93..414b0ec59 100644 --- a/calyx-frontend/src/attribute.rs +++ b/calyx-frontend/src/attribute.rs @@ -279,6 +279,11 @@ impl FromStr for Attribute { if DEPRECATED_ATTRIBUTES.contains(&s) { log::warn!("The attribute @{s} is deprecated and will be ignored by the compiler."); } + + if let Ok(SetAttribute::Set(_)) = SetAttribute::from_str(s) { + log::warn!("Set attribute {s} incorrectly written as a standard attribute, i.e. '@{s}(..)' or '\"{s}\" = ..'. This will be ignored by the compiler. Instead write '@{s}{{..}}' or '\"{s}\" = {{..}}'."); + } + // Reject attributes that all caps since those are reserved for internal attributes if s.to_uppercase() == s { return Err(Error::misc(format!("Invalid attribute: {}. All caps attributes are reserved for internal use.", s)));