Paul King created GROOVY-9936:
---------------------------------

             Summary: Difference between Antlr2 and parrot parsers for variable 
declaration optimisation
                 Key: GROOVY-9936
                 URL: https://issues.apache.org/jira/browse/GROOVY-9936
             Project: Groovy
          Issue Type: Bug
          Components: parser-antlr4
            Reporter: Paul King
            Assignee: Paul King


As an optimisation for parsing, both parsers treat statements like:
{code}
int var1
Foo var2
Bar var3
{code}
as variable declarations due to the starting capital letter of the first term 
(for non-primitives).

And the following are treated by both parsers as command expressions:
{code}
foo x
bar y
{code}
due to the lowercase starting letter of the first term. If

A difference in behavior can be noted for cases starting with underscore or 
dollar (the only other characters available for the first letter of a class 
name):
{code}
_foo bar
$bar baz
{code}
These were command expression for the old parser and are being coerced to 
variable declarations in the Parrot parser.

We need to decide whether to alter these last two cases for backwards 
compatibility or whether 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to