From 21a8868bcf8383638519998bf5a71f0adf80d2b3 Mon Sep 17 00:00:00 2001 From: greg Date: Fri, 13 Jul 2018 20:04:52 -0700 Subject: [PATCH] Fixed test --- schala-lang/src/parsing.rs | 6 +++--- schala-lang/src/typechecking.rs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/schala-lang/src/parsing.rs b/schala-lang/src/parsing.rs index 4923b5d..7b6c336 100644 --- a/schala-lang/src/parsing.rs +++ b/schala-lang/src/parsing.rs @@ -971,7 +971,7 @@ mod parse_tests { use ::std::rc::Rc; use super::{parse, tokenize}; use builtin::{PrefixOp, BinOp}; - use ast::{AST, Expression, Statement, IfExpressionBody, Discriminator, Pattern, TypeBody, Variant, Enumerator, ForBody}; + use ast::{AST, Expression, Statement, IfExpressionBody, Discriminator, Pattern, PatternLiteral, TypeBody, Variant, Enumerator, ForBody}; use super::Statement::*; use super::Declaration::*; use super::Signature; @@ -1407,8 +1407,8 @@ fn a(x) { "if x is Some(a) then { 4 } else { 9 }", AST(vec![ exprstatement!( IfExpression { - discriminator: Discriminator::Simple(ex!(Value("x"))), - body: SimplePatternMatch(TupleStruct("Some", [Literal(VarPattern("a"))]), [ExpressionStatement(Expression(NatLiteral(4), None))], Some([ExpressionStatement(Expression(NatLiteral(9), None))])) } + discriminator: bx!(Discriminator::Simple(ex!(Value(rc!(x))))), + body: bx!(IfExpressionBody::SimplePatternMatch(Pattern::TupleStruct(rc!(Some), vec![Pattern::Literal(PatternLiteral::VarPattern(rc!(a)))]), vec![exprstatement!(NatLiteral(4))], Some(vec![exprstatement!(NatLiteral(9))]))) } ) ]) } diff --git a/schala-lang/src/typechecking.rs b/schala-lang/src/typechecking.rs index d42bb0f..a25c8d3 100644 --- a/schala-lang/src/typechecking.rs +++ b/schala-lang/src/typechecking.rs @@ -11,7 +11,7 @@ use itertools::Itertools; use ast; use util::StateStack; -use symbol_table::{SymbolSpec, Symbol, SymbolTable}; +use symbol_table::{SymbolSpec, SymbolTable}; pub type TypeName = Rc; type TypeResult = Result;