Skip to content

Commit

Permalink
chore: bump to nightly-2022-08-09
Browse files Browse the repository at this point in the history
  • Loading branch information
gebner committed Aug 10, 2022
1 parent e16a13a commit 92d76cc
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 11 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@ Logs/
PreData/
Outputs/
lean_packages/
!lean_packages/manifest.json
sources/
*.tar.gz
2 changes: 1 addition & 1 deletion Mathport/Binary/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def liftCoreM (x : CoreM α) : BinportM α := do
Elab.Command.liftCoreM x

def liftMetaM (x : MetaM α) : BinportM α := do
liftTermElabM (declName? := some (← read).currDecl) (liftM x)
liftTermElabM (liftM x)

def addNameAlignment (n3 n4 : Name) : BinportM Unit := do
liftCoreM $ Mathlib.Prelude.Rename.addNameAlignment n3 n4
Expand Down
16 changes: 11 additions & 5 deletions Mathport/Syntax/Translate/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -589,9 +589,8 @@ def trBinderIdentI : BinderName → M (Syntax.BinderIdent)
def optTy (ty : Option Term) : M (Option (TSyntax ``Parser.Term.typeSpec)) :=
ty.mapM fun stx => do `(Parser.Term.typeSpec| : $stx)

def trCalcArgs (args : Array (Spanned Expr × Spanned Expr)) : M (Array (TSyntax ``calcStep)) :=
args.mapM fun (lhs, rhs) =>
return mkNode ``calcStep #[← trExpr lhs, mkAtom ":=", ← trExpr rhs]
def trCalcArg : Spanned Expr × Spanned Expr → M (TSyntax ``calcStep)
| (lhs, rhs) => do `(calcStep| $(← trExpr lhs) := $(← trExpr rhs))

mutual

Expand Down Expand Up @@ -620,7 +619,10 @@ mutual
`(tactic| first $[| $(← tacs.mapM fun tac => trTactic tac):tactic]*)
| Tactic.«[]» _tacs => warn! "unsupported (impossible)"
| Tactic.exact_shortcut ⟨_, Expr.calc args⟩ => do
`(tactic| calc $(← trCalcArgs args)*)
if h : args.size > 0 then
`(tactic| calc $(← trCalcArg args[0]) $(← args[1:].toArray.mapM trCalcArg)*)
else
warn! "empty calc is unsupported"
| Tactic.exact_shortcut e => do `(tactic| exact $(← trExpr e))
| Tactic.expr e =>
match e.unparen with
Expand Down Expand Up @@ -1076,7 +1078,11 @@ def trExpr' : Expr → M Term
| Expr.if (some h) c t e => do
`(if $(mkIdent h.kind):ident : $(← trExpr c)
then $(← trExpr t) else $(← trExpr e))
| Expr.calc args => do `(calc $(← trCalcArgs args)*)
| Expr.calc args => do
if h : args.size > 0 then
`(calc $(← trCalcArg args[0]) $(← args[1:].toArray.mapM trCalcArg)*)
else
warn! "empty calc is unsupported"
| Expr.«@» _ e => do `(@$(← trExpr e))
| Expr.pattern e => trExpr e
| Expr.«`()» _ true e => do `(quote $(← trExpr e))
Expand Down
2 changes: 2 additions & 0 deletions lakefile.lean
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ package mathport
-- as this commit of mathlib4 uses.
require mathlib from git "https://github.com/leanprover-community/mathlib4"@"master"

lean_lib Mathport

@[defaultTarget]
lean_exe mathport where
root := `MathportApp
Expand Down
2 changes: 1 addition & 1 deletion lean-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1 @@
leanprover/lean4:nightly-2022-07-24
leanprover/lean4:nightly-2022-08-09
7 changes: 4 additions & 3 deletions lean_packages/manifest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{"version": 1,
{"version": 2,
"packages":
[{"url": "https://github.com/leanprover-community/mathlib4",
"rev": "297e7eae2ed008ad633c80a55a831e0d63084376",
"name": "mathlib"}]}
"rev": "cf2e683c25eba2d798b2460d5703a63db72272c0",
"name": "mathlib",
"inputRev": "master"}]}

0 comments on commit 92d76cc

Please sign in to comment.