summaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2022-05-31 09:13:31 +0200
committerLaurenz <laurmaedje@gmail.com>2022-05-31 10:13:34 +0200
commit97858e5992a52459dd8a34be7a6b4786952b491a (patch)
treeee4cde4e9cf051a1ecd7d27f13ec26df3ff8df9d /src/lib.rs
parentccb4753e24eefb5b8cf2acd6d25f0e2afce1c022 (diff)
Basic manual tracking
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 34e87c5e..bcbf8478 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -34,6 +34,8 @@
#[macro_use]
pub mod util;
#[macro_use]
+pub mod memo;
+#[macro_use]
pub mod geom;
#[macro_use]
pub mod diag;
@@ -45,13 +47,13 @@ pub mod frame;
pub mod image;
pub mod library;
pub mod loading;
-pub mod memo;
pub mod model;
pub mod parse;
pub mod source;
pub mod syntax;
use std::collections::HashMap;
+use std::hash::Hasher;
use std::path::PathBuf;
use std::sync::Arc;
@@ -61,7 +63,8 @@ use crate::font::FontStore;
use crate::frame::Frame;
use crate::image::ImageStore;
use crate::loading::Loader;
-use crate::model::{PinBoard, StyleMap};
+use crate::memo::Track;
+use crate::model::{PinBoard, PinConstraint, StyleMap};
use crate::source::{SourceId, SourceStore};
/// Typeset a source file into a collection of layouted frames.
@@ -104,6 +107,18 @@ impl Context {
}
}
+impl Track for &mut Context {
+ type Constraint = PinConstraint;
+
+ fn key<H: Hasher>(&self, hasher: &mut H) {
+ self.pins.key(hasher);
+ }
+
+ fn matches(&self, constraint: &Self::Constraint) -> bool {
+ self.pins.matches(constraint)
+ }
+}
+
/// Compilation configuration.
pub struct Config {
/// The compilation root.