1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
//! # Overview
//!
//! `zypo-rs` is the official reference compiler for the Zypo programming language.
//!
//! # Objectives
//!
//! - Python inter-compatibility
//! - Compiler portability (lightweight)
//! - Fast compile speeds + optimizations
//! - Markdown-friendly language (compiler logs and docstrings are markdown)
//!
//! # Installing
//! 
//! ## Pre-built binaries
//! 
//! A pre-built binary file for common Linux-based operating systems are
//! available as job artifacts in the main repository. You can find the recently
//! updated builds [here](https://gitlab.com/Owez/zypo-rs/pipelines?scope=branches).
//!
//! ## Building from source
//! 
//! 1. [Install](https://www.rust-lang.org/tools/install) Rust if you have not
//! already.
//! 2. Clone the repository: `git clone https://gitlab.com/zypo/zypo-rs/`
//! 3. Build the compiler: `cargo build --release`.
//! 4. Get the resulting standalone binary: `mv ./target/release/zypo-rs zypo-rs`
//! 5. Run the binary: `./zypo-rs` *(NOTE: this depends on your operating
//! system)*
//!
//! # Language syntax
//!
//! 2 simple functions:
//!
//! ```zypo
//! fun hello(other_int: int) {
//!     if (other_int == 5) {
//!         var x: int = 24;
//!
//!         while(x / other_int != 2) {
//!             --snip--
//!         }
//!     }
//!
//!     var result: str = "hello";
//! }
//!
//! fun mul_x(first: int, second: int) -> bool {
//!     return first * second ==  6;
//! }
//! ```

#[macro_use]
extern crate lalrpop_util;

pub mod cli;
pub mod parser;