-
Notifications
You must be signed in to change notification settings - Fork 171
DEV: Sync libasr with LFortran #2827
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
Conversation
strings_to_be_deallocated.p = strings_to_be_deallocated_copy; | ||
} | ||
|
||
void visit_ForEach(const ASR::ForEach_t &x) { |
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.
Not sure if this function / node was removed? It might be a specific node in LPython.
I think there was work in LPython to get various dicts and lists operations working, so it would be good to keep that if we can. But I think it is more important to sync, and keep it synced after that, so if it is difficult, we can temporarily remove it, and try to add it back later (the proper way: in LFortran first, then update a submodule). |
@@ -45,23 +45,23 @@ stmt | |||
| GoToTarget(int id, identifier name) | |||
| If(expr test, stmt* body, stmt* orelse) | |||
| IfArithmetic(expr test, int lt_label, int eq_label, int gt_label) | |||
| Print(expr* values, expr? separator, expr? end) |
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 end
and separator
are used in python syntax.
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.
They definitely are used in python syntax, but the ASR is supposed to be language agnostic, so I'm not really sure if we should've programming language details into ASR. Handle them in the frontend, and if it isn't possible, then have it in ASR.asdl of LFortran as well.
if (x.m_separator) { | ||
this->visit_expr(*x.m_separator); | ||
separator = src; | ||
separator = "\" \""; | ||
//HACKISH way to handle print refactoring (always using stringformat). | ||
// TODO : Implement stringformat visitor. |
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.
let's keep combination of this as we should keep separator
and end
memebers.
if (x.m_end) { | ||
this->visit_expr(*x.m_end); | ||
tmp_gen += "\%s\""; | ||
v.push_back(src); | ||
} else { | ||
tmp_gen += "\\n\""; | ||
} |
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.
as well as keeping this.
ce689a9
to
ede6e7f
Compare
If you merge it then do squash and merge. |
@@ -0,0 +1,551 @@ | |||
#pragma once |
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.
this file should be automatically generated. Please add it to .gitignore
.
@@ -0,0 +1,4688 @@ | |||
#pragma once |
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.
same, this has to be generated automatically
I would be busy. Please push the changes directly to my branch. |
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'm OK with these changes. I think sync will be complete once we get these tests one-by-one working.
@@ -1,4 +1,4 @@ | |||
from lpython import u8, u16, u32, u64 | |||
from lpython import u8, u16, u32, u64, i8 |
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.
Are the changes in this file needed for tests to pass?
|
||
// Generated by grammar/asdl_cpp.py | ||
|
||
#include <libasr/alloc.h> |
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'm commenting here to make sure that we don't commit this either. So that one of us can undo it.
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.
this one as well.
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.
this one as well.
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.
this one as well.
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.
maybe this as well.
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.
maybe this as well.
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.
maybe this as well
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.
maybe this as well.
@@ -0,0 +1,569 @@ | |||
#pragma once |
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.
maybe this as well.
Steps to complete,