summaryrefslogtreecommitdiff
path: root/library/src/lib.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2023-02-02 18:09:13 +0100
committerLaurenz <laurmaedje@gmail.com>2023-02-02 19:50:06 +0100
commit10675cd6d510521715c5e33508d80c4193ad9d74 (patch)
tree676435532b2c224b4b9feafd6e1a07cd30a0e923 /library/src/lib.rs
parente9ff2d6463bf26cb0bbafb747bf8a77800687e3f (diff)
Merge text and math symbols
Diffstat (limited to 'library/src/lib.rs')
-rw-r--r--library/src/lib.rs14
1 files changed, 8 insertions, 6 deletions
diff --git a/library/src/lib.rs b/library/src/lib.rs
index a2f52549..a195c717 100644
--- a/library/src/lib.rs
+++ b/library/src/lib.rs
@@ -7,6 +7,7 @@ pub mod math;
pub mod meta;
pub mod prelude;
pub mod shared;
+pub mod symbols;
pub mod text;
pub mod visualize;
@@ -17,15 +18,14 @@ use self::layout::LayoutRoot;
/// Construct the standard library.
pub fn build() -> Library {
- let sym = text::sym();
- let math = math::module(&sym);
+ let math = math::module();
let calc = compute::calc();
- let global = global(sym, math.clone(), calc);
+ let global = global(math.clone(), calc);
Library { global, math, styles: styles(), items: items() }
}
/// Construct the module with global definitions.
-fn global(sym: Module, math: Module, calc: Module) -> Module {
+fn global(math: Module, calc: Module) -> Module {
let mut global = Scope::deduplicating();
// Basics.
@@ -50,8 +50,6 @@ fn global(sym: Module, math: Module, calc: Module) -> Module {
global.def_func::<text::StrikeNode>("strike");
global.def_func::<text::OverlineNode>("overline");
global.def_func::<text::RawNode>("raw");
- global.define("sym", sym);
- global.define("emoji", text::emoji());
// Math.
global.define("math", math);
@@ -92,6 +90,10 @@ fn global(sym: Module, math: Module, calc: Module) -> Module {
global.def_func::<meta::LinkNode>("link");
global.def_func::<meta::OutlineNode>("outline");
+ // Symbols.
+ global.define("sym", symbols::sym());
+ global.define("emoji", symbols::emoji());
+
// Compute.
global.def_func::<compute::TypeFunc>("type");
global.def_func::<compute::ReprFunc>("repr");