Modules
This commit is contained in:
parent
a31735da88
commit
e618498881
@ -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() {
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user