Mercurial > repos > tabletprog
view modules/compiler.tp @ 331:61f5b794d939
Breaking change: method call syntax now always uses the syntactic receiver as the actual receiver. This makes its behavior different from function call syntax, but solves some problems with methods being shadowed by local variables and the like.
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Sat, 28 Mar 2015 14:21:04 -0700 |
parents | 004946743678 |
children |
line wrap: on
line source
#{ main <- :args { if: (args length) > 1 { file <- os open: (args get: 1) (os O_RDONLY) code <- "" chunksize <- 1024 readsize <- chunksize while: { readsize = chunksize} do: { seg <- os read: file chunksize code <- code . seg readsize <- seg byte_length } res <- parser top: code if: res { methods <- symbols buildMethodTable: (res yield) print: methods } else: { print: "Parse failed!\n" } } else: { print: "Usage compiler FILE\n" } } }