A programming language made in C
Fang stands for "Feline Language". In hopes of it being cool like a cat!
On top of it, you can byte with fang!
Added a bunch of operators to the lexer
// variables
x: i32;
// functions
functionName(): i32 {
....
}
// if statement
(x>3)? {
....
}: {
....
}
// else if
(x>3)? {
....
}:(!x)? {
....
}
// match or switch
(x)? {
1: 5,
2: 3,
_: 1
}
The file extentions for the source code is
.fang
Statement | Syntax | Example |
---|---|---|
Comment | // text |
// comment |
Variables | varName: type |
x: i32 |
Functions | func(): type |
func(): i32 {} |
If and else statements | (conditional)? {}: {} |
(x>5)? {} |
Switch statements | (variable)? {cmp: statement, _: defaultStatement} |
(x)? {1: print(1), 2: print(2), _: print("Default")} |
- Lexer
- Parser
- Semantic analyzer