Skip to content

Commit dc03e25

Browse files
committed
Ready for Release -v0.1.0.0
1 parent a7ceb53 commit dc03e25

File tree

6 files changed

+11
-132
lines changed

6 files changed

+11
-132
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.stack-work/
22
Haskull.cabal
33
*~
4-
.vscode/
4+
.vscode/
5+
dist/

Haskull.cabal

Lines changed: 0 additions & 90 deletions
This file was deleted.

src/CodeGen.hs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@ module CodeGen (
4141
br,
4242
phi,
4343
cbr,
44-
fcmp,
45-
uitofp
44+
fcmp
4645

4746
)where
4847

@@ -321,6 +320,3 @@ phi ty incoming = instr $ ASTL.Phi ty incoming []
321320

322321
fcmp :: IP.IntegerPredicate -> ASTL.Operand -> ASTL.Operand -> Codegen ASTL.Operand
323322
fcmp cond a b = instr $ ICmp cond a b []
324-
325-
uitofp :: ASTL.Type -> ASTL.Operand -> Codegen ASTL.Operand
326-
uitofp ty a = instr $ ASTL.UIToFP a ty []

src/Emit.hs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,7 @@ fdiv :: ASTL.Operand -> ASTL.Operand -> Codegen ASTL.Operand
9090
fdiv a b = instr $ ASTL.UDiv False a b []
9191

9292
lesser :: ASTL.Operand -> ASTL.Operand -> Codegen ASTL.Operand
93-
lesser a b = do
94-
test <- fcmp IP.ULT a b
95-
uitofp intL test
93+
lesser a b = fcmp IP.ULT a b
9694

9795
externf :: ASTL.Name -> ASTL.Operand
9896
externf = ConstantOperand . C.GlobalReference intL

src/Parser.hs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@ opParser :: Parser Op
8585
opParser = try plusParser
8686
<|> try minusParser
8787
<|> try mulParser
88-
<|> divideParser
88+
<|> try divideParser
89+
<|> lessthanParser
8990

9091
plusParser = do
9192
reservedOp "+"
@@ -103,6 +104,10 @@ divideParser = do
103104
reservedOp "/"
104105
return Divide
105106

107+
lessthanParser = do
108+
reservedOp "<"
109+
return LessThan
110+
106111
-- | Variable Names and identifier -----
107112
-- NSS
108113
nameParser :: Parser Name
@@ -212,7 +217,7 @@ singleParse :: Expr -> Parser BinOpCall
212217
singleParse (BinOpCallStmt a) = return a
213218
singleParse lhs = return $ BinOpCall Plus lhs (LiteralStmt (IntLiteral 0))
214219

215-
precedenceTable = Map.fromList[(Plus,10),(Minus,10),(Mul,20),(Divide,20)]
220+
precedenceTable = Map.fromList[(Plus,10),(Minus,10),(Mul,20),(Divide,20),(LessThan,5)]
216221

217222
getTokPrec op = (Map.lookup op precedenceTable)
218223

src/Test.hs

Lines changed: 0 additions & 31 deletions
This file was deleted.

0 commit comments

Comments
 (0)