Skip to content

Commit

Permalink
some fixes, everything is still broken tho
Browse files Browse the repository at this point in the history
  • Loading branch information
mengwong committed Oct 12, 2021
1 parent 14c5d53 commit c9f7b9c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mengwong/mp/src/Lib.hs
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ pRegRuleSugary depth = do
deontic <- pDeontic <* dnl
temporal <- optional pTemporal
(pbrs, action) <- permutations depth
let (who, (ands, brs)) = fromMaybe (Always, (AA.Any (AA.Pre "always") [], [])) pbr -- if there is no WHO line
let (who, (ands, brs)) = fromMaybe (Always, (AA.Any (AA.Pre "always") [], [])) pbrs -- if there is no WHO line
toreturn = Regulative entitytype (newPre (Text.pack $ show who) ands) deontic action temporal
myTraceM $ "pRegRule: the specifier is " ++ show who
myTraceM $ "pRegRule: returning " ++ show toreturn
Expand Down Expand Up @@ -337,7 +337,7 @@ pRegRuleNormal depth = do
in (w,( a : mconcat pre_a
, concat (b ++ (snd <$> tail xs)) ) )

pTemporal :: Parser (TemporalConstraint Text.Text))
pTemporal :: Parser (TemporalConstraint Text.Text)
pTemporal = do
t1 <- pToken Before <|> pToken After <|> pToken By <* dnl
t2 <- pOtherVal <* dnl
Expand Down Expand Up @@ -369,7 +369,7 @@ data RuleBody = RuleBody { rbpbrs :: [(Preamble, BoolRules)] -- not subject
, rbdeon :: [Deontic]
, rbtemporal :: [TemporalConstraint Text.Text]
}
deriving (Ord, Eq, Show, Read, Generic)
deriving (Eq, Show, Generic)
deriving (Semigroup, Monoid) via Generically RuleBody

permutations :: Depth -> Parser RuleBody
Expand Down

0 comments on commit c9f7b9c

Please sign in to comment.