Add kclVersion as a field of the setting attribute (#6689)

Signed-off-by: Nick Cameron <nrc@ncameron.org>
This commit is contained in:
Nick Cameron
2025-05-06 08:44:03 +12:00
committed by GitHub
parent 7ab879a94f
commit cf2e9d4b91
186 changed files with 7478 additions and 6399 deletions

View File

@ -336,6 +336,7 @@ impl ModuleState {
settings: MetaSettings {
default_length_units: Default::default(),
default_angle_units: Default::default(),
kcl_version: "0.1".to_owned(),
},
}
}
@ -347,6 +348,7 @@ impl ModuleState {
pub struct MetaSettings {
pub default_length_units: types::UnitLen,
pub default_angle_units: types::UnitAngle,
pub kcl_version: String,
}
impl MetaSettings {
@ -370,6 +372,10 @@ impl MetaSettings {
let value = types::UnitAngle::from_str(value, annotation.as_source_range())?;
self.default_angle_units = value;
}
annotations::SETTINGS_VERSION => {
let value = annotations::expect_number(&p.inner.value)?;
self.kcl_version = value;
}
name => {
return Err(KclError::Semantic(KclErrorDetails {
message: format!(