Tuples and Parentheses

There are three ways to write tuple expressions. The most general form is TUPLE(tree, ...):

import treehugger.forest._, definitions._, treehuggerDSL._
TUPLE()                      // ()
TUPLE(REF("x"))              // (x)
TUPLE(LIT(0), LIT(1))        // (0, 1)

The second way is to use UNIT literal:

UNIT                         // ()

Finally, PAREN(tree, ...) can also be used to write a tuple expression:

PAREN(REF("x"))              // (x)

Semantically speaking the actual scala.Tuplen are formed only when two or more arguments are passed, but as a syntactic expression, PAREN is just an alias to TUPLE.