Skip to content

Commit

Permalink
dnl newlines now passes tests; resolves #28
Browse files Browse the repository at this point in the history
  • Loading branch information
mengwong committed Oct 18, 2021
1 parent cafda6e commit 7e71dab
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions mengwong/mp/src/Lib.hs
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ pRegRuleNormal = do
guard $ leftX >= depth
(party_every, entitytype) <- pActor Party <|> pActor Every
-- (Who, (BoolStruct,[Rule]))
whoBool <- optional (withDepth leftX preambleBoolRules) <* dnl
whoBool <- optional (withDepth leftX preambleBoolRules)
-- the below are going to be permutables
myTraceM $ "pRegRuleNormal: preambleBoolRules returned " ++ show whoBool
rulebody <- permutations
Expand Down Expand Up @@ -468,8 +468,8 @@ pAndGroup :: Parser BoolRules
pAndGroup = do
debugPrint "pAndGroup"
currentX <- lookAhead pXLocation -- we are positioned at the OtherVal
orGroup1 <- pOrGroup <* dnl
orGroupN <- many $ dToken And *> pOrGroup <* optional dnl
orGroup1 <- pOrGroup
orGroupN <- many $ dToken And *> pOrGroup
let toreturn = if null orGroupN
then orGroup1
else ( Just (AA.All (AA.Pre "all of:") (catMaybes $ fst <$> (orGroup1 : orGroupN)))
Expand All @@ -481,8 +481,8 @@ pOrGroup :: Parser BoolRules
pOrGroup = do
depth <- asks callDepth
debugPrint "pOrGroup"
elem1 <- withDepth (depth + 1) pElement <* dnl
elems <- many $ dToken Or *> withDepth (depth+1) pElement <* dnl
elem1 <- withDepth (depth + 1) pElement
elems <- many $ dToken Or *> withDepth (depth+1) pElement
let toreturn = if null elems
then elem1
else ( Just (AA.Any (AA.Pre "any of:") (catMaybes $ fst <$> (elem1 : elems)))
Expand Down Expand Up @@ -529,7 +529,7 @@ pBoolConnector = do
debugPrint "pBoolConnector"
currentX <- lookAhead pXLocation
guard $ currentX >= depth
andor <- (pToken And <|> pToken Or <|> pToken Unless) <* dnl
andor <- (pToken And <|> pToken Or <|> pToken Unless)
myTraceM $ "pBoolConnector returning " ++ show andor
return andor

Expand Down

0 comments on commit 7e71dab

Please sign in to comment.