mirror of
https://github.com/microsoft/regorus.git
synced 2026-08-05 02:16:11 +00:00
Handle else block without body (#155)
Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
This commit is contained in:
committed by
GitHub
parent
10f2caf0c0
commit
f51731e584
@@ -1426,7 +1426,21 @@ impl<'source> Parser<'source> {
|
||||
"expected assignment or query after `else`",
|
||||
));
|
||||
}
|
||||
_ => break,
|
||||
_ => {
|
||||
let mut query_span = span.clone();
|
||||
query_span.end = query_span.start;
|
||||
let query = Ref::new(Query {
|
||||
span: query_span,
|
||||
stmts: vec![],
|
||||
});
|
||||
span.end = self.end;
|
||||
bodies.push(RuleBody {
|
||||
span,
|
||||
assign,
|
||||
query,
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
|
||||
Reference in New Issue
Block a user