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 print related bugs #3224

Merged
merged 7 commits into from Jan 26, 2024
Merged

Fix print related bugs #3224

merged 7 commits into from Jan 26, 2024

Conversation

Shaikh-Ubaid
Copy link
Member

fixes #3215

ASR::expr_t *empty_string = ASRUtils::EXPR(ASR::make_StringConstant_t(
al, loc, s2c(al, ""), str_type_len_0));
a_values_vec.push_back(al, empty_string);
ASR::asr_t* file_write_asr_t = construct_leading_space(false, loc);
Copy link
Contributor

Choose a reason for hiding this comment

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

The leading space should only be inserted if compiler_options.print_leading_space.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, at the above location, it is inserted when format string is not specified and --print-leading-space is provided. Do you want to update this to any other logic?

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, I missed the compiler_options.print_leading_space.

Copy link
Contributor

@certik certik left a comment

Choose a reason for hiding this comment

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

I think this is fine. If there are bugs, we'll fix them as we find them.

@Shaikh-Ubaid Shaikh-Ubaid marked this pull request as ready for review January 26, 2024 17:58
@Shaikh-Ubaid Shaikh-Ubaid merged commit 6712771 into lfortran:main Jan 26, 2024
21 checks passed
@Shaikh-Ubaid Shaikh-Ubaid deleted the fix_print branch January 26, 2024 20:50
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.

--print-leading-space stopped working
2 participants