mirror of
https://github.com/lune-org/lune.git
synced 2024-12-12 13:00:37 +00:00
Improve output formatting
This commit is contained in:
parent
89d0606d06
commit
25b1dcb472
2 changed files with 15 additions and 0 deletions
|
@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
|
||||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
## Unreleased
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- Improved output formatting of non-primitive types
|
||||||
|
- Improved output formatting of empty tables
|
||||||
|
|
||||||
## `0.0.4` - January 21st, 2023
|
## `0.0.4` - January 21st, 2023
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|
|
@ -154,6 +154,14 @@ pub fn pretty_format_value(buffer: &mut String, value: &Value, depth: usize) ->
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Value::Vector(x, y, z) => {
|
||||||
|
write!(buffer, "{COLOR_PURPLE}<vector({x}, {y}, {z})>{COLOR_RESET}",)?
|
||||||
|
}
|
||||||
|
Value::Thread(_) => write!(buffer, "{COLOR_PURPLE}<thread>{COLOR_RESET}")?,
|
||||||
|
Value::Function(_) => write!(buffer, "{COLOR_PURPLE}<function>{COLOR_RESET}")?,
|
||||||
|
Value::UserData(_) | Value::LightUserData(_) => {
|
||||||
|
write!(buffer, "{COLOR_PURPLE}<userdata>{COLOR_RESET}")?
|
||||||
|
}
|
||||||
_ => write!(buffer, "?")?,
|
_ => write!(buffer, "?")?,
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
Loading…
Reference in a new issue