More propagation of numeric types (#6177)
Signed-off-by: Nick Cameron <nrc@ncameron.org>
This commit is contained in:
@ -22,6 +22,8 @@ use crate::{
|
||||
CompilationError,
|
||||
};
|
||||
|
||||
use super::types::NumericType;
|
||||
|
||||
/// State for executing a program.
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct ExecState {
|
||||
@ -228,6 +230,13 @@ impl ExecState {
|
||||
self.global.module_infos.insert(id, module_info);
|
||||
}
|
||||
|
||||
pub fn current_default_units(&self) -> NumericType {
|
||||
NumericType::Default {
|
||||
len: self.length_unit(),
|
||||
angle: self.angle_unit(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn length_unit(&self) -> UnitLen {
|
||||
self.mod_local.settings.default_length_units
|
||||
}
|
||||
|
Reference in New Issue
Block a user