forked from FuelLabs/sway
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Unify AST compilation code between core and forc. (FuelLabs#4670)
## Description This unifies the AST compilation step between forc and core, so both are running througn the same code path. Working on this as a prerequisite towards AST caching. ## Checklist - [ ] I have linked to any relevant issues. - [ ] I have commented my code, particularly in hard-to-understand areas. - [ ] I have updated the documentation where relevant (API docs, the reference, and the Sway book). - [ ] I have added tests that prove my fix is effective or that my feature works. - [ ] I have added (or requested a maintainer to add) the necessary `Breaking*` or `New Feature` labels where relevant. - [ ] I have done my best to ensure that my PR adheres to [the Fuel Labs Code Review Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md). - [ ] I have requested a review from the relevant team or maintainers. Co-authored-by: Joshua Batty <[email protected]>
- Loading branch information
1 parent
9bfae12
commit f246d97
Showing
6 changed files
with
123 additions
and
152 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
use super::{lexed::LexedProgram, parsed::ParseProgram, ty::TyProgram}; | ||
|
||
/// Contains the lexed, parsed, and typed compilation stages of a program. | ||
pub struct Programs { | ||
pub lexed: LexedProgram, | ||
pub parsed: ParseProgram, | ||
pub typed: Option<TyProgram>, | ||
} | ||
|
||
impl Programs { | ||
pub fn new(lexed: LexedProgram, parsed: ParseProgram, typed: Option<TyProgram>) -> Programs { | ||
Programs { | ||
lexed, | ||
parsed, | ||
typed, | ||
} | ||
} | ||
} |
Oops, something went wrong.