| Build | Status |
| :---: | :----: |
| Travis-CI | |
Use off-side syntax (indent instead of braces, like in Python) to write Rust!
Disclaimer: implementing a different standard of the language is apparently not a good idea. This project is just a proof of concept for fun.
Off-side rule means that a computer language uses indents instead of using {}
braces to distinguish
code hierarchy. Well-known examples include YAML (a data serialization language), Python (a programming language) and
PugJS (a JavaScript markup preprocessor language).
```rust
extern crate off_side;
use std::io::{Error, ErrorKind};
off_side! {
fn try_int(i: i32) -> Result
fn main(): for i in 0..2: let result = tryint(i); let num = match result:; Ok(i) => i, Err(err) => err.rawoserror().unwrapor_else(|| 3), println!("num: {}", num);
} ```
indent-stack
crate.proc_macro
limitations, all indent characters are considered the same.
In other words, if you mix tabs and spaces, tabs will be considered as one space./* */
before line start. They might be considered as spaces as well.:
.let
statements with match
or if
/else
),
end the parent line with :;
.This library is a proof of concept and just for fun. Not recommended for use in production or in publicly published crates.