diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 diff --git a/README.md b/README.md old mode 100644 new mode 100755 diff --git a/examples/compl.smac b/examples/compl.smac old mode 100644 new mode 100755 diff --git a/examples/cond.smac b/examples/cond.smac old mode 100644 new mode 100755 diff --git a/examples/div.smac b/examples/div.smac old mode 100644 new mode 100755 diff --git a/examples/dumpstack.smac b/examples/dumpstack.smac old mode 100644 new mode 100755 diff --git a/examples/ex1.smac b/examples/ex1.smac old mode 100644 new mode 100755 diff --git a/examples/ex2.smac b/examples/ex2.smac old mode 100644 new mode 100755 diff --git a/examples/ex3.smac b/examples/ex3.smac old mode 100644 new mode 100755 diff --git a/examples/ex4.smac b/examples/ex4.smac old mode 100644 new mode 100755 diff --git a/examples/ex5.smac b/examples/ex5.smac old mode 100644 new mode 100755 diff --git a/examples/ex6.smac b/examples/ex6.smac old mode 100644 new mode 100755 diff --git a/examples/fib.smac b/examples/fib.smac old mode 100644 new mode 100755 diff --git a/examples/fib_iterative.smac b/examples/fib_iterative.smac old mode 100644 new mode 100755 diff --git a/examples/flush.smac b/examples/flush.smac old mode 100644 new mode 100755 diff --git a/examples/lab.smac b/examples/lab.smac old mode 100644 new mode 100755 diff --git a/examples/leq.smac b/examples/leq.smac old mode 100644 new mode 100755 diff --git a/examples/mul.smac b/examples/mul.smac old mode 100644 new mode 100755 diff --git a/examples/neq.smac b/examples/neq.smac old mode 100644 new mode 100755 diff --git a/examples/not.smac b/examples/not.smac old mode 100644 new mode 100755 diff --git a/examples/subcall-return.smac b/examples/subcall-return.smac old mode 100644 new mode 100755 diff --git a/examples/subroutine_add.smac b/examples/subroutine_add.smac old mode 100644 new mode 100755 diff --git a/smachine.cabal b/smachine.cabal old mode 100644 new mode 100755 diff --git a/src/CmdMain.hs b/src/CmdMain.hs old mode 100644 new mode 100755 diff --git a/src/Eval.hs b/src/Eval.hs old mode 100644 new mode 100755 diff --git a/src/EvalNonMonad.hs b/src/EvalNonMonad.hs old mode 100644 new mode 100755 diff --git a/src/Foo.hs b/src/Foo.hs old mode 100644 new mode 100755 diff --git a/src/Main.hs b/src/Main.hs old mode 100644 new mode 100755 diff --git a/src/PPrint.hs b/src/PPrint.hs index d94b9953a69a2e2bb9aee5129005c70dfce746ca..c0b63d1cf45804265f2fc12bbbaa9b0c677c7a75 100755 --- a/src/PPrint.hs +++ b/src/PPrint.hs @@ -23,7 +23,7 @@ module PPrint , show, putDoc, hPutDoc - , (<>) + , (PPrint.<>) , (<+>) , (</>), (<//>) , (PPrint.<$>), (<$$>) @@ -77,9 +77,9 @@ semiBraces = encloseSep lbrace rbrace semi encloseSep left right sep ds = case ds of - [] -> left <> right - [d] -> left <> d <> right - _ -> align (cat (zipWith (<>) (left : repeat sep) ds) <> right) + [] -> left PPrint.<> right + [d] -> left PPrint.<> d PPrint.<> right + _ -> align (cat (zipWith (PPrint.<>) (left : repeat sep) ds) PPrint.<> right) ----------------------------------------------------------- @@ -87,7 +87,7 @@ encloseSep left right sep ds ----------------------------------------------------------- punctuate p [] = [] punctuate p [d] = [d] -punctuate p (d:ds) = (d <> p) : punctuate p ds +punctuate p (d:ds) = (d PPrint.<> p) : punctuate p ds ----------------------------------------------------------- @@ -100,18 +100,18 @@ vsep = fold (PPrint.<$>) cat = group . vcat fillCat = fold (<//>) -hcat = fold (<>) +hcat = fold (PPrint.<>) vcat = fold (<$$>) fold f [] = empty fold f ds = foldr1 f ds x <> y = x `beside` y -x <+> y = x <> space <> y -x </> y = x <> softline <> y -x <//> y = x <> softbreak <> y -x <$> y = x <> line <> y -x <$$> y = x <> linebreak <> y +x <+> y = x PPrint.<> space PPrint.<> y +x </> y = x PPrint.<> softline PPrint.<> y +x <//> y = x PPrint.<> softbreak PPrint.<> y +x <$> y = x PPrint.<> line PPrint.<> y +x <$$> y = x PPrint.<> linebreak PPrint.<> y softline = group line softbreak = group linebreak @@ -122,7 +122,7 @@ braces = enclose lbrace rbrace parens = enclose lparen rparen angles = enclose langle rangle brackets = enclose lbracket rbracket -enclose l r x = l <> x <> r +enclose l r x = l PPrint.<> x PPrint.<> r lparen = char '(' rparen = char ')' @@ -150,9 +150,9 @@ equals = char '=' -- string is like "text" but replaces '\n' by "line" string "" = empty -string ('\n':s) = line <> string s +string ('\n':s) = line PPrint.<> string s string s = case (span (/='\n') s) of - (xs,ys) -> text xs <> string ys + (xs,ys) -> text xs PPrint.<> string ys bool :: Bool -> Doc bool b = text (show b) @@ -240,13 +240,13 @@ fill f d = width d (\w -> if (w >= f) then empty else text (spaces (f - w))) -width d f = column (\k1 -> d <> column (\k2 -> f (k2 - k1))) +width d f = column (\k1 -> d PPrint.<> column (\k2 -> f (k2 - k1))) ----------------------------------------------------------- -- semi primitive: Alignment and indentation ----------------------------------------------------------- -indent i d = hang i (text (spaces i) <> d) +indent i d = hang i (text (spaces i) PPrint.<> d) hang i d = align (nest i d) diff --git a/src/Parser.hs b/src/Parser.hs old mode 100644 new mode 100755 diff --git a/src/Types.hs b/src/Types.hs old mode 100644 new mode 100755 index 9f4984b8abb323626330289a012fd360cb03e4f6..b8b8a67ab988b5582761512f2de26716ca711491 --- a/src/Types.hs +++ b/src/Types.hs @@ -215,7 +215,7 @@ ppCommand Out = ppHelper "OUT" ppCommand OutLN = ppHelper "OUTLN" ppCommand In = ppHelper "IN" ppCommand Flush = ppHelper "FLUSH" -ppCommand (Label n _) = text n <> text ":" +ppCommand (Label n _) = text n PPrint.<> text ":" ppCommand Store = ppHelper "STORE" ppCommand StoreIdx = ppHelper "STOREIDX" ppCommand Load = ppHelper "LOAD" @@ -238,7 +238,7 @@ ppCommand Not = ppHelper "Not" ppCommand JmpNZ = ppHelper "JMPNZ" ppCommand Jmp = ppHelper "JMP" ppCommand Subcall = ppHelper "SUBCALL" -ppCommand (AddrOf n) = indent 1 $ text "&" <> text n +ppCommand (AddrOf n) = indent 1 $ text "&" PPrint.<> text n ppHelper = indent 1 . text