clippy fix

This commit is contained in:
NotAFile 2022-01-16 22:10:52 +01:00
parent c2628102cc
commit b8c7d501f6
5 changed files with 18 additions and 20 deletions

View File

@ -140,7 +140,7 @@ pub fn lower_module(pa_module: parser::Module) -> Result<String, CompileError> {
parser::ModuleItem::Assign(assignment) => { parser::ModuleItem::Assign(assignment) => {
lower_assignment(&context, &mut ir_module, assignment)? lower_assignment(&context, &mut ir_module, assignment)?
} }
parser::ModuleItem::Proc(proc) => todo!("lowering process"), parser::ModuleItem::Proc(_proc) => todo!("lowering process"),
} }
} }
ir_module.write_rtlil(&mut writer); ir_module.write_rtlil(&mut writer);

View File

@ -4,7 +4,7 @@ mod literals;
mod parser; mod parser;
mod rtlil; mod rtlil;
use nom::error::convert_error;
use std::fs::File; use std::fs::File;
use std::io::prelude::*; use std::io::prelude::*;
use std::path::PathBuf; use std::path::PathBuf;

View File

@ -5,9 +5,9 @@ use nom::{
branch::alt, branch::alt,
bytes::complete::tag, bytes::complete::tag,
character::complete::{alpha1, alphanumeric1, char, multispace0, multispace1, u64 as decimal}, character::complete::{alpha1, alphanumeric1, char, multispace0, multispace1, u64 as decimal},
combinator::{consumed, map, opt, recognize}, combinator::{map, opt, recognize},
error::{context, ParseError, VerboseError}, error::{context, ParseError, VerboseError},
multi::{many0, many1, separated_list0}, multi::{many0, separated_list0},
sequence::{delimited, pair, preceded, separated_pair, terminated, tuple}, sequence::{delimited, pair, preceded, separated_pair, terminated, tuple},
}; };

View File

@ -1,17 +1,16 @@
use nom::{ use nom::{
branch::alt, branch::alt,
bytes::complete::tag, bytes::complete::tag,
character::complete::{alpha1, alphanumeric1, char, multispace0, multispace1, u64 as decimal}, character::complete::char,
combinator::{consumed, map, opt, recognize}, combinator::{consumed, map},
error::{context, ParseError, VerboseError}, error::context,
multi::{many0, many1, separated_list0}, multi::{many1, separated_list0},
sequence::{delimited, pair, preceded, separated_pair, terminated, tuple}, sequence::{delimited, tuple},
}; };
use crate::parser::proc::{proc_block, ProcBlock};
use crate::parser::{ use crate::parser::{
assign_statement, declaration, identifier, intliteral, widthspec, ws0, Assign, IResult, assign_statement, declaration, identifier, ws0, Assign, IResult,
NetDecl, Span, NetDecl, Span, proc::{proc_block, ProcBlock},
}; };
#[derive(Debug)] #[derive(Debug)]
@ -63,8 +62,8 @@ fn ports_list(input: Span) -> IResult<Span, Vec<PortDecl>> {
fn module_item(input: Span) -> IResult<Span, ModuleItem> { fn module_item(input: Span) -> IResult<Span, ModuleItem> {
alt(( alt((
map(assign_statement, |assig| ModuleItem::Assign(assig)), map(assign_statement, ModuleItem::Assign),
map(proc_block, |proc| ModuleItem::Proc(proc)), map(proc_block, ModuleItem::Proc),
))(input) ))(input)
} }

View File

@ -1,11 +1,10 @@
use nom::{ use nom::{
branch::alt,
bytes::complete::tag, bytes::complete::tag,
character::complete::{alpha1, alphanumeric1, char, multispace0, multispace1, u64 as decimal}, character::complete::char,
combinator::{consumed, map, opt, recognize}, combinator::map,
error::{context, ParseError, VerboseError}, error::context,
multi::{many0, many1, separated_list0}, multi::many0,
sequence::{delimited, pair, preceded, separated_pair, terminated, tuple}, sequence::{delimited, tuple},
}; };
use crate::parser::{identifier, ws0, Expression, IResult, Span}; use crate::parser::{identifier, ws0, Expression, IResult, Span};