Replying to myself and for future use: at least, there's an undocumented `scan` compiler command to dump the result of the lexer/scanner.
Try `nim scan foo.nim` to see the tokens identified in the source file. There's also a `parse` command but it discards its result. So apart from checking that the source is syntactical valid, like command `check` does, it is of no real use. It can be easily enhanced to dump the source AST while rewriting the [line](https://github.com/nim-lang/Nim/blob/devel/compiler/main.nim#L360) by debug parseFile(conf.projectMainIdx, cache, conf) Run after including module `astalgo` in `main.nim`. The output being very verbose, this must be used for tiny sources!
