lisette-semantics 0.2.16

Little language inspired by Rust that compiles to Go
Documentation
1
2
3
4
5
6
7
8
9
10
11
use diagnostics::LocalSink;
use syntax::ast::Expression;

pub(crate) fn check(expression: &Expression, sink: &LocalSink) {
    if let Expression::Loop { body, span, .. } = expression
        && let Expression::Block { items, .. } = body.as_ref()
        && items.is_empty()
    {
        sink.push(diagnostics::infer::empty_infinite_loop(span));
    }
}