From d3ebcc965437ed9bc506144ac19d31bbdd3b4757 Mon Sep 17 00:00:00 2001 From: Greg Shuflin Date: Wed, 13 Oct 2021 00:53:32 -0700 Subject: [PATCH] Fix all current warnings --- schala-lang/language/src/ast.rs | 2 ++ schala-lang/language/src/eval.rs | 4 ++-- schala-lang/language/src/reduced_ast.rs | 1 - schala-lang/language/src/schala.rs | 1 + schala-lang/language/src/symbol_table.rs | 2 ++ 5 files changed, 7 insertions(+), 3 deletions(-) diff --git a/schala-lang/language/src/ast.rs b/schala-lang/language/src/ast.rs index b1cc40f..1d9e6aa 100644 --- a/schala-lang/language/src/ast.rs +++ b/schala-lang/language/src/ast.rs @@ -152,9 +152,11 @@ impl Expression { Expression { id, kind, type_anno: None } } + /* - commented out because unused pub fn with_anno(id: ItemId, kind: ExpressionKind, type_anno: TypeIdentifier) -> Expression { Expression { id, kind, type_anno: Some(type_anno) } } + */ } #[derive(Debug, PartialEq, Clone)] diff --git a/schala-lang/language/src/eval.rs b/schala-lang/language/src/eval.rs index 3f52292..d6cba0e 100644 --- a/schala-lang/language/src/eval.rs +++ b/schala-lang/language/src/eval.rs @@ -2,10 +2,10 @@ use std::rc::Rc; use std::fmt::Write; use std::io; -use crate::schala::SymbolTableHandle; +//use crate::schala::SymbolTableHandle; use crate::util::ScopeStack; use crate::reduced_ast::{BoundVars, ReducedAST, Stmt, Expr, Lit, Func, Alternative, Subpattern}; -use crate::symbol_table::{SymbolSpec, Symbol, SymbolTable, FullyQualifiedSymbolName}; +//use crate::symbol_table::{SymbolSpec, Symbol, SymbolTable, FullyQualifiedSymbolName}; use crate::builtin::Builtin; mod test; diff --git a/schala-lang/language/src/reduced_ast.rs b/schala-lang/language/src/reduced_ast.rs index 37a3fd0..839ef3c 100644 --- a/schala-lang/language/src/reduced_ast.rs +++ b/schala-lang/language/src/reduced_ast.rs @@ -155,7 +155,6 @@ impl<'a> Reducer<'a> { fn expression(&mut self, expr: &Expression) -> Expr { use crate::ast::ExpressionKind::*; - let symbol_table = self.symbol_table; let ref input = expr.kind; match input { NatLiteral(n) => Expr::Lit(Lit::Nat(*n)), diff --git a/schala-lang/language/src/schala.rs b/schala-lang/language/src/schala.rs index ae6466e..115db4a 100644 --- a/schala-lang/language/src/schala.rs +++ b/schala-lang/language/src/schala.rs @@ -18,6 +18,7 @@ pub type SourceMapHandle = Rc>; /// All the state necessary to parse and execute a Schala program are stored in this struct. /// `state` represents the execution state for the AST-walking interpreter, the other fields /// should be self-explanatory. +#[allow(dead_code)] pub struct Schala { source_reference: SourceReference, source_map: SourceMapHandle, diff --git a/schala-lang/language/src/symbol_table.rs b/schala-lang/language/src/symbol_table.rs index 0eb9a0e..ff0efb9 100644 --- a/schala-lang/language/src/symbol_table.rs +++ b/schala-lang/language/src/symbol_table.rs @@ -84,6 +84,7 @@ impl fmt::Display for ScopeSegment { } impl ScopeSegment { + #[allow(dead_code)] pub fn new(name: Rc) -> ScopeSegment { ScopeSegment { name } } @@ -134,6 +135,7 @@ impl SymbolTable { } } +#[allow(dead_code)] #[derive(Debug)] pub struct Symbol { pub local_name: Rc, //TODO does this need to be pub?