diff options
author | Camil Staps | 2017-07-20 20:25:25 +0000 |
---|---|---|
committer | Camil Staps | 2017-07-20 20:25:25 +0000 |
commit | bc950badd0655328af7a9886988722809e367d07 (patch) | |
tree | 6411d00c5022b591697c206cc1261dafb8ec8b33 /Sil/Syntax.icl | |
parent | Add checks for locals with type Void (diff) |
Type checking
Diffstat (limited to 'Sil/Syntax.icl')
-rw-r--r-- | Sil/Syntax.icl | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/Sil/Syntax.icl b/Sil/Syntax.icl index 8083eba..43d27fc 100644 --- a/Sil/Syntax.icl +++ b/Sil/Syntax.icl @@ -9,6 +9,7 @@ import Data.List import Data.Maybe import Text +import Sil.Types import Sil.Util.Printer instance toString Statement @@ -21,12 +22,6 @@ where toString (MachineStm s) = "|~" <+ s toString _ = "<<unimplemented Statement>>" -instance toString Type -where - toString TBool = "Bool" - toString TInt = "Int" - toString TVoid = "Void" - instance toString Arg where toString arg = arg.arg_type <+ " " <+ arg.arg_name instance toString Expression @@ -96,8 +91,3 @@ where instance allLocals CodeBlock where allLocals cb = [(i.init_type, i.init_name) \\ i <- cb.cb_init] - -typeSize :: Type -> Int -typeSize TVoid = 0 -typeSize TBool = 1 -typeSize TInt = 1 |