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

fix: only put 'empty_print_endl' at the end of 'print' arguments #3937

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

gxyd
Copy link
Contributor

@gxyd gxyd commented Apr 25, 2024

Fixes #3850

@gxyd
Copy link
Contributor Author

gxyd commented Apr 25, 2024

I'm curious, for why the current PRINT node in ASR is:

Print(expr* values, expr? separator, expr? end)

and AST node is:

Print(int label, expr? fmt, expr* values, trivia? trivia)

while in the J3 documentation, it has only "format" (which was removed here: #2471).

Screenshot 2024-04-25 at 4 49 30 PM

I'm curious for how would a user specify a "separator" and "end" for an ASR node? @certik @Thirumalai-Shaktivel?

@gxyd
Copy link
Contributor Author

gxyd commented Apr 25, 2024

I'm keeping this PR in "open" as I'm looking for the answer to the above questions, and I'm not ready to get this merged before I understand the purpose of having separator and end for how would a user actually specify them in Fortran.

@certik
Copy link
Contributor

certik commented Apr 25, 2024

See this comment: #2471 (comment), I think the ASR node for print should just accept a string, that's it. All formatting should be done using the StringFormat node.

In StringFormat node, you can add a separator in a few different ways.

@certik certik marked this pull request as draft April 25, 2024 18:42
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.

empty array not really empty?
2 participants