nponeccop / HNC

HN Compiler
GNU Lesser General Public License v3.0
62 stars 5 forks source link

Implement indentation-based syntax in Parser #25

Open nponeccop opened 12 years ago

nponeccop commented 12 years ago

Replace

foo = {
      x = 2
      bar x x
}

with

foo = bar x x where
    x = 2

Note that the indentation (so called "offside rule") cannot be described by a context-free grammar so it requires to use a state monad transformer in Parsec.

Also note that this task requires to change most of about 300 tests we have to match the new syntax.