Skip to content

Syntax Error after cleanup at token '=' #226

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
this-yash opened this issue Jan 4, 2024 · 5 comments
Closed

Syntax Error after cleanup at token '=' #226

this-yash opened this issue Jan 4, 2024 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@this-yash
Copy link

Hi,

I've been facing an issue if I use FOR expression with GROUP BY clause. If I comment it, the ABAP Cleaner works fine.
Screenshots are attached below for both the sample code and the issue. Please, share if it can be fixable from my side else check if it is fixable from your side.
Also, thanks for the awesome tool. It's a game changer!

image
image

@jmgrassau jmgrassau added the bug Something isn't working label Jan 4, 2024
@jmgrassau
Copy link
Member

Hi Yash,

thanks a lot for reporting this issue! This seems to be a bug in the cleanup rule "Shorten VALUE statements", which mistakes the group key for a table row. A minimal example to trigger the error would be this:

itab = VALUE #( FOR GROUPS OF <fs> IN itab GROUP BY 
                ( plant = <fs>-plant )
                ( plant = <fs>-plant
                  l1    = <fs>-l1 ) ).

Here, the cleanup rule erroneously identifies plant = <fs>-plant as a common assignment and therefore extracts it from both inner parentheses …

itab = VALUE #( FOR GROUPS OF <fs> IN itab GROUP BY 
                plant = <fs>-plant
                ( )
                ( l1    = <fs>-l1 ) ).

… which is a syntax error. Will fix this asap!

Kind regards,
Jörg-Michael

@jmgrassau jmgrassau self-assigned this Jan 4, 2024
@jmgrassau
Copy link
Member

Hi Yash,

this bug is now fixed for the next release.

Kind regards,
Jörg-Michael

@this-yash
Copy link
Author

Hi,

Thank you very much. Will wait for the next release.

jmgrassau added a commit to jmgrassau/abap-cleaner that referenced this issue Jan 5, 2024
@jmgrassau
Copy link
Member

Hi Yash,

thanks again for this bug report – this error should now be fixed with version 1.13.0, which was just released!

Kind regards,
Jörg-Michael

@ConjuringCoffee
Copy link
Contributor

I love learning about syntax possibilities from ABAP Cleaner bug reports 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants