From 9bbac9e8de6d398d3fc31dd10aaf886cc60712d4 Mon Sep 17 00:00:00 2001 From: Pasha Bibko <156938226+PashaBibko@users.noreply.github.com> Date: Sun, 11 May 2025 15:38:59 +0100 Subject: [PATCH] Updated README --- README.md | 43 +++++++++++++++++++++++++++++++++++++++---- example/main.lx | 16 ++++------------ 2 files changed, 43 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 59ab556..b064a03 100644 --- a/README.md +++ b/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 diff --git a/example/main.lx b/example/main.lx index 435e457..b71591a 100644 --- a/example/main.lx +++ b/example/main.lx @@ -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 }