whiley_test_file 0.6.2

An API for manipulating test files for the Whiley Programming Language.
Documentation
original.name="RecursiveType_Valid_18"
======
>>> main.whiley


type State is {int[] input, int pos}

type Expr is {int num} | {int op, Expr rhs, Expr lhs} | {int[] err}

function parse(int[] input) -> Expr:
    Expr e
    State st
    (e,st) = parseAddSubExpr({input: input, pos: 0})
    return e

function parseAddSubExpr(State st) -> (Expr e, State nst):
    return {num: 1}, st

public export method test() :
    Expr e = parse("Hello")
    assume e == {num:1}


---