Skip to content
Snippets Groups Projects
Commit 3f81d391 authored by Per Lindgren's avatar Per Lindgren
Browse files

move to new syntax, wip4

parent 69db278f
Branches
No related tags found
No related merge requests found
fn main() { fn main() {
{}
a; a;
} }
...@@ -155,29 +155,15 @@ pub Block: Stmts = { ...@@ -155,29 +155,15 @@ pub Block: Stmts = {
StmtSeq: Stmt = { StmtSeq: Stmt = {
<Stmt> ";" => <>, <Stmt> ";" => <>,
StmtBlock => panic!(), StmtBlock => Stmt::Block(<>),
} }
StmtBlock: Stmts = { StmtBlock: Stmts = {
"while" Expr Block => panic!(), "while" Expr Block => panic!(),
"if" Expr Block ("else" Block)? => panic!(), "if" Expr Block ("else" Block)? => panic!(),
Block => panic!(), Block,
} }
// Stmt: Stmt = {
// ";" => Stmt::Semi,
// "let" "mut"? Id "=" Expr ";" => (),
// ExprNoBlock "=" Expr => (),
// "while" Expr Block => (),
// "if" Expr Block ("else" Block)? => (),
// ExprNoBlock => (),
// Block => (),
// }
Stmt: Stmt = { Stmt: Stmt = {
";" => Stmt::Semi, ";" => Stmt::Semi,
//"let" <m: "mut"?> <id: Id> <t: (":" <Type>)?> <e: ("=" <Expr>)?> => Stmt::Let(id, m.is_some(), t, e), //"let" <m: "mut"?> <id: Id> <t: (":" <Type>)?> <e: ("=" <Expr>)?> => Stmt::Let(id, m.is_some(), t, e),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment