RFR (s) 8114842: JShell: SourceCodeAnalysis splits code with array initialiazer incorrectly

Robert Field robert.field at oracle.com
Fri Nov 18 17:57:34 UTC 2016


Strange, I don't get any of the behaviors you show (what did you see 
this on?) --

jshell> int m = 0,
|  Error:
|  <identifier> expected
|  int m = 0,;
|            ^

jshell> int n1 = 0, n2
n1 ==> 0
n2 ==> 0

jshell> int n1 = 0, n2 =
    ...> 5
n1 ==> 0
n2 ==> 5

The first one though is definitely a problem.  That is because XTERM is 
set for COMMA, I'm trying to figure out why that is set. Comma can 
terminate a list of values, but that would be in braces and never seen here.

-Robert


On 11/18/16 08:09, Jan Lahoda wrote:
> Seems to me the handling of commas in declarations is not quite 
> correct. Consider for example:
> ---
> jshell> int m = 0,
> |  Error:
> |  reached end of file while parsing
> |  int m = 0,
> |            ^
>
> jshell> int n1 = 0, n2
> |  Error:
> |  reached end of file while parsing
> |  int n1 = 0, n2
> |                ^
>
> jshell> int n1 = 0, n2 =
> |  Error:
> |  reached end of file while parsing
> |  int n1 = 0, n2 =
> |                  ^
> ---
>
> Would something along these lines work better?
> http://cr.openjdk.java.net/~jlahoda/8114842/comma-in-decls.diff
>
> Jan
>
>
> On 16.11.2016 23:35, Robert Field wrote:
>> Bug:
>>
>>      https://bugs.openjdk.java.net/browse/JDK-8114842
>>
>> Webrev:
>>
>>      http://cr.openjdk.java.net/~rfield/8114842v0.webrev/
>>
>> Thanks,
>> Robert
>>



More information about the kulla-dev mailing list