Skip to content

Commit

Permalink
style: snake_case tactic combinator
Browse files Browse the repository at this point in the history
Fixes #11.
  • Loading branch information
Vtec234 committed May 31, 2023
1 parent cadcdf2 commit 51bff92
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions ProofWidgets/Component/Panel.lean
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,17 @@ def processIdent (stx : Syntax) (nmStx : TSyntax `ident) : CoreM Unit := do
/-- Display the selected panel widgets in the nested tactic script. For example,
assuming we have written a `GeometryDisplay` component,
```lean
by withPanelWidgets [GeometryDisplay]
by with_panel_widgets [GeometryDisplay]
simp
rfl
```
will show the geometry display alongside the usual tactic state throughout the proof.
-/
syntax (name := withPanelWidgetsTacticStx) "withPanelWidgets" "[" ident,+ "]" tacticSeq : tactic
syntax (name := withPanelWidgetsTacticStx) "with_panel_widgets" "[" ident,+ "]" tacticSeq : tactic

@[tactic withPanelWidgetsTacticStx]
def withPanelWidgets : Tactic
| stx@`(tactic| withPanelWidgets [ $nms,* ] $seq) => do
| stx@`(tactic| with_panel_widgets [ $nms,* ] $seq) => do
liftM <| nms.getElems.forM (processIdent stx)
evalTacticSeq seq
| _ => throwUnsupportedSyntax
Expand Down
4 changes: 2 additions & 2 deletions ProofWidgets/Demos/ExprPresentation.lean
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ def presenter : ExprPresenter where
</span>

example : 2 + 2 = 43 + 3 = 6 := by
withPanelWidgets [GoalTypePanel]
with_panel_widgets [GoalTypePanel]
-- Place cursor here.
constructor
rfl
rfl

example (h : 2 + 2 = 5) : 2 + 2 = 4 := by
withPanelWidgets [SelectionPanel]
with_panel_widgets [SelectionPanel]
-- Place cursor here and select subexpressions in the goal with shift-click.
rfl
2 changes: 1 addition & 1 deletion ProofWidgets/Demos/RbTree.lean
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ example {α : Type} (x y z : α) (a b c d : RBTree α)
(h : ¬ ∃ e w f, a = node red e w f) :
balance black (node red a x (node red b y c)) z d =
node red (node black a x b) y (node black c z d) := by
withPanelWidgets [SelectionPanel]
with_panel_widgets [SelectionPanel]
match a with
| .empty => simp [balance]
| node black .. => simp [balance]
Expand Down

0 comments on commit 51bff92

Please sign in to comment.