tests compile, 15 fail
This commit is contained in:
parent
44c073320b
commit
2b5b1589b0
@ -955,8 +955,7 @@ impl Parser {
|
|||||||
#[recursive_descent_method]
|
#[recursive_descent_method]
|
||||||
fn pattern_literal(&mut self) -> ParseResult<Pattern> {
|
fn pattern_literal(&mut self) -> ParseResult<Pattern> {
|
||||||
let tok = self.token_handler.peek();
|
let tok = self.token_handler.peek();
|
||||||
let kind = tok.kind.clone();
|
Ok(match tok.get_kind() {
|
||||||
Ok(match kind {
|
|
||||||
Keyword(Kw::True) => {
|
Keyword(Kw::True) => {
|
||||||
self.token_handler.next();
|
self.token_handler.next();
|
||||||
Pattern::Literal(PatternLiteral::BoolPattern(true))
|
Pattern::Literal(PatternLiteral::BoolPattern(true))
|
||||||
|
@ -596,7 +596,8 @@ fn patterns() {
|
|||||||
"if x is Some(a) then { 4 } else { 9 }", exst!(
|
"if x is Some(a) then { 4 } else { 9 }", exst!(
|
||||||
IfExpression {
|
IfExpression {
|
||||||
discriminator: bx!(Discriminator::Simple(Meta::new(ex!(s "x")))),
|
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!(
|
"if x is Some(a) then 4 else 9", exst!(
|
||||||
IfExpression {
|
IfExpression {
|
||||||
discriminator: bx!(Discriminator::Simple(Meta::new(ex!(s "x")))),
|
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 {
|
IfExpression {
|
||||||
discriminator: bx!(Discriminator::Simple(Meta::new(ex!(s "x")))),
|
discriminator: bx!(Discriminator::Simple(Meta::new(ex!(s "x")))),
|
||||||
body: bx!(IfExpressionBody::SimplePatternMatch(
|
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!(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")])))
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user