Fixed self and added tests back

This commit is contained in:
2026-05-21 08:09:26 +02:00
parent 7688599504
commit 702af9da3b
8 changed files with 228 additions and 18 deletions
+1 -2
View File
@@ -29,7 +29,6 @@ keyword = {
| "true"
| "false"
| "dyn"
| "self"
}
identifier = @{
@@ -343,7 +342,7 @@ block = {
}
statement_list = {
(statement | (!expr ~ unexpected_statement))*
(statement | (unexpected_statement))*
}
statement = _{
+1 -1
View File
@@ -78,7 +78,7 @@ impl<'a> TryFrom<pest::iterators::Pair<'a, Rule>> for Expression {
Rule::static_path => ast_expr!(Expression::Path(pair.try_into())),
Rule::literal => ast_expr!(Expression::Literal(pair.try_into())),
Rule::expr_path => ast_expr!(Expression::Path(pair.try_into())),
Rule::statement | Rule::basic_stmt | Rule::control_flow => ast_expr!(
Rule::statement | Rule::basic_stmt | Rule::control_flow | Rule::unexpected_statement => ast_expr!(
Expression::Statement(pair.try_into().get_map(Box::new).map(Box::new))
),