tests compile, 15 fail

This commit is contained in:
greg 2019-09-06 02:30:18 -07:00
parent 44c073320b
commit 2b5b1589b0
2 changed files with 8 additions and 7 deletions

View File

@ -955,8 +955,7 @@ impl Parser {
#[recursive_descent_method]
fn pattern_literal(&mut self) -> ParseResult<Pattern> {
let tok = self.token_handler.peek();
let kind = tok.kind.clone();
Ok(match kind {
Ok(match tok.get_kind() {
Keyword(Kw::True) => {
self.token_handler.next();
Pattern::Literal(PatternLiteral::BoolPattern(true))

View File

@ -596,7 +596,8 @@ fn patterns() {
"if x is Some(a) then { 4 } else { 9 }", exst!(
IfExpression {
discriminator: bx!(Discriminator::Simple(Meta::new(ex!(s "x")))),
body: bx!(IfExpressionBody::SimplePatternMatch(Pattern::TupleStruct(rc!(Some), vec![Pattern::Literal(PatternLiteral::VarPattern(rc!(a)))]), vec![exst!(s "4")], Some(vec![exst!(s "9")]))) }
body: bx!(IfExpressionBody::SimplePatternMatch(Pattern::TupleStruct(QualifiedName(vec![rc!(Some)]),
vec![Pattern::VarOrName(QualifiedName(vec![rc!(a)]))]), vec![exst!(s "4")], Some(vec![exst!(s "9")]))) }
)
}
@ -604,7 +605,8 @@ fn patterns() {
"if x is Some(a) then 4 else 9", exst!(
IfExpression {
discriminator: bx!(Discriminator::Simple(Meta::new(ex!(s "x")))),
body: bx!(IfExpressionBody::SimplePatternMatch(Pattern::TupleStruct(rc!(Some), vec![Pattern::Literal(PatternLiteral::VarPattern(rc!(a)))]), vec![exst!(s "4")], Some(vec![exst!(s "9")]))) }
body: bx!(IfExpressionBody::SimplePatternMatch(Pattern::TupleStruct(QualifiedName(vec![rc!(Some)]),
vec![Pattern::VarOrName(QualifiedName(vec![rc!(a)]))]), vec![exst!(s "4")], Some(vec![exst!(s "9")]))) }
)
}
@ -613,11 +615,11 @@ fn patterns() {
IfExpression {
discriminator: bx!(Discriminator::Simple(Meta::new(ex!(s "x")))),
body: bx!(IfExpressionBody::SimplePatternMatch(
Pattern::Record(rc!(Something), vec![
Pattern::Record(QualifiedName(vec![rc!(Something)]), vec![
(rc!(a),Pattern::Literal(PatternLiteral::StringPattern(rc!(a)))),
(rc!(b),Pattern::Literal(PatternLiteral::VarPattern(rc!(x))))
(rc!(b),Pattern::VarOrName(QualifiedName(vec![rc!(x)])))
]),
vec![exst!(s "4")], Some(vec![exst!(s "9")])))
vec![exst!(s "4")], Some(vec![exst!(s "9")])))
}
)
}