Modules
This commit is contained in:
parent
a31735da88
commit
e618498881
@ -37,8 +37,10 @@ peg::parser! {
|
||||
__ expr:expression() { StatementKind::Expression(expr) }
|
||||
|
||||
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 =
|
||||
"impl" _ interface:type_singleton_name() _ "for" _ type_name:type_identifier() _ block:decl_block() {
|
||||
|
@ -1026,7 +1026,7 @@ fn annotations() {
|
||||
|
||||
#[test]
|
||||
fn modules() {
|
||||
assert_ast! {
|
||||
assert_ast2! {
|
||||
r#"
|
||||
module ephraim {
|
||||
let mut a = 10
|
||||
|
Loading…
Reference in New Issue
Block a user