Add kclVersion as a field of the setting attribute (#6689)
Signed-off-by: Nick Cameron <nrc@ncameron.org>
This commit is contained in:
@ -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!(
|
||||
|
Reference in New Issue
Block a user