Skip to content

Change AST to match the functionality of the Driver#284

Merged
KyrylR merged 1 commit intoBlockstreamResearch:dev/importsfrom
LesterEvSe:feature/imports-with-ast
Apr 21, 2026
Merged

Change AST to match the functionality of the Driver#284
KyrylR merged 1 commit intoBlockstreamResearch:dev/importsfrom
LesterEvSe:feature/imports-with-ast

Conversation

@LesterEvSe
Copy link
Copy Markdown
Collaborator

@LesterEvSe LesterEvSe commented Apr 15, 2026

  • Adapt the AST to enable driver functionality.
  • Add architecture notes about using "main" as an alias.
  • Add constants for the "main" function and the first module in the DependencyGraph to prevent the usage of magic numbers.

AST currently has some issues with processing source files properly, so they are not used and have been deleted along with the ResolvedFile structure.
I hope this will be fixed when the ErrorCollector is recoded to support multiple files better.

@LesterEvSe LesterEvSe requested a review from KyrylR April 15, 2026 12:35
@LesterEvSe LesterEvSe self-assigned this Apr 15, 2026
@LesterEvSe LesterEvSe requested a review from delta1 as a code owner April 15, 2026 12:35
@LesterEvSe LesterEvSe added the enhancement New feature or request label Apr 15, 2026
Comment thread src/driver/mod.rs Outdated

mod linearization;
mod resolve_order;
pub mod resolve_order;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
pub mod resolve_order;
pub(crate) mod resolve_order;

?

@LesterEvSe LesterEvSe force-pushed the feature/imports-with-ast branch 2 times, most recently from 5db3887 to 8924e31 Compare April 15, 2026 16:14
@LesterEvSe LesterEvSe requested a review from KyrylR April 15, 2026 16:14
@LesterEvSe LesterEvSe marked this pull request as draft April 17, 2026 14:34
@LesterEvSe LesterEvSe force-pushed the feature/imports-with-ast branch 2 times, most recently from a56022e to 539cf0a Compare April 20, 2026 12:55
@LesterEvSe LesterEvSe marked this pull request as ready for review April 20, 2026 12:55
@LesterEvSe LesterEvSe force-pushed the feature/imports-with-ast branch from 539cf0a to e1cd84e Compare April 20, 2026 13:47
@KyrylR
Copy link
Copy Markdown
Collaborator

KyrylR commented Apr 20, 2026

cargo rustc --manifest-path fuzz/Cargo.toml --bin compile_parse_tree -- --cfg fuzzing is failing

@KyrylR
Copy link
Copy Markdown
Collaborator

KyrylR commented Apr 20, 2026

Could we document that main cannot be used as an alias?

@LesterEvSe LesterEvSe force-pushed the feature/imports-with-ast branch from e1cd84e to af536d0 Compare April 21, 2026 08:47
Comment thread src/ast.rs Outdated
Comment on lines +589 to +592
assert_eq!(
self.file_id, MAIN_MODULE,
"The 'main' function must be defined in the entry point file"
);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Not sure if it is a good idea to panic here

@LesterEvSe LesterEvSe force-pushed the feature/imports-with-ast branch from af536d0 to 0fc6ca3 Compare April 21, 2026 10:49
Copy link
Copy Markdown
Collaborator

@KyrylR KyrylR left a comment

Choose a reason for hiding this comment

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

ACK 0fc6ca3

@KyrylR KyrylR merged commit 0fc6ca3 into BlockstreamResearch:dev/imports Apr 21, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants