Skip to content

Conversation

@yutaro-sakamoto
Copy link
Contributor

       identification division.
       program-id.      prog.
       procedure          division.
           GO TO PROC-A.
       PROC-A.
           STOP RUN.

Older compilers generates the following Java code for the above GO TO statement

        /* prog.cbl:4: GO TO */
        {
          if(true) return Optional.of(contList[l_MAIN__PROC_A          ]);

        }

Due to this PR, the compiler will generate the following code

        /* prog.cbl:4: GO TO */
        {
          if(true) return Optional.of(contList[l_MAIN__PROC_A]);
        }

Copilot AI review requested due to automatic review settings November 24, 2025 01:54
Copilot finished reviewing on behalf of yutaro-sakamoto November 24, 2025 01:56
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves code formatting for COBOL GO TO statement compilation by removing an unintended blank line after generated Java code. The change refactors the output method from joutput_line("]);\n") (which added an extra newline) to joutput("]);") followed by joutput_newline(), producing cleaner generated code with proper single-line spacing.

  • Removes blank line after GO TO statements in generated Java code
  • Refactors output method calls for better control over newlines

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@yutaro-sakamoto yutaro-sakamoto merged commit 2e10085 into opensourcecobol:develop Nov 25, 2025
151 checks passed
@kio-watanabe kio-watanabe mentioned this pull request Nov 27, 2025
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

Successfully merging this pull request may close these issues.

2 participants