Commit ec8ffd17 authored by Camil Staps's avatar Camil Staps 🐧

Clean.PrettyPrint: Add cppp function to cpp

parent b3ae0c44
......@@ -16,10 +16,21 @@ from syntax import
* Pretty-printer
*
* @var The type to print
* @param The value to print
* @result A string representation of the parameter
*/
class cpp t :: t -> String
class cpp t where
/**
* Normal pretty-printer
* @param The value to print
* @result A string representation of the parameter
*/
cpp :: t -> String
/**
* Pretty-printer which places parentheses around the result if necessary
* @param The value to print
* @result A string representation of the parameter
*/
cppp :: t -> String
instance cpp
AType,
......
......@@ -9,9 +9,11 @@ import CleanPrettyPrint.Common
import CleanPrettyPrint.Expression
import CleanPrettyPrint.Definition
instance cpp AType where cpp x = print zero x
instance cpp ParsedDefinition where cpp x = print zero x
instance cpp ParsedExpr where cpp x = print zero x
instance cpp Rhs where cpp x = print zero x
instance cpp Type where cpp x = print zero x
instance cpp TypeContext where cpp x = print zero x
instance cpp AType where cpp x = print zero x; cppp x = print zerop x
instance cpp ParsedDefinition where cpp x = print zero x; cppp x = print zerop x
instance cpp ParsedExpr where cpp x = print zero x; cppp x = print zerop x
instance cpp Rhs where cpp x = print zero x; cppp x = print zerop x
instance cpp Type where cpp x = print zero x; cppp x = print zerop x
instance cpp TypeContext where cpp x = print zero x; cppp x = print zerop x
zerop = {zero & cpp_parens=True}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment