jherkel commented on PR #8834:
URL: https://github.com/apache/netbeans/pull/8834#issuecomment-3539113660

   I checked source code and the problem here is that as @matthiasblaesing 
mentioned a parser returns INT_LITERAL for offset position 139 that contains 
'>' character. Output from lexers is:
   ```
   T[50]: "int" F(3) INT[29] FlyT, la=1, @2bb62414
   T[51]: " " F(1) WHITESPACE[124] FlyT, la=1, @6aecbb8d
   T[52]: "n1" <132,134> IDENTIFIER[1] DefT, la=1, @51ac12ac
   T[53]: " " F(1) WHITESPACE[124] FlyT, la=1, @6aecbb8d
   T[54]: "=" F(1) EQ[84] FlyT, la=1, @565b064f
   T[55]: " " F(1) WHITESPACE[124] FlyT, la=1, @6aecbb8d
   T[56]: "10" <137,139> INT_LITERAL[64] DefT, la=1, @1fb2eec
   *[57]: ">>" F(2) GTGT[108] FlyT, la=1, @1698fc68
   T[58]: " " F(1) WHITESPACE[124] FlyT, la=1, @6aecbb8d
   T[59]: "1" <142,143> INT_LITERAL[64] DefT, la=1, @463afa6e
   T[60]: ";" F(1) SEMICOLON[80] FlyT, @25b2cfcb
   ```
   Important line is T[56]. It has a position [137-139) (close-open interval) 
and from my point of view it is correct. But as for above mentioned, javac 
returns INT_LITERAL. I tried to debug source code (TreeUtilities.java 402-433 
lines) and I'm not sure about this line
        if (startPos < pos && endPos >= pos) {
   
   If I understand correctly, this checks if current three path encloses offset 
position. But If the position interval is close-open maybe this condition 
should be 
        if (startPos <= pos && endPos > pos) {
   
   But I'm not sure here. Maybe someone who understands javac internals  can 
clarify this. If I used the second version I could see correct behavior for 
"int n2 = 10>> 1;" but some unit tests for Java Source Base failed.
   Right now I'm not sure what exactly is wrong. Does anybody have anu idea?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to