The Blocker

The Blocker is the first stage in the compilation pipeline. Functional programs are generally laid out in terms of simple statements with nested statements below them in "blocks".

Unlike other languages such as Miranda and Haskell, I decided to be very strict about this, in large part because it enables me to have many different syntaxes in the same file without having to worry too much about what the layout is.

The rules for blocking are basically fairly simple:

Once the Blocker has run, the output is a list of Block objects, each of which has exactly one ContinuedLine consisting of multiple SingleLine objects, and may have nested Block objects.