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

TyRoXx / NonlocalityOS / 15237436685

25 May 2025 11:33AM UTC coverage: 72.751% (+0.1%) from 72.638%
15237436685

Pull #258

github

web-flow
Merge 10a3577ca into 6ff867199
Pull Request #258: GH-256: extend AST for optional parameter type annotations

79 of 93 new or added lines in 5 files covered. (84.95%)

2 existing lines in 1 file now uncovered.

3292 of 4525 relevant lines covered (72.75%)

2236.02 hits per line

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

57.14
/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
}
40

41
impl Expression {
42
    pub fn source_location(&self) -> SourceLocation {
1✔
43
        match self {
1✔
44
            Expression::Identifier(_, loc) => loc.clone(),
1✔
45
            Expression::StringLiteral(_) => todo!(),
NEW
46
            Expression::Apply { callee, .. } => callee.source_location(),
×
NEW
47
            Expression::Lambda { body, .. } => body.source_location(),
×
48
            Expression::ConstructTree(_) => todo!(),
NEW
49
            Expression::Braces(expr) => expr.source_location(),
×
50
        }
51
    }
52
}
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