Warning cleanup, TODOs

This commit is contained in:
greg 2019-09-10 03:40:41 -07:00
parent 22887678bd
commit 6c3a4f907b
5 changed files with 9 additions and 5 deletions

View File

@ -3,6 +3,7 @@
## General code cleanup
-turn ast reduction into methods-on-struct-returning-result format
-implement and test open/use statements
-implement field access
- standardize on an error type that isn't String
-implement a visitor pattern for the use of scope_resolver

View File

@ -6,11 +6,12 @@ use crate::builtin::Builtin;
#[derive(Debug, PartialEq, Clone)]
pub struct PrefixOp {
pub sigil: Rc<String>,
sigil: Rc<String>,
pub builtin: Option<Builtin>,
}
impl PrefixOp {
#[allow(dead_code)]
pub fn sigil(&self) -> &Rc<String> {
&self.sigil
}

View File

@ -286,7 +286,8 @@ impl<'a> State<'a> {
let evaled_args = evaled_args?;
Ok(match (builtin, evaled_args.as_slice()) {
(FieldAccess, &[Node::PrimObject { ref name, ref tag, ref items }]) => {
(FieldAccess, &[Node::PrimObject { .. }]) => {
//TODO implement field access
unimplemented!()
},
(binop, &[Node::Expr(ref lhs), Node::Expr(ref rhs)]) => match (binop, lhs, rhs) {

View File

@ -16,7 +16,7 @@ use std::rc::Rc;
use std::str::FromStr;
use crate::ast::*;
use crate::symbol_table::{Symbol, SymbolSpec, SymbolTable, ScopeSegment, ScopeSegmentKind, FullyQualifiedSymbolName};
use crate::symbol_table::{Symbol, SymbolSpec, SymbolTable, FullyQualifiedSymbolName};
use crate::builtin::Builtin;
#[derive(Debug)]
@ -194,7 +194,7 @@ fn reduce_lambda(params: &Vec<FormalParam>, body: &Block, symbol_table: &SymbolT
})
}
fn reduce_named_struct(fqsn: Option<&FullyQualifiedSymbolName>, name: &QualifiedName, fields: &Vec<(Rc<String>, Meta<Expression>)>, symbol_table: &SymbolTable) -> Expr {
fn reduce_named_struct(fqsn: Option<&FullyQualifiedSymbolName>, _name: &QualifiedName, fields: &Vec<(Rc<String>, Meta<Expression>)>, symbol_table: &SymbolTable) -> Expr {
let sym_name = match fqsn {
Some(fqsn) => fqsn,
None => return Expr::ReductionError(format!("FQSN lookup for value B failed")),
@ -397,7 +397,7 @@ impl Pattern {
}
impl PatternLiteral {
fn to_subpattern(&self, symbol_table: &SymbolTable) -> Subpattern {
fn to_subpattern(&self, _symbol_table: &SymbolTable) -> Subpattern {
use self::PatternLiteral::*;
match self {
NumPattern { neg, num } => {

View File

@ -37,6 +37,7 @@ impl TypeError {
}
}
#[allow(dead_code)] // avoids warning from Compound
#[derive(Debug, Clone, PartialEq)]
pub enum Type {
Const(TypeConst),