dict: add type_from_str

This commit is contained in:
Michael Sippel 2023-10-02 02:00:47 +02:00
parent da899192f5
commit 601327f602
Signed by: senvas
GPG key ID: F96CF119C34B64A6

View file

@ -33,6 +33,10 @@ impl std::str::FromStr for TypeTerm {
//<<<<>>>><<>><><<>><<<*>>><<>><><<>><<<<>>>>\\
impl TypeDict {
pub fn type_from_str(&mut self, s: &str) -> Result<TypeTerm, ParseError> {
self.parse(&mut LadderTypeLexer::from(s.chars()).peekable())
}
fn parse_app<It>( &mut self, tokens: &mut Peekable<LadderTypeLexer<It>> ) -> Result<TypeTerm, ParseError>
where It: Iterator<Item = char>
{