-
Notifications
You must be signed in to change notification settings - Fork 139
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
Allow setting ContinuationLines to 0, meaning infinity (fixes #392) #394
Conversation
Also fix the documentation: the continuation line limit applies not only for Fortran, but for all formats.
Anyone? I'd imagine this change to be uncontroversial. |
I am also for this change. In another thread @vermaseren mentioned that there may be some fixed-size buffers. Are we sure that this change does not produce buffer overflows? |
There's a fixed-size buffer that holds the content of a line; this one is flushed every line. The line continuation marks are just printed every few lines or so, no buffer involved. I think this change is safe. |
Basically what needs to be done is rather simple:
1: whenever an output expression is printed set a flag.
2: when the flag is set: don’t print end-of-line or carriage-return.
3: when done printing the output expression, reset the flag and
print an end-of-line cq carriage-return.
This needs intervention in the places where you print expressions (in sch.c)
and where you print dollars. In addition you need to look for the LINEFEEDS
etc and put the if around it.
… On 13 Sep 2021, at 11:50, Vitaly Magerya ***@***.***> wrote:
There's a fixed-size buffer that holds the content of a line; this one is flushed every line. The line continuation marks are just printer every few lines or so, no buffer involved.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#394 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ABJPCEUO57MRVDIGN4N7O33UBXCNNANCNFSM5DJBJXMQ>.
Triage notifications on the go with GitHub Mobile for iOS <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android <https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
There's unfortunately also some logic to insert spaces, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this PR is OK (unless it interferes with the version 5.0 development source code).
Maybe you can add a test (like check/features.frm#Issue392
) in another commit, which guarantees this feature won't be broken.
Here's a test case. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect!
Is this ready for merging? |
If you're asking me, then yes. Not sure about others' opinions. |
Allow disabling the continuation line limit by setting
ContinuationLines
to 0.Also fix the documentation: the continuation line limit applies not only for Fortran, but for all formats.
This fixes issue #392.