The src-gen/check directory already holds incredibly useful check-Sort strategies and uses is-Sort-with-constructor. I think the more general is-Sort strategies fit well in those modules as well. Right now they are in src-gen/pp.

I’m using an is-Expr strategy for a generic check to run on Green Marl programs to see if my TS rules are still complete:

check-Expr-type =
  if not(get-annotation(?(Type(), Result(_))))
    then debug(!"No type task found on: ")
    else if get-type; Result(id); task-get-result; []
      then debug(!"Failed type property on: ")
    end
  end
check-types = topdown(if is-Expr then check-Expr-type else id end)
Submitted by Jeff Smits on 3 June 2015 at 19:43

Log in to post comments