diff options
| author | Laurenz <laurmaedje@gmail.com> | 2022-11-26 16:59:20 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2022-11-26 17:13:31 +0100 |
| commit | 0579fd4409375aaa9fd8e87a06fd59097b5fcd97 (patch) | |
| tree | 0ccf1d6218806b11d83998d568ae1fb0570c67b7 /library/src/base/mod.rs | |
| parent | 9db6e533cd8a1d925a7daad92e1b99e6f98ac773 (diff) | |
Reorganize library base
Diffstat (limited to 'library/src/base/mod.rs')
| -rw-r--r-- | library/src/base/mod.rs | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/library/src/base/mod.rs b/library/src/base/mod.rs index 86ebd666..501edd71 100644 --- a/library/src/base/mod.rs +++ b/library/src/base/mod.rs @@ -1,14 +1,14 @@ //! Foundational functions. mod calc; -mod color; +mod create; mod data; -mod string; +mod numbering; pub use self::calc::*; -pub use self::color::*; +pub use self::create::*; pub use self::data::*; -pub use self::string::*; +pub use self::numbering::*; use comemo::Track; use typst::model::{self, Route, Vm}; @@ -21,6 +21,11 @@ pub fn type_(_: &Vm, args: &mut Args) -> SourceResult<Value> { Ok(args.expect::<Value>("value")?.type_name().into()) } +/// The string representation of a value. +pub fn repr(_: &Vm, args: &mut Args) -> SourceResult<Value> { + Ok(args.expect::<Value>("value")?.repr().into()) +} + /// Ensure that a condition is fulfilled. pub fn assert(_: &Vm, args: &mut Args) -> SourceResult<Value> { let Spanned { v, span } = args.expect::<Spanned<bool>>("condition")?; |
