Skip to content

Commit

Permalink
chore: align isInternalName with upstream version (#796)
Browse files Browse the repository at this point in the history
* chore: align isInternalName with upstream version

* doc-string
  • Loading branch information
kim-em authored Jun 1, 2024
1 parent 60d622c commit dfe8208
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Batteries/Lean/Name.lean
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,13 @@ Generally, user code should not explicitly use internal names.
def isInternalDetail : Name → Bool
| .str p s =>
s.startsWith "_"
|| s.startsWith "match_"
|| s.startsWith "proof_"
|| matchPrefix s "eq_"
|| matchPrefix s "match_"
|| matchPrefix s "proof_"
|| p.isInternalOrNum
| .num _ _ => true
| p => p.isInternalOrNum
where
/-- Check that a string begins with the given prefix, and then is only digit characters. -/
matchPrefix (s : String) (pre : String) :=
s.startsWith pre && (s |>.drop pre.length |>.all Char.isDigit)

0 comments on commit dfe8208

Please sign in to comment.