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

Improve import behavior #97

Closed
coder11 opened this issue Apr 27, 2021 · 2 comments · Fixed by #156
Closed

Improve import behavior #97

coder11 opened this issue Apr 27, 2021 · 2 comments · Fixed by #156
Assignees
Labels
bug Something isn't working enhancement New feature or request

Comments

@coder11
Copy link
Contributor

coder11 commented Apr 27, 2021

Basically imports create a graph of dependencies between source files. Currently if you have a cycle in that graph the compiler will hang and crash with out of memory.

Quick fix: display an error message if a cyclic dependency has been found

Better fix: parse import statements, put them into a graph, do a topological sort on that graph, and include files in that order.

@coder11 coder11 added bug Something isn't working enhancement New feature or request labels Apr 27, 2021
@alari alari self-assigned this Apr 29, 2021
@alari
Copy link
Member

alari commented May 3, 2021

Cannot reproduce, @coder11 can you provide an example, please?

Cyclic dependencies are already checked. I tried to break the checker, it shows an error as expected.

@alari
Copy link
Member

alari commented May 31, 2021

Related to #125. When an imported file contains an error, it leads to a blow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants