Skip to content

Commit c8712bc

Browse files
committed
chore: merge main
2 parents d87b4cd + 51e6e0d commit c8712bc

File tree

7 files changed

+18
-28
lines changed

7 files changed

+18
-28
lines changed

Batteries/Lean/Name.lean

+7-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,13 @@ Generally, user code should not explicitly use internal names.
1616
def isInternalDetail : Name → Bool
1717
| .str p s =>
1818
s.startsWith "_"
19-
|| s.startsWith "match_"
20-
|| s.startsWith "proof_"
19+
|| matchPrefix s "eq_"
20+
|| matchPrefix s "match_"
21+
|| matchPrefix s "proof_"
2122
|| p.isInternalOrNum
2223
| .num _ _ => true
2324
| p => p.isInternalOrNum
25+
where
26+
/-- Check that a string begins with the given prefix, and then is only digit characters. -/
27+
matchPrefix (s : String) (pre : String) :=
28+
s.startsWith pre && (s |>.drop pre.length |>.all Char.isDigit)

Batteries/Util/Cache.lean

+1-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ the second will store declarations from imports (and will hopefully be "read-onl
132132
-/
133133
@[reducible] def DiscrTreeCache (α : Type) : Type := DeclCache (DiscrTree α × DiscrTree α)
134134

135-
/-- Discrimation tree settings for the `DiscrTreeCache`. -/
135+
/-- Discrimination tree settings for the `DiscrTreeCache`. -/
136136
def DiscrTreeCache.config : WhnfCoreConfig := {}
137137

138138
/--

Batteries/Util/CheckTactic.lean

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import Lean.Elab.Term
99
/-
1010
This file is the home for commands to tactics behave as expected.
1111
12-
It currently includes two tactixs:
12+
It currently includes two tactics:
1313
1414
#check_tactic t ~> res
1515

Batteries/Util/ExtendedBinder.lean

-19
Original file line numberDiff line numberDiff line change
@@ -52,22 +52,3 @@ macro_rules -- TODO: merging the two macro_rules breaks expansion
5252
| `(∀ᵉ _ : $ty:term, $b) => `(∀ _ : $ty:term, $b)
5353
| `(∀ᵉ $x:ident : $ty:term, $b) => `(∀ $x:ident : $ty:term, $b)
5454
| `(∀ᵉ $x:binderIdent $p:binderPred, $b) => `(∀ $x:binderIdent $p:binderPred, $b)
55-
56-
open Parser.Command in
57-
/--
58-
Declares a binder predicate. For example:
59-
```
60-
binder_predicate x " > " y:term => `($x > $y)
61-
```
62-
-/
63-
syntax (name := binderPredicate) (docComment)? (Parser.Term.attributes)? (attrKind)?
64-
"binder_predicate" optNamedName optNamedPrio ppSpace ident (ppSpace macroArg)* " => "
65-
term : command
66-
67-
open Linter.MissingDocs Parser Term in
68-
/-- Missing docs handler for `binder_predicate` -/
69-
@[missing_docs_handler binderPredicate]
70-
def checkBinderPredicate : SimpleHandler := fun stx => do
71-
if stx[0].isNone && stx[2][0][0].getKind != ``«local» then
72-
if stx[4].isNone then lint stx[3] "binder predicate"
73-
else lintNamed stx[4][0][3] "binder predicate"

Batteries/WF.lean

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ end Acc
9191
namespace WellFounded
9292

9393
/-- Attaches to `x` the proof that `x` is accessible in the given well-founded relation.
94-
This can be used in recursive function definitions to explicitly use a differerent relation
94+
This can be used in recursive function definitions to explicitly use a different relation
9595
than the one inferred by default:
9696
9797
```

lean-toolchain

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
leanprover/lean4:v4.8.0-rc2
1+
leanprover/lean4:v4.8.0

scripts/test.lean

+7-3
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,20 @@ def main (args : List String) : IO Unit := do
3636
args := #["env", "lean", t.toString],
3737
env := #[("LEAN_ABORT_ON_PANIC", "1")] }
3838
let mut exitCode := out.exitCode
39+
let stdout := out.stdout
40+
let stderr := "\n".intercalate <|
41+
-- We don't count manifest out of date warnings as noise.
42+
out.stderr.splitOn "\n" |>.filter (!·.startsWith "warning: manifest out of date: ")
3943
if exitCode = 0 then
40-
if out.stdout.isEmpty && out.stderr.isEmpty then
44+
if stdout.isEmpty && stderr.isEmpty then
4145
IO.println s!"Test succeeded: {t}"
4246
else
4347
IO.println s!"Test succeeded with noisy output: {t}"
4448
unless allowNoisy do exitCode := 1
4549
else
4650
IO.eprintln s!"Test failed: `lake env lean {t}` produced:"
47-
unless out.stdout.isEmpty do IO.eprintln out.stdout
48-
unless out.stderr.isEmpty do IO.eprintln out.stderr
51+
unless stdout.isEmpty do IO.eprintln stdout
52+
unless out.stderr.isEmpty do IO.eprintln out.stderr -- We still print the manifest warning.
4953
pure exitCode
5054
-- Wait on all the jobs and exit with 1 if any failed.
5155
let mut exitCode : UInt8 := 0

0 commit comments

Comments
 (0)