summaryrefslogtreecommitdiff
path: root/src/pagespec.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/pagespec.rs')
-rw-r--r--src/pagespec.rs13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/pagespec.rs b/src/pagespec.rs
index e3f617d..8d12440 100644
--- a/src/pagespec.rs
+++ b/src/pagespec.rs
@@ -64,8 +64,9 @@ pub enum PageSpecError {
#[derive(Debug)]
pub enum Expr {
Glob(String),
- LinksHereFunc,
+ LinksHereFunc(String),
PageFunc(String),
+ TaggedFunc(String),
Negate(Box<Expr>),
Op(Box<Expr>, OpCode, Box<Expr>),
}
@@ -75,8 +76,9 @@ impl Expr {
trace!("Expr::matches: path={:?} self={:?}", path, self);
match self {
Self::Glob(glob) => glob_matches(glob, path),
- Self::LinksHereFunc => links_here(site, container, path), // FIXME: check its page
+ Self::LinksHereFunc(glob) => links_here(site, container, path, glob),
Self::PageFunc(glob) => page_matches(site, container, glob, path), // FIXME: check its page
+ Self::TaggedFunc(glob) => tagged(site, container, glob, path),
Self::Negate(expr) => !expr.matches(site, container, path),
Self::Op(left, op, right) => match op {
OpCode::And => {
@@ -148,7 +150,7 @@ fn glob_matches_helper(mut glob: &[char], mut path: &[char]) -> bool {
glob.is_empty() && path.is_empty()
}
-fn links_here(site: &Site, container: &Path, path: &str) -> bool {
+fn links_here(site: &Site, container: &Path, path: &str, _glob: &str) -> bool {
trace!(
"links_here: container={} path={:?}",
container.display(),
@@ -169,6 +171,11 @@ fn links_here(site: &Site, container: &Path, path: &str) -> bool {
false
}
+fn tagged(_site: &Site, container: &Path, path: &str, _glob: &str) -> bool {
+ trace!("tagged: container={} path={:?}", container.display(), path);
+ false
+}
+
fn page_matches(site: &Site, container: &Path, glob: &str, path: &str) -> bool {
if glob_matches(glob, path) {
let full_path = container.join(path);