title: Omit parenthesis in Groovy when spanning multiple lines?
body: <p>Working on a simple SQL like dsl in groovy, and I have some builder classes to create a select statement.</p>
  
  <p>e.g.</p>
  
  <pre><code>class SelectClause implements Clause {
  
    final Object[] attrs;
    final ModTupleDSL parent;
    FromClause fromClause;
  
    public SelectClause(ModTupleDSL parent, Object... attrs) {
      this.parent = parent;
      this.attrs = attrs;
    }
  
    public FromClause from (Object relation) {
      fromClause = new FromClause(this, relation);
      return fromClause;
    }
  }
  </code></pre>
  
  <p>and</p>
  
  <pre><code>class FromClause implements Clause {
  
    final Object relation;
    final SelectClause parent;
    WhereClause whereClause;
  
    public FromClause(SelectClause parent, Object relation) {
      this.parent = parent;
      this.relation = relation;
    }
  
    public WhereClause where(Closure predicate) {
      whereClause = new WhereClause(this, predicate);
      return whereClause;
    }
  }
  </code></pre>
  
  <p>etc...</p>
  
  <p>In my script I can now say this:</p>
  
  <pre><code>select all from foo where {tuple, args -&gt; tuple.get(id) == args[0]};
  </code></pre>
  
  <p>However, if I put newlines into it, that's an error.</p>
  
  <pre><code>select all 
  from foo 
  where {tuple, args -&gt; tuple.get(id) == args[0]};
  
  groovy.lang.MissingMethodException: 
  No signature of method: foo.Foo.from() is applicable for argument types:
   (clojure.lang.Keyword) values: [:foo]|Possible solutions: grep(), find(), 
            find(groovy.lang.Closure), grep(java.lang.Object), wait(), any()
  </code></pre>
  
  <p>Is this just a side effect of optional parenthesis when parsing Groovy? </p>
  
  <p>On a hunch, I put backslashes at the end of each line and it seems to work. e.g.</p>
  
  <pre><code>select all \
  from foo \
  where {tuple, args -&gt; tuple.get(id) == args[0]};
  </code></pre>
  
  <p>Is there a better way?</p>