feat: remove check assignment
This commit is contained in:
parent
21251d6499
commit
88ce8ba8b9
|
@ -769,7 +769,6 @@ impl<A, B> Pattern<A, B> {
|
|||
pub enum AssignmentKind {
|
||||
Let,
|
||||
Assert,
|
||||
Check,
|
||||
}
|
||||
|
||||
pub type MultiPattern<PatternConstructor, Type> = Vec<Pattern<PatternConstructor, Type>>;
|
||||
|
|
|
@ -607,7 +607,6 @@ impl<'comments> Formatter<'comments> {
|
|||
let keyword = match kind {
|
||||
Some(AssignmentKind::Let) => "let ",
|
||||
Some(AssignmentKind::Assert) => "assert ",
|
||||
Some(AssignmentKind::Check) => "check ",
|
||||
None => "try ",
|
||||
};
|
||||
|
||||
|
|
|
@ -1043,21 +1043,6 @@ pub fn expr_parser(
|
|||
},
|
||||
);
|
||||
|
||||
let check_parser = just(Token::Check)
|
||||
.ignore_then(pattern_parser())
|
||||
.then(just(Token::Colon).ignore_then(type_parser()).or_not())
|
||||
.then_ignore(just(Token::Equal))
|
||||
.then(r.clone())
|
||||
.map_with_span(
|
||||
|((pattern, annotation), value), span| expr::UntypedExpr::Assignment {
|
||||
location: span,
|
||||
value: Box::new(value),
|
||||
pattern,
|
||||
kind: ast::AssignmentKind::Check,
|
||||
annotation,
|
||||
},
|
||||
);
|
||||
|
||||
let if_parser = just(Token::If)
|
||||
.ignore_then(r.clone().then(block_parser.clone()).map_with_span(
|
||||
|(condition, body), span| ast::IfBranch {
|
||||
|
@ -1109,7 +1094,6 @@ pub fn expr_parser(
|
|||
when_parser,
|
||||
let_parser,
|
||||
assert_parser,
|
||||
check_parser,
|
||||
if_parser,
|
||||
));
|
||||
|
||||
|
|
|
@ -61,7 +61,6 @@ pub enum Token {
|
|||
// Keywords (alphabetically):
|
||||
As,
|
||||
Assert,
|
||||
Check,
|
||||
Const,
|
||||
Fn,
|
||||
If,
|
||||
|
@ -142,7 +141,6 @@ impl fmt::Display for Token {
|
|||
Token::NewLine => "NEWLINE",
|
||||
Token::As => "as",
|
||||
Token::Assert => "assert",
|
||||
Token::Check => "check",
|
||||
Token::When => "when",
|
||||
Token::Is => "is",
|
||||
Token::Const => "const",
|
||||
|
|
|
@ -513,7 +513,6 @@ fn str_to_keyword(word: &str) -> Option<Token> {
|
|||
match word {
|
||||
"as" => Some(Token::As),
|
||||
"assert" => Some(Token::Assert),
|
||||
"check" => Some(Token::Check),
|
||||
"when" => Some(Token::When),
|
||||
"const" => Some(Token::Const),
|
||||
"fn" => Some(Token::Fn),
|
||||
|
|
Loading…
Reference in New Issue