diff --git a/README.md b/README.md index ec14e4f..a62097b 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,12 @@ Main repo: https://git.sudoer.ch/me/really-bad-compiler-in-haskell - Use `stack run ` to run the program (for example, `stack run example/1.hear`). - The LLVM will be generated as `a.out.ll`, and the executable will be generated as `a.out`. +## Currently Supported functionality + +- Arithmetic +- Parenthesis +- print() statement + ## To edit I recommend using VSCodium, which is preconfigured to have syntax highlighting and (currently broken) debugging features and will automatically suggest the Haskell extensions to install. diff --git a/really-bad-compiler-in-haskell.cabal b/really-bad-compiler-in-haskell.cabal index 31bd2b4..7e52a66 100644 --- a/really-bad-compiler-in-haskell.cabal +++ b/really-bad-compiler-in-haskell.cabal @@ -18,7 +18,7 @@ executable really-bad-compiler-in-haskell other-modules: Main.LLVMGen Main.Parser.Megaparsec - Main.Types.Expr + Main.Type Paths_really_bad_compiler_in_haskell hs-source-dirs: src diff --git a/src/Main/LLVMGen.hs b/src/Main/LLVMGen.hs index 0032b14..8394fb7 100644 --- a/src/Main/LLVMGen.hs +++ b/src/Main/LLVMGen.hs @@ -22,7 +22,7 @@ import LLVM.IRBuilder.Constant import LLVM.IRBuilder.Instruction import LLVM.IRBuilder.Module import LLVM.IRBuilder.Monad -import Main.Types.Expr as Expr +import Main.Type as Expr data Env = Env { operands :: M.Map Text Operand, diff --git a/src/Main/Parser/Megaparsec.hs b/src/Main/Parser/Megaparsec.hs index 33543de..9435ca0 100644 --- a/src/Main/Parser/Megaparsec.hs +++ b/src/Main/Parser/Megaparsec.hs @@ -8,7 +8,7 @@ import Control.Monad.Combinators.Expr import Data.Functor.Identity qualified import Data.Text import Data.Void (Void) -import Main.Types.Expr +import Main.Type import Text.Megaparsec as MP hiding (parse) import Text.Megaparsec qualified as MP import Text.Megaparsec.Char qualified as C diff --git a/src/Main/Types/Expr.hs b/src/Main/Type.hs similarity index 76% rename from src/Main/Types/Expr.hs rename to src/Main/Type.hs index c91cfb7..1c38360 100644 --- a/src/Main/Types/Expr.hs +++ b/src/Main/Type.hs @@ -1,4 +1,4 @@ -module Main.Types.Expr (Expr (..)) where +module Main.Type (Expr (..)) where data Expr = Lit Int