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

WhileLoop doesn't conform to ASDL #33

Open
rebcabin opened this issue May 11, 2023 · 3 comments
Open

WhileLoop doesn't conform to ASDL #33

rebcabin opened this issue May 11, 2023 · 3 comments
Assignees
Labels
bug Something isn't working question Further information is requested

Comments

@rebcabin
Copy link
Owner

Example from asr-expr1-dde511e.stdout has three parameters:

(WhileLoop
                                        () ;; one
                                        (NamedExpr
                                            (Var 2 a)
                                            (IntegerConstant 1 (Integer 4 []))
                                            (Integer 4 [])
                                        ) ;; two
                                        [(=
                                            (Var 2 y)
                                            (IntegerConstant 1 (Integer 4 []))
                                            ()
                                        )] ;; three
                                    )

but ASDL from ASDL_2023_APR_06_snapshot.asdl specifies only two:

    | WhileLoop(expr test, stmt* body)

The first argument in the Example is mysterious. I'll work around it for now.

@rebcabin rebcabin added bug Something isn't working question Further information is requested labels May 11, 2023
@certik
Copy link
Collaborator

certik commented May 12, 2023

The current ASR definition is WhileLoop(identifier? name, expr test, stmt* body), the first argument is probably a "goto target" to jump to, this is needed if you have multiple nested loops and you are doing "break name" to a specific parent loop. There might be a better way to do it, but for now we use this mechanism. Python doesn't allow breaking to a parent loop, but Fortran does.

@rebcabin
Copy link
Owner Author

rebcabin commented May 12, 2023 via email

@rebcabin rebcabin reopened this May 15, 2023
@rebcabin
Copy link
Owner Author

reopening as documentation reminder as requested by @certik

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants