X-Git-Url: https://ruin.nu/git/?p=proglang.git;a=blobdiff_plain;f=Printsyntax.hs;h=0e549511ce4275a12b895072d1a216b7f8bf45e8;hp=1d1068749e5bc7d85c4411c7eb9efdf905125d07;hb=93b042040034d199c925248a2dd1c321773ab6d0;hpb=9597d94cbb1b328c27883c8421b1fef3211fb698 diff --git a/Printsyntax.hs b/Printsyntax.hs index 1d10687..0e54951 100644 --- a/Printsyntax.hs +++ b/Printsyntax.hs @@ -103,9 +103,9 @@ instance Print Stm where instance Print Exp where prt i e = case e of + EAss id exp -> prPrec i 0 (concatD [prt 0 id , doc (showString "=") , prt 0 exp]) BExp exp0 bop exp -> prPrec i 0 (concatD [prt 1 exp0 , prt 0 bop , prt 1 exp]) EVar id -> prPrec i 3 (concatD [prt 0 id]) - EAss id exp -> prPrec i 0 (concatD [prt 0 id , doc (showString "=") , prt 0 exp]) EInt n -> prPrec i 3 (concatD [prt 0 n]) ENeg exp -> prPrec i 3 (concatD [doc (showString "-") , prt 3 exp]) EBool bool -> prPrec i 3 (concatD [prt 0 bool])