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

TyRoXx / NonlocalityOS / 15320443667

29 May 2025 09:10AM UTC coverage: 72.844% (+0.09%) from 72.751%
15320443667

Pull #262

github

web-flow
Merge 640ef9b92 into b29009a9e
Pull Request #262: GH-257: support local variables

54 of 73 new or added lines in 4 files covered. (73.97%)

16 existing lines in 1 file now uncovered.

3345 of 4592 relevant lines covered (72.84%)

2219.36 hits per line

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

36.36
/lambda_compiler/src/ast.rs
1
use crate::compilation::SourceLocation;
2
use lambda::name::Name;
3

4
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone)]
5
pub struct LambdaParameter {
6
    pub name: Name,
7
    pub source_location: SourceLocation,
8
    pub type_annotation: Option<Expression>,
9
}
10

11
impl LambdaParameter {
12
    pub fn new(
59✔
13
        name: Name,
14
        source_location: SourceLocation,
15
        type_annotation: Option<Expression>,
16
    ) -> Self {
17
        Self {
18
            name,
19
            source_location,
20
            type_annotation,
21
        }
22
    }
23
}
24

25
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone)]
26
pub enum Expression {
27
    Identifier(Name, SourceLocation),
28
    StringLiteral(String),
29
    Apply {
30
        callee: Box<Expression>,
31
        arguments: Vec<Expression>,
32
    },
33
    Lambda {
34
        parameters: Vec<LambdaParameter>,
35
        body: Box<Expression>,
36
    },
37
    ConstructTree(Vec<Expression>),
38
    Braces(Box<Expression>),
39
    Let {
40
        name: Name,
41
        location: SourceLocation,
42
        value: Box<Expression>,
43
        body: Box<Expression>,
44
    },
45
}
46

47
impl Expression {
48
    pub fn source_location(&self) -> SourceLocation {
1✔
49
        match self {
1✔
50
            Expression::Identifier(_, location) => *location,
1✔
51
            Expression::StringLiteral(_) => todo!(),
52
            Expression::Apply { callee, .. } => callee.source_location(),
×
53
            Expression::Lambda { body, .. } => body.source_location(),
×
54
            Expression::ConstructTree(_) => todo!(),
NEW
55
            Expression::Braces(expression) => expression.source_location(),
×
56
            Expression::Let {
57
                name: _,
NEW
58
                location,
×
NEW
59
                value: _,
×
NEW
60
                body: _,
×
NEW
61
            } => *location,
×
62
        }
63
    }
64
}
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