Skip to content

Commit

Permalink
add "blocked" status to JSON output
Browse files Browse the repository at this point in the history
this is a boolean that indicates if the given element or
sub-element is blocked waiting for user input
  • Loading branch information
danmatichuk committed Nov 5, 2024
1 parent 8687a77 commit 2552402
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tools/pate-repl/Repl.hs
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,7 @@ prettyNextNodes startAt onlyFinished = do
, PO.outPP = pp
, PO.outDuration = duration
, PO.outFinished = isFinished b
, PO.outIsBlocked = isBlockedStatus b
, PO.outSuffix = suf
, PO.outMoreResults = nesting < 0
, PO.outJSON = json
Expand All @@ -493,6 +494,7 @@ prettyNextNodes startAt onlyFinished = do
, PO.outPP = "<ERROR: Unexpected missing printer>"
, PO.outDuration = duration
, PO.outFinished = isFinished b
, PO.outIsBlocked = isBlockedStatus b
, PO.outSuffix = Nothing
, PO.outMoreResults = nesting < 0
, PO.outJSON = json
Expand Down
2 changes: 2 additions & 0 deletions tools/pate/Output.hs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ data OutputElem =
, outDuration :: Maybe (PP.Doc ())
, outPP :: PP.Doc ()
, outJSON :: JSON.Value
, outIsBlocked :: Bool
, outSuffix :: Maybe (PP.Doc ())
, outMoreResults :: Bool
-- ^ more results at this nesting level that were omitted
Expand Down Expand Up @@ -194,6 +195,7 @@ outputElemJSON e =
[ "index" .= outIdx e
, "indent" .= outIndent e
, "finished" .= outFinished e
, "blocked" .= outIsBlocked e
, "pretty" .= show (outPP e)
, "content" .= outJSON e
, "more" .= outMoreResults e
Expand Down

0 comments on commit 2552402

Please sign in to comment.