diff --git a/schala-lang/language/src/parsing.rs b/schala-lang/language/src/parsing.rs index 24fcc67..a7d164c 100644 --- a/schala-lang/language/src/parsing.rs +++ b/schala-lang/language/src/parsing.rs @@ -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; diff --git a/schala-lang/language/src/tokenizing.rs b/schala-lang/language/src/tokenizing.rs index f08071d..7939f31 100644 --- a/schala-lang/language/src/tokenizing.rs +++ b/schala-lang/language/src/tokenizing.rs @@ -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, }; }