Add math stdlib with formulas/plots and polish the docs view.

Ship Num/Formula runtime, bilingual math libs, SVG plots with axes/grid, and view UX for collapsible folders plus centered plots.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
cflmyandCursor committed 2026-08-05 11:30:47 +08:00
1 parent a53ebb65ee
commit dcd0cdb8f7
40 files changed
+3553 -276

No files matched your search

+5 -1
View File
@@ -206,7 +206,7 @@ impl<'a> FnCompiler<'a> {
fn compile_stmt(&mut self, stmt: &Stmt) -> Result<()> {
match stmt {
Stmt::Assign { name, value, span } => {
Stmt::Assign { name, value, span, .. } => {
self.stmt_span = *span;
self.compile_expr(value)?;
let slot = self.local_slot(name);
@@ -637,6 +637,10 @@ impl<'a> FnCompiler<'a> {
}
self.emit(Op::BuildList(items.len() as u16));
}
Expr::Formula(e) => {
let i = self.add_const(Value::Formula(e.clone()));
self.emit(Op::Constant(i));
}
}
Ok(())
}