Move Expr to Type.hs

pull/25/head
Ethan Reece 2023-10-06 23:32:00 -05:00
parent f7e64faed5
commit b52fe34667
Signed by: me
GPG Key ID: D3993665FF92E1C3
5 changed files with 10 additions and 4 deletions

View File

@ -17,6 +17,12 @@ Main repo: https://git.sudoer.ch/me/really-bad-compiler-in-haskell
- Use `stack run <file>` to run the program (for example, `stack run example/1.hear`). - Use `stack run <file>` 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`. - 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 ## 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. 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.

View File

@ -18,7 +18,7 @@ executable really-bad-compiler-in-haskell
other-modules: other-modules:
Main.LLVMGen Main.LLVMGen
Main.Parser.Megaparsec Main.Parser.Megaparsec
Main.Types.Expr Main.Type
Paths_really_bad_compiler_in_haskell Paths_really_bad_compiler_in_haskell
hs-source-dirs: hs-source-dirs:
src src

View File

@ -22,7 +22,7 @@ import LLVM.IRBuilder.Constant
import LLVM.IRBuilder.Instruction import LLVM.IRBuilder.Instruction
import LLVM.IRBuilder.Module import LLVM.IRBuilder.Module
import LLVM.IRBuilder.Monad import LLVM.IRBuilder.Monad
import Main.Types.Expr as Expr import Main.Type as Expr
data Env = Env data Env = Env
{ operands :: M.Map Text Operand, { operands :: M.Map Text Operand,

View File

@ -8,7 +8,7 @@ import Control.Monad.Combinators.Expr
import Data.Functor.Identity qualified import Data.Functor.Identity qualified
import Data.Text import Data.Text
import Data.Void (Void) import Data.Void (Void)
import Main.Types.Expr import Main.Type
import Text.Megaparsec as MP hiding (parse) import Text.Megaparsec as MP hiding (parse)
import Text.Megaparsec qualified as MP import Text.Megaparsec qualified as MP
import Text.Megaparsec.Char qualified as C import Text.Megaparsec.Char qualified as C

View File

@ -1,4 +1,4 @@
module Main.Types.Expr (Expr (..)) where module Main.Type (Expr (..)) where
data Expr data Expr
= Lit Int = Lit Int