Start adding import keyword

This commit is contained in:
greg 2019-09-20 18:19:29 -07:00
parent 06026604cc
commit 603ea89b98
2 changed files with 7 additions and 4 deletions

View File

@ -13,7 +13,7 @@
//! ```text
//! program := (statement delimiter)* EOF
//! delimiter := NEWLINE | ";"
//! statement := expression | declaration
//! statement := expression | declaration | import
//! block := "{" (statement delimiter)* "}"
//! declaration := type_declaration | func_declaration | binding_declaration | impl_declaration
//! ```
@ -141,8 +141,10 @@
//! enumerators := enumerator ("," enumerators)*
//! enumerator := identifier "<-" expression | identifier "=" expression //TODO add guards, etc.
//! ```
//!
//! ## Imports
//! ```text
//! import := 'import'
//! ```
mod test;
use std::rc::Rc;

View File

@ -55,7 +55,7 @@ pub enum Kw {
Alias, Type, SelfType, SelfIdent,
Interface, Impl,
True, False,
Module
Module, Import
}
lazy_static! {
@ -82,6 +82,7 @@ lazy_static! {
"true" => Kw::True,
"false" => Kw::False,
"module" => Kw::Module,
"import" => Kw::Import,
};
}