chore: add private getUtf8Byte' to Init.Meta (#10140)
This PR adds a private `Lean.Name.getUtf8Byte'` to `Init.Meta` for a future PR that optimizes `Lean.Name.escapePart`. `Lean.Name.getUtf8Byte'` should be replaced with `String.getUtf8Byte` once the string refactor is through.
This commit is contained in:
parent
425bebe99e
commit
2324c0939d
2 changed files with 8 additions and 0 deletions
|
|
@ -131,6 +131,12 @@ def isInaccessibleUserName : Name → Bool
|
|||
| Name.num p _ => isInaccessibleUserName p
|
||||
| _ => false
|
||||
|
||||
-- FIXME: `getUtf8Byte` is in `Init.Data.String.Extra`, which causes an import cycle with
|
||||
-- `Init.Meta`. Moving `getUtf8Byte` up to `Init.Data.String.Basic` creates another import cycle.
|
||||
-- Please replace this definition with `getUtf8Byte` when the string refactor is through.
|
||||
@[extern "lean_string_get_byte_fast"]
|
||||
private opaque getUtf8Byte' (s : @& String) (n : Nat) (h : n < s.utf8ByteSize) : UInt8
|
||||
|
||||
/--
|
||||
Creates a round-trippable string name component if possible, otherwise returns `none`.
|
||||
Names that are valid identifiers are not escaped, and otherwise, if they do not contain `»`, they are escaped.
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
#include "util/options.h"
|
||||
|
||||
// Please update stage0, dear CI
|
||||
|
||||
namespace lean {
|
||||
options get_default_options() {
|
||||
options opts;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue