File tree 1 file changed +2
-12
lines changed
saw-core/src/Verifier/SAW/Term
1 file changed +2
-12
lines changed Original file line number Diff line number Diff line change @@ -119,23 +119,13 @@ data Prec
119
119
| PrecProd -- ^ Nonterminal 'ProductTerm'
120
120
| PrecApp -- ^ Nonterminal 'AppTerm'
121
121
| PrecArg -- ^ Nonterminal 'AtomTerm'
122
+ deriving (Eq , Ord )
122
123
123
124
-- | Test if the first precedence "contains" the second, meaning that terms at
124
125
-- the latter precedence level can be printed in the context of the former
125
126
-- without parentheses.
126
- --
127
- -- NOTE: we write this explicitly here, instead of generating it from an 'Ord'
128
- -- instance, so that readers of this code understand it and know what it is.
129
127
precContains :: Prec -> Prec -> Bool
130
- precContains _ PrecArg = True
131
- precContains PrecArg _ = False
132
- precContains _ PrecApp = True
133
- precContains PrecApp _ = False
134
- precContains _ PrecProd = True
135
- precContains PrecProd _ = False
136
- precContains _ PrecLambda = True
137
- precContains PrecLambda _ = False
138
- precContains PrecNone PrecNone = True
128
+ precContains x y = x <= y
139
129
140
130
-- | Optionally print parentheses around a document, iff the incoming, outer
141
131
-- precedence (listed first) contains (as in 'precContains') the required
You can’t perform that action at this time.
0 commit comments