Capture Output command modified#22140
Conversation
| : nat | ||
| 2 | ||
| : nat | ||
| hello |
There was a problem hiding this comment.
currently I don't print locations in Print Captured Output
notably they would be inconsistent in proof general (which gets some "toplevel input" location)
TODO make this more explicit in the doc
| type 'state control_entries = 'state control_entry list | ||
|
|
||
| (** Captured output *) | ||
| type output = Message of Feedback.level * Loc.t option * Pp.t |
There was a problem hiding this comment.
This is the full info we save currently (although as mentioned the location may not be useable to be consistent beween evaluation in a file and evaluation in eg proof general).
This means we could expose something to check the feedback level. Not sure if that would be useful.
|
If we redesigned locations to be relative to a command it might be possible to use them reliably but that could be a lot of work and certainly out of scope for this PR. (This would mean in |
cf rocq-prover/rfcs#107 #20688 #20873
The captured output is not in the summary, it's in a more explicitly handled state (next to proof state and program state).
The
Capture Outputcommand modifier accumulates the output to a fresh ref, then when the command is done adds it to the state. This makes it immune toVernacstate.System.protectand similar, can capture output from an innerFail/Succeed, but still respects surroundingFail/Succeed.eg
Succeed Capture Output Check 0.does not add to the state (Succeed prevents it), butCapture Output Succeed Check 0.does add to the state.TODO:
For Assert Output for reliable results we shouldn't depend on the current printing width setting, but we may still want to assert that line breaks are nice somehow.
I guess we could pass a printing width to Assert Output? (eg
Assert Output (printing width 42) "expected".) and compare collapsing whitespace if no printing width is given? not sureMaybe:
Ltac2 Process Captured Output ltac2 code?Process Captured Output some constr?)