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. /// True if `c` is considered a whitespace according to Rust language definition.
/// See [Rust language reference](https://doc.rust-lang.org/reference/whitespace.html) /// See [Rust language reference](https://doc.rust-lang.org/reference/whitespace.html)
/// for definitions of these classes. /// for definitions of these classes.

View file

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

View file

@ -1,5 +1,5 @@
#![feature(extract_if, iter_advance_by, box_into_inner, hash_extract_if)] #![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 ast;
pub mod codegen; pub mod codegen;

View file

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

View file

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