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

ergoplatform / sigma-rust / 19957094785

05 Dec 2025 08:23AM UTC coverage: 86.918% (+8.5%) from 78.463%
19957094785

Pull #837

github

web-flow
Merge dec08367a into 2f840d387
Pull Request #837: Split TransactionHintsBag hints properly

44 of 53 new or added lines in 13 files covered. (83.02%)

1621 existing lines in 221 files now uncovered.

27453 of 31585 relevant lines covered (86.92%)

253204.4 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 {
9✔
32
        Binder { env }
9✔
33
    }
9✔
34

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

40
fn rewrite(expr: Expr, env: &ScriptEnv) -> Result<Expr, BinderError> {
9✔
41
    hir::rewrite(expr, |e| {
22✔
42
        Ok(match &e.kind {
22✔
43
            ExprKind::Ident(ident) => match env.get(ident) {
7✔
44
                Some(_) => todo!(),
×
45
                None => match ident.as_ref() {
7✔
46
                    "HEIGHT" => {
7✔
47
                        let v = GlobalVars::Height;
7✔
48
                        let tpe = v.tpe();
7✔
49
                        Some(Expr {
7✔
50
                            kind: v.into(),
7✔
51
                            span: e.span,
7✔
52
                            tpe: tpe.into(),
7✔
53
                        })
7✔
54
                    }
55
                    _ => None,
×
56
                },
57
            },
58
            _ => None,
15✔
59
        })
60
    })
22✔
61
}
9✔
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