This commit is contained in:
Greg Shuflin 2021-11-11 23:44:26 -08:00
parent a31735da88
commit e618498881
2 changed files with 4 additions and 2 deletions

View File

@ -37,8 +37,10 @@ peg::parser! {
__ expr:expression() { StatementKind::Expression(expr) } __ expr:expression() { StatementKind::Expression(expr) }
rule declaration() -> Declaration = rule declaration() -> Declaration =
binding() / type_decl() / annotation() / func() / interface() / implementation() binding() / type_decl() / annotation() / func() / interface() / implementation() / module()
rule module() -> Declaration =
"module" _ name:identifier() _ items:block() { Declaration::Module { name: rc_string(name), items } }
rule implementation() -> Declaration = rule implementation() -> Declaration =
"impl" _ interface:type_singleton_name() _ "for" _ type_name:type_identifier() _ block:decl_block() { "impl" _ interface:type_singleton_name() _ "for" _ type_name:type_identifier() _ block:decl_block() {

View File

@ -1026,7 +1026,7 @@ fn annotations() {
#[test] #[test]
fn modules() { fn modules() {
assert_ast! { assert_ast2! {
r#" r#"
module ephraim { module ephraim {
let mut a = 10 let mut a = 10