Skip to content

Commit

Permalink
Fixing regression
Browse files Browse the repository at this point in the history
  • Loading branch information
notdanilo committed Nov 5, 2023
1 parent 1619236 commit 69b4e84
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions ecosystem/python/parser/src/types/type_.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@ use rustpython_parser::ast::{ExprName, Expr, ExprSubscript, ExprTuple};
use ligen::{ir::Type, parsing::parser::ParserConfig};
use crate::prelude::*;

#[derive(Default)]
pub struct TypeParser {
mapper: HashMap<String, Type>,
}

impl TypeParser {
pub fn new() -> Self {
impl Default for TypeParser {
fn default() -> Self {
let mapper = HashMap::from([
("bool".into(), Type::boolean()),
("char".into(), Type::character()),
Expand All @@ -22,6 +21,12 @@ impl TypeParser {
}
}

impl TypeParser {
pub fn new() -> Self {
Default::default()
}
}

impl Parser<&ExprName> for TypeParser {
type Output = Type;
fn parse(&self, input: &ExprName, _config: &ParserConfig) -> Result<Self::Output> {
Expand Down

0 comments on commit 69b4e84

Please sign in to comment.