Skip to content

Take line breaks into account for redundant periods#528

Open
engboris wants to merge 2 commits intoOCamlPro:masterfrom
engboris:syntax-dots
Open

Take line breaks into account for redundant periods#528
engboris wants to merge 2 commits intoOCamlPro:masterfrom
engboris:syntax-dots

Conversation

@engboris
Copy link
Copy Markdown
Contributor

I had a fix for redundant periods: #521

However, it doesn't take line breaks into account, as in:

       IDENTIFICATION DIVISION.
       PROGRAM-ID. REDUNDANT-DOTS.

       ENVIRONMENT DIVISION.

       DATA DIVISION.
       WORKING-STORAGE SECTION.
       01  WS-MESSAGE        PIC X(30) VALUE "Hello, COBOL World!".
       01  WS-COUNTER        PIC 9     VALUE 1.

       .

I tried a new fix and the check syntax commands succeeds but I'm not sure about it as I'm not sure to understand exactly how tokens are manipulated. Moreover, the tests I have promoted look suspicious.

@engboris engboris requested a review from nberth February 12, 2026 13:07
@engboris engboris added the ok to review As its name says label Feb 12, 2026
@nberth
Copy link
Copy Markdown
Collaborator

nberth commented Feb 12, 2026

In this particular case may the period after 1 just be considered an interleaving token? I'm not sure adding even more state into the parser record is the way to go here. One approach I think might be cleaner is to allow lonesome periods when: (i) a full data description item is expected in the data division, and (ii) a statement is expected in the procedure division.

@engboris
Copy link
Copy Markdown
Contributor Author

engboris commented Feb 12, 2026

Hmm I merged with master and got a lot of weird output on make test. I'll try something else.

@engboris engboris marked this pull request as draft February 12, 2026 13:25
@engboris engboris force-pushed the syntax-dots branch 4 times, most recently from 9bb9295 to 78d9822 Compare February 12, 2026 13:43
@engboris engboris marked this pull request as ready for review February 12, 2026 13:52
17 > IF OK NOT EQUAL "OK" DISPLAY OK.
---- ^^
>> Error: Invalid syntax

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This here seems to be an issue unfortunately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ok to review As its name says

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants