TiarkRompf/virtualization-lms-core — pull request #69 by Lewix (2013-10-21 12:59:44+00:00)
Title: String interpolators for codegens

The changes in this pull request add two string interpolators, `gen` and `src`, which simplify writing code generation cases. Both of the interpolators automate:

* Quoting of Expressions
* Remapping of Manifests
* Concatenating sequences with commas

On top of this, `gen` calls `stream.println` on the strings and `emitBlock` on any blocks. The result is that code such as:

stream.println("val " + quote(sym) + " = { ")
emitBlock(b)
stream.println(quote(getBlockResult(b)))
stream.println("}")

Now looks like this:

gen"""val $sym = {
|$b
|${getBlockResult(b)}
|}"""