Skip to content
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

Strange formatting of comments #148

Open
fpga-guy opened this issue Sep 2, 2023 · 0 comments
Open

Strange formatting of comments #148

fpga-guy opened this issue Sep 2, 2023 · 0 comments

Comments

@fpga-guy
Copy link

fpga-guy commented Sep 2, 2023

Unfortunately javadoc style multiline comments preceding a rule cause a strange formatting effect. The following rule is moved to just after the comment ending. Also, multiple single line comments are indented and extra lines are added.

grammar Funny;

/**
This is a funny grammar that confuses Antlr4Formatter
*/
test : 'a' 'b' 'c' test2 EOF;

//
// test number 2
//
test2 : '1' '2' '3';

turns into

grammar Funny;

/**
This is a funny grammar that confuses Antlr4Formatter
*/ test
   : 'a' 'b' 'c' test2 EOF
   ;
   //
   
   // test number 2
   
   //
   
test2
   : '1' '2' '3'
   ;

This seems very odd to me. I'm not sure if this is intentional or not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant