groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "matthias.grueter@gmail.com" <matthias.grue...@gmail.com>
Subject Optional parentheses for methods with all uppercase names
Date Sat, 27 Feb 2016 22:08:32 GMT
[First off I apologize for possibly reposting this question. My original
posting never went out to the maillist due to unknown reasons. This is my
second attempt. Sorry if you already read this before.]

I am a developing a Groovy DSL to create Dockerfiles

The format of a Dockerfile looks like:

INSTRUCTION arguments

Instructions are case-insensitive but convention is for them to be
UPPERCASE.

However Groovy doesn't seem to support optional parentheses if the method
name is all uppercase:

def FOOBAR(String msg) {
println msg
}
FOOBAR "hello"

groovyc: unexpected token: hello @ line 2, column 8.
FOOBAR "hello"
^

Do you know of any way to get this to work or is this a known limitation of
Groovy?

I tried with Groovy version 2.4.5

If anyone has any insight, it would be very helpful.

/matthias

-- 
Matthias GrĂ¼ter
www.grueter.name   //   matthias@grueter.name

Mime
View raw message