mirror of
https://github.com/PashaBibko/LX.git
synced 2026-04-03 17:39:02 +00:00
Updated README
This commit is contained in:
43
README.md
43
README.md
@@ -2,12 +2,47 @@
|
||||
|
||||
This is my custom compiled language written in C++ based off of the LLVM toolchain. Do not use the language in it's current state unless you are insane.
|
||||
|
||||
## Build
|
||||
|
||||
Requires VS-22 with C++ and C# development to be downloaded. Run LX-Compiler.sln and run the project. Currently it defaults to using the source file example/main.ll but that can be modified in Main.cs
|
||||
|
||||
## Syntax
|
||||
|
||||
#### Comments
|
||||
|
||||
```
|
||||
# Comments start and end with hashtags #
|
||||
```
|
||||
|
||||
#### Variables
|
||||
|
||||
```
|
||||
int a # Declares an unitialised integer (currently the only type) #
|
||||
int b = 5 # Declares integer with a value of 5 #
|
||||
```
|
||||
|
||||
#### Operations
|
||||
```
|
||||
# Currently only the basic maths operations are implemented #
|
||||
int c = 1 + 2 - 3 / 4 * 5
|
||||
```
|
||||
|
||||
#### Functions
|
||||
```
|
||||
# All functions return int #
|
||||
func add(int a, int b)
|
||||
{
|
||||
return a + b
|
||||
}
|
||||
```
|
||||
|
||||
## Features
|
||||
|
||||
### Planned features (in order)
|
||||
- Operations (Maths + BinOp)
|
||||
- Functions
|
||||
- More than just int as a type
|
||||
- References / Pointers
|
||||
- More than just int as a type (float, uint, double, char)
|
||||
- References and pointers
|
||||
- Structs / Classes (Polymorphism + vtables)
|
||||
- String and string manipulation (needs classes)
|
||||
|
||||
### Codebase
|
||||
- New features
|
||||
|
||||
@@ -3,19 +3,11 @@ func add(int a, int b)
|
||||
return a + b
|
||||
}
|
||||
|
||||
func sub(int c, int d)
|
||||
{
|
||||
return add(c, 0 - d)
|
||||
}
|
||||
|
||||
func mul(int e, int f)
|
||||
{
|
||||
return e * f
|
||||
}
|
||||
|
||||
func main()
|
||||
{
|
||||
int g = mul(add(7, 5), sub(5, 3))
|
||||
int c = add(1, 2)
|
||||
|
||||
return g
|
||||
# Test int
|
||||
|
||||
return c
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user