groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From OC <...@ocs.cz>
Subject Re: Optional parentheses for methods with all uppercase names
Date Sun, 28 Feb 2016 16:48:33 GMT
We have bumped into this parser issue long long ago, see

http://www.groovy-lang.org/mailing-lists.html#nabble-td5722268

All the best,
OC

On 27. 2. 2016, at 23:19, Bay Batu <batuhanbayrakci@gmail.com> wrote:

> Hello,
> 
> I tried it and it looks like an issue about first letter’s case. 
> 
> For example,
> 
> *********
> def Foo(a){
> 	print a
> }
> 
> Foo “berbat"
> *********
> gives compilation error: unexpected token berbat
> 
> But it does not give a compilation error when i change it like that.
> 
> *********
> def fOo(a){
> 	print a
> }
> 
> fOo “berbat"
> *********
> 
> /baybatu
> 
> 
> 
> 
> 
> 
>> On Feb 28, 2016, at 00:08, matthias.grueter@gmail.com wrote:
>> 
>> [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