Skip to content

Commit

Permalink
define expression
Browse files Browse the repository at this point in the history
  • Loading branch information
yuchiki committed Oct 20, 2019
1 parent cd0dd1a commit 743f4b3
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 11 deletions.
4 changes: 1 addition & 3 deletions app/Main.hs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
module Main where

import Lib

main :: IO ()
main = someFunc
main = return ()
1 change: 1 addition & 0 deletions package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,4 @@ tests:
- -with-rtsopts=-N
dependencies:
- typedMiniLang
- hspec
20 changes: 20 additions & 0 deletions src/Expr.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
module Expr where

type Variable = String

data Expr =
EVar Variable
| ECBool Bool
| ECInt Int
| EAdd Expr Expr
| ESub Expr Expr
| EMul Expr Expr
| EDiv Expr Expr
| EAnd Expr Expr
| EOr Expr Expr
| ENot Expr
| ELT Expr Expr
| EEqInt Expr Expr
| EIf Expr Expr Expr
| ELet Variable Expr Expr
deriving (Show)
6 changes: 0 additions & 6 deletions src/Lib.hs

This file was deleted.

7 changes: 7 additions & 0 deletions test/ExprSpec.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module ExprSpec (spec) where

import Test.Hspec
import Expr

spec :: Spec
spec = return ()
3 changes: 1 addition & 2 deletions test/Spec.hs
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
main :: IO ()
main = putStrLn "Test suite not yet implemented"
{-# OPTIONS_GHC -F -pgmF hspec-discover #-}

0 comments on commit 743f4b3

Please sign in to comment.