• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ergoplatform / sigma-rust / 19791940777

30 Nov 2025 01:23AM UTC coverage: 86.947% (+8.5%) from 78.463%
19791940777

Pull #838

github

web-flow
Merge 04804ccc0 into 2f840d387
Pull Request #838: CI fixes

17 of 19 new or added lines in 10 files covered. (89.47%)

1625 existing lines in 222 files now uncovered.

27478 of 31603 relevant lines covered (86.95%)

506474.74 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

73.33
/ergoscript-compiler/src/binder.rs
1
use rowan::TextRange;
2

3
use crate::error::pretty_error_desc;
4
use crate::hir;
5
use crate::hir::Expr;
6
use crate::hir::ExprKind;
7
use crate::hir::GlobalVars;
8
use crate::script_env::ScriptEnv;
9

10
#[derive(Debug, PartialEq, Eq)]
11
pub struct BinderError {
12
    msg: String,
13
    span: TextRange,
14
}
15

16
impl BinderError {
17
    pub fn new(msg: String, span: TextRange) -> Self {
×
UNCOV
18
        Self { msg, span }
×
UNCOV
19
    }
×
20

21
    pub fn pretty_desc(&self, source: &str) -> String {
×
22
        pretty_error_desc(source, self.span, &self.msg)
×
UNCOV
23
    }
×
24
}
25

26
pub struct Binder {
27
    env: ScriptEnv,
28
}
29

30
impl Binder {
31
    pub fn new(env: ScriptEnv) -> Self {
18✔
32
        Binder { env }
18✔
33
    }
18✔
34

35
    pub fn bind(&self, expr: Expr) -> Result<Expr, BinderError> {
18✔
36
        rewrite(expr, &self.env)
18✔
37
    }
18✔
38
}
39

40
fn rewrite(expr: Expr, env: &ScriptEnv) -> Result<Expr, BinderError> {
18✔
41
    hir::rewrite(expr, |e| {
44✔
42
        Ok(match &e.kind {
44✔
43
            ExprKind::Ident(ident) => match env.get(ident) {
14✔
44
                Some(_) => todo!(),
×
45
                None => match ident.as_ref() {
14✔
46
                    "HEIGHT" => {
14✔
47
                        let v = GlobalVars::Height;
14✔
48
                        let tpe = v.tpe();
14✔
49
                        Some(Expr {
14✔
50
                            kind: v.into(),
14✔
51
                            span: e.span,
14✔
52
                            tpe: tpe.into(),
14✔
53
                        })
14✔
54
                    }
55
                    _ => None,
×
56
                },
57
            },
58
            _ => None,
30✔
59
        })
60
    })
44✔
61
}
18✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc