cargo fmt

This commit is contained in:
NotAFile 2022-01-14 15:32:00 +01:00
parent 7a9a54c685
commit 266d3122c4
4 changed files with 6 additions and 8 deletions

View File

@ -11,7 +11,7 @@ fn make_pubid(id: &str) -> String {
#[derive(Debug)] #[derive(Debug)]
pub enum CompileErrorKind { pub enum CompileErrorKind {
UndefinedReference(String), UndefinedReference(String),
BadArgCount{received: usize, expected: usize}, BadArgCount { received: usize, expected: usize },
} }
#[derive(Debug)] #[derive(Debug)]
@ -85,9 +85,10 @@ fn lower_expression(
})?; })?;
if args_resolved.len() != callable.args.len() { if args_resolved.len() != callable.args.len() {
return Err(CompileError::new(CompileErrorKind::BadArgCount{ return Err(CompileError::new(CompileErrorKind::BadArgCount {
expected: callable.args.len(), received: args_resolved.len() expected: callable.args.len(),
})) received: args_resolved.len(),
}));
} }
let cell_id = module.make_genid(&callable.name); let cell_id = module.make_genid(&callable.name);

View File

@ -1,5 +1,3 @@
use nom::{ use nom::{
character::complete::{char, one_of}, character::complete::{char, one_of},
combinator::{map_res, recognize}, combinator::{map_res, recognize},

View File

@ -4,7 +4,6 @@ mod literals;
mod parser; mod parser;
mod rtlil; mod rtlil;
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

@ -8,7 +8,7 @@ use nom::{
sequence::{delimited, pair, preceded, separated_pair, terminated, tuple}, sequence::{delimited, pair, preceded, separated_pair, terminated, tuple},
}; };
use nom_locate::{LocatedSpan}; use nom_locate::LocatedSpan;
// custom span type for nom_locate // custom span type for nom_locate
pub type Span<'a> = LocatedSpan<&'a str>; pub type Span<'a> = LocatedSpan<&'a str>;