mirror of
https://github.com/edg-l/edlang.git
synced 2024-11-22 07:58:24 +00:00
readme
This commit is contained in:
parent
2d69bf095a
commit
a6e1a8486d
33
README.md
33
README.md
|
@ -5,31 +5,20 @@ An experimental statically-typed compiled programming language made with LLVM an
|
||||||
Syntax is subject to change any time right now. It has a rusty style for now.
|
Syntax is subject to change any time right now. It has a rusty style for now.
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
struct Hello {
|
mod Main {
|
||||||
x: i32,
|
pub fn main() -> i32 {
|
||||||
y: i32,
|
let b: i32 = factorial(4);
|
||||||
}
|
return b;
|
||||||
|
|
||||||
fn test(x: Hello) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
fn works(x: i64) -> i64 {
|
|
||||||
let z = 0;
|
|
||||||
if 2 == x {
|
|
||||||
z = x * 2;
|
|
||||||
} else {
|
|
||||||
z = x * 3;
|
|
||||||
}
|
}
|
||||||
return z;
|
|
||||||
}
|
|
||||||
|
|
||||||
fn main() -> i64 {
|
pub fn factorial(n: i32) -> i32 {
|
||||||
let y: i64 = 2;
|
if n == 1 {
|
||||||
let z = y;
|
return n;
|
||||||
return works(z);
|
} else {
|
||||||
|
return n * factorial(n - 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Dependencies
|
## Dependencies
|
||||||
|
|
Loading…
Reference in a new issue