-
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.
Add typesafety for module validation
Now modules (and the appropriate items in modules) have a `ValidatedState` parameter, which is set to `Validated` after running through the validation algorithm.
- Loading branch information
Showing
13 changed files
with
183 additions
and
145 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
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 |
---|---|---|
@@ -1,20 +1,19 @@ | ||
use { | ||
super::{error::Result, BinaryParser, ParserReader}, | ||
crate::{binary::read_with_location::Locate, pctx}, | ||
wrausmt_runtime::syntax::{Resolved, StartField}, | ||
wrausmt_runtime::syntax::{Resolved, StartField, Unvalidated}, | ||
}; | ||
|
||
/// Read the tables section of a binary module from a std::io::Read. | ||
impl<R: ParserReader> BinaryParser<R> { | ||
/// Read a funcs section. This is just a vec(TypeIndex). | ||
/// The values here don't correspond to a real module section, instead they | ||
/// correlate with the rest of the function data in the code section. | ||
pub(in crate::binary) fn read_start_section(&mut self) -> Result<StartField<Resolved>> { | ||
pub(in crate::binary) fn read_start_section( | ||
&mut self, | ||
) -> Result<StartField<Resolved, Unvalidated>> { | ||
pctx!(self, "read start"); | ||
let location = self.location(); | ||
Ok(StartField { | ||
idx: self.read_index_use()?, | ||
location, | ||
}) | ||
Ok(StartField::new(self.read_index_use()?, location)) | ||
} | ||
} |
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
Oops, something went wrong.