From 601327f6024478b715df63b66546925f65731265 Mon Sep 17 00:00:00 2001 From: Michael Sippel <micha@fragmental.art> Date: Mon, 2 Oct 2023 02:00:47 +0200 Subject: [PATCH] dict: add type_from_str --- src/parser.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/parser.rs b/src/parser.rs index 1b996bf..e2c91f1 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -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> {