remove lints

This commit is contained in:
Janis 2024-08-13 18:55:36 +02:00
parent fe25d226d1
commit 66d08dadcc
5 changed files with 11 additions and 9 deletions

View file

@ -1,4 +1,3 @@
#![allow(unused)]
/// True if `c` is considered a whitespace according to Rust language definition.
/// See [Rust language reference](https://doc.rust-lang.org/reference/whitespace.html)
/// for definitions of these classes.

View file

@ -591,6 +591,7 @@ pub enum Radix {
}
impl Radix {
#[allow(unused)]
/// must be called with one of `['b','x','d','o']`
unsafe fn from_char_unchecked(c: char) -> Self {
match c.to_ascii_lowercase() {
@ -610,6 +611,8 @@ impl Radix {
_ => None,
}
}
#[allow(unused)]
fn radix(self) -> u8 {
match self {
Radix::Hex => 16,

View file

@ -1,5 +1,5 @@
#![feature(extract_if, iter_advance_by, box_into_inner, hash_extract_if)]
#![allow(dead_code, unused_macros)]
#![allow(unused_macros)]
pub mod ast;
pub mod codegen;

View file

@ -3,7 +3,7 @@ use std::collections::HashMap;
use itertools::Itertools;
use crate::{
ast::{FloatingType, IntegralType, LetOrVar, Node, PrimitiveType, Tag, Type},
ast::{FloatingType, IntegralType, LetOrVar, Node, PrimitiveType, Tag},
common::NextIf,
lexer::{Radix, TokenIterator},
symbol_table::{SymbolKind, SymbolTable},
@ -129,6 +129,7 @@ impl Tree {
}
}
#[allow(unused)]
fn is_integral_type(lexeme: &str) -> Option<()> {
let mut iter = lexeme.chars();
iter.next_if(|&c| c == 'u' || c == 'i')?;
@ -758,7 +759,6 @@ impl Tree {
let token = tokens.peek_token_or_err()?;
match token.token() {
Token::Ident => {
// Ok(self.parse_ident(tokens)?)
let ident = tokens.expect_token(Token::Ident)?;
let decl = match self.st.find_symbol(ident.lexeme()) {
@ -898,7 +898,7 @@ impl Tree {
self.get_typename_str(node).unwrap()
)
}
Tag::PointerQualifier { constness } => todo!(),
Tag::PointerQualifier { .. } => todo!(),
Tag::FunctionDecl { proto, body } => {
self.render_node(writer, proto, indent)?;
writeln_indented!(
@ -995,9 +995,9 @@ impl Tree {
writeln!(writer, ");")?;
Ok(())
}
Tag::CallExpr { lhs, rhs } => todo!(),
Tag::ArgumentList { parameters } => todo!(),
Tag::Argument { name, expr } => todo!(),
Tag::CallExpr { .. } => todo!(),
Tag::ArgumentList { .. } => todo!(),
Tag::Argument { .. } => todo!(),
Tag::ExplicitCast { lhs, typename } => {
self.render_node(writer, lhs, indent)?;
writeln_indented!(

View file

@ -1,6 +1,6 @@
#![allow(dead_code)]
use std::{collections::HashMap, marker::PhantomData, num::NonZero};
use std::collections::HashMap;
use crate::{
ast::{FloatingType, IntegralType, Node as AstNode, PrimitiveType, Tag, Type},