Skip to content

Add module parser#338

Merged
KyrylR merged 1 commit into
BlockstreamResearch:dev/modulesfrom
LesterEvSe:feature/module-parsing
Jun 2, 2026
Merged

Add module parser#338
KyrylR merged 1 commit into
BlockstreamResearch:dev/modulesfrom
LesterEvSe:feature/module-parsing

Conversation

@LesterEvSe
Copy link
Copy Markdown
Collaborator

@LesterEvSe LesterEvSe commented May 29, 2026

Implement a working Module struct and handle recursive parsing. In this series of PRs, we do not plan to support qualified calls via :: (e.g., unit_1::call_function), as our existing alias system is sufficient.

@LesterEvSe LesterEvSe requested a review from KyrylR May 29, 2026 14:12
@LesterEvSe LesterEvSe self-assigned this May 29, 2026
@LesterEvSe LesterEvSe requested a review from delta1 as a code owner May 29, 2026 14:12
@LesterEvSe LesterEvSe added the enhancement New feature or request label May 29, 2026
Comment thread src/ast.rs
Use,
Module,
/// A placeholder used for error recovery during parsing.
Ignored,
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.

Let's have a dedicated issue for the need of this keyword

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Add documentation for that

Comment thread src/parse.rs Outdated
}
}

// TODO: Fix the formatter
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.

nit: for the future let's have more reasoning in text for the todos

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Added

Comment thread src/str.rs Outdated
#[cfg(feature = "arbitrary")]
impl<'a> arbitrary::Arbitrary<'a> for ModuleName {
fn arbitrary(u: &mut arbitrary::Unstructured<'a>) -> arbitrary::Result<Self> {
// TODO: Consider to change it
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.

nit: we should move it out of the local scope

reserved names sound like something that other functions can benefit from

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Moved the constants into the crate's scope and added public functions for the corresponding checks

@LesterEvSe LesterEvSe force-pushed the feature/module-parsing branch from d37a9dd to c835f1a Compare June 1, 2026 13:20
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 c835f1a; successfully ran local tests

@KyrylR KyrylR merged commit c835f1a into BlockstreamResearch:dev/modules Jun 2, 2026
11 checks passed
@LesterEvSe LesterEvSe deleted the feature/module-parsing branch June 2, 2026 08:53
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