fix: spacing around calc

This commit is contained in:
Mario Carneiro 2023-06-02 01:30:48 -04:00 committed by Sebastian Ullrich
parent 28538fc748
commit e826f5f42a
3 changed files with 8 additions and 1 deletions

View file

@ -92,7 +92,7 @@ end
syntax calcFirstStep := ppIndent(colGe term (" := " term)?)
-- enforce indentation of calc steps so we know when to stop parsing them
syntax calcStep := ppIndent(colGe term " := " term)
syntax calcSteps := ppLine withPosition(calcFirstStep) ppLine withPosition((calcStep ppLine)*)
syntax calcSteps := ppLine withPosition(calcFirstStep) withPosition((ppLine calcStep)*)
/-- Step-wise reasoning over transitive relations.
```

View file

@ -59,3 +59,7 @@ def foo : a b c d e f g a b c d e f g h where
i := 42
j := 42
k := 42)
#eval fmt `(calc
1 = 1 := rfl
1 = 1 := rfl)

View file

@ -67,3 +67,6 @@ def foo✝ : a✝ b✝ c✝ d✝ e✝ f✝ g✝ a✝ b✝ c✝ d✝ e✝ f✝ g
i✝ := 42
j✝ := 42
k✝ := 42
calc
1 = 1 := rfl✝
1 = 1 := rfl✝