X-Git-Url: https://ruin.nu/git/?p=proglang.git;a=blobdiff_plain;f=Printsyntax.hs;h=d1b4c4962d5b0a37e4d40bfec23c249040213763;hp=ff0128e8d8f68a0398d6b154dc5478968c19a4c6;hb=d553df8dfdffca78342d6fae142ceded9cd64415;hpb=565fbd61dca527c23888e08783d0d91cee458524 diff --git a/Printsyntax.hs b/Printsyntax.hs index ff0128e..d1b4c49 100644 --- a/Printsyntax.hs +++ b/Printsyntax.hs @@ -102,11 +102,12 @@ instance Print Stm where prt i e = case e of SExp exp -> prPrec i 0 (concatD [prt 0 exp , doc (showString ";")]) SBlock stms -> prPrec i 0 (concatD [doc (showString "{") , prt 0 stms , doc (showString "}")]) + SDecl type' id exp -> prPrec i 0 (concatD [prt 0 type' , prt 0 id , doc (showString "=") , prt 0 exp , doc (showString ";")]) + SDeclD type' id -> prPrec i 0 (concatD [prt 0 type' , prt 0 id , doc (showString ";")]) SWhile exp stm -> prPrec i 0 (concatD [doc (showString "while") , doc (showString "(") , prt 0 exp , doc (showString ")") , prt 0 stm]) SIf exp stm0 stm -> prPrec i 0 (concatD [doc (showString "if") , doc (showString "(") , prt 0 exp , doc (showString ")") , prt 0 stm0 , doc (showString "else") , prt 0 stm]) SPrint exp -> prPrec i 0 (concatD [doc (showString "print") , prt 0 exp , doc (showString ";")]) SNoop -> prPrec i 0 (concatD []) - SDecl type' id exp -> prPrec i 0 (concatD [prt 0 type' , prt 0 id , doc (showString "=") , prt 0 exp , doc (showString ";")]) prtList es = case es of [] -> (concatD [])