Fixed test

This commit is contained in:
greg 2018-07-13 20:04:52 -07:00
parent 5a91957fa1
commit 21a8868bcf
2 changed files with 4 additions and 4 deletions

View File

@ -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))]))) }
)
])
}

View File

@ -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<String>;
type TypeResult<T> = Result<T, String>;