timestamp
- for (name, count) in [include_str!("icons/download.svg"), "runs", "deps"]
+ for (name, count) in [include_str!("icons/download.svg"), include_str!("icons/run.svg"), "deps"]
.iter()
.zip([imports, runs, dependencies])
.filter(|(_, &c)| c != 0)
@@ -331,7 +352,13 @@ impl fmt::Display for Post {
!name count
}
-
code
+
+
+
code
+
+
if *timestamp == 0 {
@@ -772,7 +799,19 @@ mod db {
JOIN roots ON import.to_name = roots.name
AND import.to_author = roots.author
) SELECT (count(*) - 1) FROM roots
- ) AS imports FROM post AS outher WHERE timestamp < ?",
+ ) AS imports, (
+ WITH RECURSIVE roots(name, author, code) AS (
+ SELECT name, author, code FROM post WHERE name = outher.name AND author = outher.author
+ UNION
+ SELECT post.name, post.author, post.code FROM post
+ JOIN import ON post.name = import.from_name
+ AND post.author = import.from_author
+ JOIN roots ON import.to_name = roots.name
+ AND import.to_author = roots.author
+ ) SELECT count(*) FROM roots
+ JOIN run ON roots.name = run.code_name
+ AND roots.author = run.code_author
+ ) as runs FROM post AS outher WHERE timestamp < ?",
create_post: "INSERT INTO post (name, author, timestamp, code) VALUES(?, ?, ?, ?)",
fetch_deps: "
WITH RECURSIVE roots(name, author, code) AS (
@@ -787,6 +826,7 @@ mod db {
",
create_import: "INSERT INTO import(to_author, to_name, from_author, from_name)
VALUES(?, ?, ?, ?)",
+ creata_run: "INSERT OR IGNORE INTO run(code_name, code_author, runner) VALUES(?, ?, ?)",
}
}
diff --git a/lang/src/parser.rs b/lang/src/parser.rs
index 2d76b47..4b4878d 100644
--- a/lang/src/parser.rs
+++ b/lang/src/parser.rs
@@ -1597,7 +1597,7 @@ impl ArenaChunk {
fn contains(&self, arg: *mut u8) -> bool {
(self.base <= arg && unsafe { self.base.add(self.size) } > arg)
- || self.next().map_or(false, |s| s.contains(arg))
+ || self.next().is_some_and(|s| s.contains(arg))
}
pub fn size(&self) -> usize {
diff --git a/vm/src/vmrun.rs b/vm/src/vmrun.rs
index 65e9c66..3ee19cb 100644
--- a/vm/src/vmrun.rs
+++ b/vm/src/vmrun.rs
@@ -520,7 +520,7 @@ where
if swapped {
core::mem::swap(&mut a0, &mut a1);
}
- self.write_reg(tg, a0.partial_cmp(&a1).map_or(false, |v| v == expected) as u8)
+ self.write_reg(tg, (a0.partial_cmp(&a1) == Some(expected)) as u8)
});
}
}