Move Expr to Type.hs
parent
f7e64faed5
commit
b52fe34667
|
@ -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.
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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,
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
module Main.Types.Expr (Expr (..)) where
|
module Main.Type (Expr (..)) where
|
||||||
|
|
||||||
data Expr
|
data Expr
|
||||||
= Lit Int
|
= Lit Int
|
Reference in New Issue