Skip to content

feat(ast): add ast#4

Merged
Boshen merged 1 commit intomainfrom
ast
Feb 11, 2023
Merged

feat(ast): add ast#4
Boshen merged 1 commit intomainfrom
ast

Conversation

@Boshen
Copy link
Member

@Boshen Boshen commented Feb 11, 2023

The AST is going to be allocated in a memory arena so it is filled with lifetimes.

A lot of people are uncomfortable with lifetimes, but sadly this is the only way to make the AST fast.

@Boshen Boshen merged commit 62a4f2b into main Feb 11, 2023
@Boshen Boshen deleted the ast branch February 11, 2023 12:27

#[derive(Debug, Default, Clone, Copy, Serialize, PartialEq, Eq)]
pub struct Node {
pub start: usize,

Choose a reason for hiding this comment

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

What's your reasoning behind using usize for node ranges. Isn't a u32 sufficient for "all" reasonable programs (I never tried executing a 4GB JS file)

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch! It ought to be u32 but it was tedious to convert it back to usize in some areas of the code - I think it was mostly the diagnostics printing crate miette.

Copilot AI added a commit that referenced this pull request Aug 2, 2025
Co-authored-by: Boshen <1430279+Boshen@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants