navid/haze / 94d8e2a026845bd62732f6eb7c222b5a9c18a60511c534c648cee6fd4b471090 / tests/format/unformatted.hz

unformatted.hz

← tests/format · 507 bytes · raw · download

fn   some_func (   ) {
var x i32=20    
    var y i64 = cast[i64](x)
print(y)     
}

contract Positive(n i32){
pre n>0
}

fn classify ( n i32 ) i32
    : Positive(n)
    : post r=>r>=0 {
    if n>0 {
    return n
    }
    else {
    return 0
    }
}

fn main(){
var total=0
for i in 0..3
    : invariant total>=0
{
total+=i
}
print(total)
}

fn chain ( xs list[i32] ) i32 {
var total=0
for x in xs
    : invariant total>=0
{
total+=x
}
const ys=[
1,
2,
]
return -1
}

fn allman ( n i32 ) i32
{
return n
}