Skip to content

Commit

Permalink
Rename PrecNone to more suggestive name PrecCommas; fix haddocks.
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Huffman committed May 5, 2021
1 parent a569b93 commit a838a8b
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions saw-core/src/Verifier/SAW/Term/Pretty.hs
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,12 @@ depthAllowed _ _ = True

-- | Precedence levels, each of which corresponds to a parsing nonterminal
data Prec
= PrecNone -- ^ Nonterminal 'Term' or "sepBy(Term, ',')"
| PrecTerm -- ^ Nonterminal 'Term'
| PrecLambda -- ^ Nonterminal 'LTerm'
| PrecProd -- ^ Nonterminal 'ProdTerm'
| PrecApp -- ^ Nonterminal 'AppTerm'
| PrecArg -- ^ Nonterminal 'AtomTerm'
= PrecCommas -- ^ Nonterminal @sepBy(Term, \',\')@
| PrecTerm -- ^ Nonterminal @Term@
| PrecLambda -- ^ Nonterminal @LTerm@
| PrecProd -- ^ Nonterminal @ProdTerm@
| PrecApp -- ^ Nonterminal @AppTerm@
| PrecArg -- ^ Nonterminal @AtomTerm@
deriving (Eq, Ord)

-- | Test if the first precedence "contains" the second, meaning that terms at
Expand Down Expand Up @@ -337,7 +337,7 @@ ppLetBlock defs body =

-- | Pretty-print pairs as "(x, y)"
ppPair :: Prec -> SawDoc -> SawDoc -> SawDoc
ppPair prec x y = ppParensPrec prec PrecNone (group (vcat [x <> pretty ',', y]))
ppPair prec x y = ppParensPrec prec PrecCommas (group (vcat [x <> pretty ',', y]))

-- | Pretty-print pair types as "x * y"
ppPairType :: Prec -> SawDoc -> SawDoc -> SawDoc
Expand Down Expand Up @@ -417,7 +417,7 @@ ppFlatTermF prec tf =
Primitive ec -> annotate PrimitiveStyle <$> ppBestName (ecName ec)
UnitValue -> return "(-empty-)"
UnitType -> return "#(-empty-)"
PairValue x y -> ppPair prec <$> ppTerm' PrecTerm x <*> ppTerm' PrecNone y
PairValue x y -> ppPair prec <$> ppTerm' PrecTerm x <*> ppTerm' PrecCommas y
PairType x y -> ppPairType prec <$> ppTerm' PrecApp x <*> ppTerm' PrecProd y
PairLeft t -> ppProj "1" <$> ppTerm' PrecArg t
PairRight t -> ppProj "2" <$> ppTerm' PrecArg t
Expand Down

0 comments on commit a838a8b

Please sign in to comment.