Skip to content

Commit

Permalink
i'll look at the tests tomorrow.
Browse files Browse the repository at this point in the history
  • Loading branch information
mengwong committed Oct 13, 2021
1 parent 3dcfe1a commit 199bdb3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions mengwong/mp/src/Lib.hs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ someFunc = do

-- TODO: integrate debugging and callstack depth with the runConfig, thread it through all the functions here
-- printf debugging infrastructure
debuggery = False
debuggery = True
myTraceM x = when debuggery (traceM x)
debugPrint depth str = when debuggery $ do
lookingAt <- lookAhead (getToken :: Parser MyToken)
Expand Down Expand Up @@ -282,7 +282,8 @@ pRule = do

pConstitutiveRule :: Depth -> Parser [Rule]
pConstitutiveRule depth = do
term <- (pOtherVal <* dnl) <?> "defined term"
debugPrint depth "pConstitutiveRule"
term <- (dnl *> pOtherVal <* dnl) <?> "defined term"
leftX <- lookAhead pXLocation -- this is the column where we expect IF/AND/OR etc.
guard $ leftX >= depth
defWord <- (pToken Means <|> pToken Is) <* dnl
Expand Down Expand Up @@ -353,8 +354,8 @@ mergePBRS xs =
pre_a = fst . snd <$> tail xs
toreturn = (w,( a <> mconcat pre_a
, concat (b : (snd . snd <$> tail xs) )))
in trace ("mergePBRS: called with " ++ show xs)
trace ("mergePBRS: about to return " ++ show toreturn)
in -- trace ("mergePBRS: called with " ++ show xs)
-- trace ("mergePBRS: about to return " ++ show toreturn)
toreturn

pTemporal :: Parser (TemporalConstraint Text.Text)
Expand Down
2 changes: 1 addition & 1 deletion mengwong/mp/test/Spec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ main = hspec $ do
`shouldParse`
[ Regulative {
every = "person"
, who = Just (Any ( Pre "Always" ) [ ])
, who = Nothing
, cond = Nothing
, deontic = DMust
, action = ("sing",[])
Expand Down

0 comments on commit 199bdb3

Please sign in to comment.