chore: update stage0
This commit is contained in:
parent
489b28085f
commit
e0132ea2f1
69 changed files with 53687 additions and 18503 deletions
2
stage0/src/Init/Data/Format/Syntax.lean
generated
2
stage0/src/Init/Data/Format/Syntax.lean
generated
|
|
@ -15,7 +15,7 @@ open Std.Format
|
|||
|
||||
private def formatInfo (showInfo : Bool) (info : SourceInfo) (f : Format) : Format :=
|
||||
match showInfo, info with
|
||||
| true, SourceInfo.original lead pos trail endPos => f!"{lead}:{f}:{pos}:{trail}:{endPos}"
|
||||
| true, SourceInfo.original lead pos trail endPos => f!"{lead}:{pos}:{f}:{endPos}:{trail}"
|
||||
| true, SourceInfo.synthetic pos endPos => f!"{pos}:{f}:{endPos}"
|
||||
| _, _ => f
|
||||
|
||||
|
|
|
|||
25
stage0/src/Init/Data/String/Basic.lean
generated
25
stage0/src/Init/Data/String/Basic.lean
generated
|
|
@ -192,10 +192,11 @@ def intercalate (s : String) (ss : List String) : String :=
|
|||
structure Iterator where
|
||||
s : String
|
||||
i : Pos
|
||||
deriving DecidableEq
|
||||
|
||||
def mkIterator (s : String) : Iterator :=
|
||||
⟨s, 0⟩
|
||||
|
||||
|
||||
namespace Iterator
|
||||
def toString : Iterator → String
|
||||
| ⟨s, _⟩ => s
|
||||
|
|
@ -344,23 +345,23 @@ namespace Substring
|
|||
|
||||
/-- Given an offset of a codepoint into the substring,
|
||||
return the offset there of the next codepoint. -/
|
||||
@[inline] private def next : Substring → String.Pos → String.Pos
|
||||
@[inline] def next : Substring → String.Pos → String.Pos
|
||||
| ⟨s, b, e⟩, p =>
|
||||
let absP := b+p
|
||||
if absP = e then p else s.next absP - b
|
||||
|
||||
/-- Given an offset of a codepoint into the substring,
|
||||
return the offset there of the previous codepoint. -/
|
||||
@[inline] private def prev : Substring → String.Pos → String.Pos
|
||||
@[inline] def prev : Substring → String.Pos → String.Pos
|
||||
| ⟨s, b, _⟩, p =>
|
||||
let absP := b+p
|
||||
if absP = b then p else s.prev absP - b
|
||||
|
||||
private def nextn : Substring → Nat → String.Pos → String.Pos
|
||||
def nextn : Substring → Nat → String.Pos → String.Pos
|
||||
| ss, 0, p => p
|
||||
| ss, i+1, p => ss.nextn i (ss.next p)
|
||||
|
||||
private def prevn : Substring → String.Pos → Nat → String.Pos
|
||||
def prevn : Substring → String.Pos → Nat → String.Pos
|
||||
| ss, 0, p => p
|
||||
| ss, i+1, p => ss.prevn i (ss.prev p)
|
||||
|
||||
|
|
@ -389,31 +390,29 @@ or `s.bsize` if `c` doesn't occur. -/
|
|||
| ⟨s, b, e⟩, p => b + p == e
|
||||
|
||||
@[inline] def extract : Substring → String.Pos → String.Pos → Substring
|
||||
| ⟨s, b, _⟩, b', e' => if b' ≥ e' then ⟨"", 0, 1⟩ else ⟨s, b+b', b+e'⟩
|
||||
| ⟨s, b, e⟩, b', e' => if b' ≥ e' then ⟨"", 0, 0⟩ else ⟨s, e.min (b+b'), e.min (b+e')⟩
|
||||
|
||||
partial def splitOn (s : Substring) (sep : String := " ") : List Substring :=
|
||||
if sep == "" then
|
||||
[s]
|
||||
else
|
||||
let stopPos := s.stopPos
|
||||
let str := s.str
|
||||
let rec loop (b i j : String.Pos) (r : List Substring) : List Substring :=
|
||||
if i == stopPos then
|
||||
if i == s.bsize then
|
||||
let r := if sep.atEnd j then
|
||||
"".toSubstring::{ str := str, startPos := b, stopPos := i-j } :: r
|
||||
"".toSubstring :: s.extract b (i-j) :: r
|
||||
else
|
||||
{ str := str, startPos := b, stopPos := i } :: r
|
||||
s.extract b i :: r
|
||||
r.reverse
|
||||
else if s.get i == sep.get j then
|
||||
let i := s.next i
|
||||
let j := sep.next j
|
||||
if sep.atEnd j then
|
||||
loop i i 0 ({ str := str, startPos := b, stopPos := i-j } :: r)
|
||||
loop i i 0 (s.extract b (i-j) :: r)
|
||||
else
|
||||
loop b i j r
|
||||
else
|
||||
loop b (s.next i) 0 r
|
||||
loop s.startPos s.startPos 0 []
|
||||
loop 0 0 0 []
|
||||
|
||||
@[inline] def foldl {α : Type u} (f : α → Char → α) (init : α) (s : Substring) : α :=
|
||||
match s with
|
||||
|
|
|
|||
56
stage0/src/Init/Meta.lean
generated
56
stage0/src/Init/Meta.lean
generated
|
|
@ -615,31 +615,41 @@ def isCharLit? (stx : Syntax) : Option Char :=
|
|||
| some val => decodeCharLit val
|
||||
| _ => none
|
||||
|
||||
private partial def decodeNameLitAux (s : String) (i : Nat) (r : Name) : Option Name :=
|
||||
OptionM.run do
|
||||
let continue? (i : Nat) (r : Name) : OptionM Name :=
|
||||
if s.get i == '.' then
|
||||
decodeNameLitAux s (s.next i) r
|
||||
else if s.atEnd i then
|
||||
pure r
|
||||
else
|
||||
none
|
||||
let curr := s.get i
|
||||
if isIdBeginEscape curr then
|
||||
let startPart := s.next i
|
||||
let stopPart := s.nextUntil isIdEndEscape startPart
|
||||
if !isIdEndEscape (s.get stopPart) then none
|
||||
else continue? (s.next stopPart) (Name.mkStr r (s.extract startPart stopPart))
|
||||
else if isIdFirst curr then
|
||||
let startPart := i
|
||||
let stopPart := s.nextWhile isIdRest startPart
|
||||
continue? stopPart (Name.mkStr r (s.extract startPart stopPart))
|
||||
private partial def splitNameLitAux (ss : Substring) (acc : List Substring) : List Substring :=
|
||||
let splitRest (ss : Substring) (acc : List Substring) : List Substring :=
|
||||
if ss.front == '.' then
|
||||
splitNameLitAux (ss.drop 1) acc
|
||||
else if ss.isEmpty then
|
||||
acc
|
||||
else
|
||||
none
|
||||
[]
|
||||
if ss.isEmpty then []
|
||||
else
|
||||
let curr := ss.front
|
||||
if isIdBeginEscape curr then
|
||||
let escapedPart := ss.takeWhile (!isIdEndEscape ·)
|
||||
let escapedPart := { escapedPart with stopPos := ss.stopPos.min (escapedPart.str.next escapedPart.stopPos) }
|
||||
if !isIdEndEscape (escapedPart.get <| escapedPart.prev escapedPart.bsize) then []
|
||||
else splitRest (ss.extract escapedPart.bsize ss.bsize) (escapedPart :: acc)
|
||||
else if isIdFirst curr then
|
||||
let idPart := ss.takeWhile isIdRest
|
||||
splitRest (ss.extract idPart.bsize ss.bsize) (idPart :: acc)
|
||||
else
|
||||
[]
|
||||
|
||||
/-- Split a name literal (without the backtick) into its dot-separated components. For example,
|
||||
`foo.bla.«bo.o»` ↦ `["foo", "bla", "«bo.o»"]`. If the literal cannot be parsed, return `[]`. -/
|
||||
def splitNameLit (ss : Substring) : List Substring :=
|
||||
splitNameLitAux ss [] |>.reverse
|
||||
|
||||
def decodeNameLit (s : String) : Option Name :=
|
||||
if s.get 0 == '`' then
|
||||
decodeNameLitAux s 1 Name.anonymous
|
||||
match splitNameLitAux (s.toSubstring.drop 1) [] with
|
||||
| [] => none
|
||||
| comps => some <| comps.foldr (init := Name.anonymous)
|
||||
fun comp n =>
|
||||
let comp := if isIdBeginEscape comp.front then comp.drop 1 |>.dropRight 1 else comp
|
||||
Name.mkStr n comp.toString
|
||||
else
|
||||
none
|
||||
|
||||
|
|
@ -753,10 +763,6 @@ macro_rules
|
|||
|
||||
macro "eval_prec " p:prec:max : term => return quote (← evalPrec p)
|
||||
|
||||
def evalOptPrec : Option Syntax → MacroM Nat
|
||||
| some prec => evalPrec prec
|
||||
| none => return 0
|
||||
|
||||
/- Evaluator for `prio` DSL -/
|
||||
def evalPrio (stx : Syntax) : MacroM Nat :=
|
||||
Macro.withIncRecDepth stx do
|
||||
|
|
|
|||
6
stage0/src/Init/NotationExtra.lean
generated
6
stage0/src/Init/NotationExtra.lean
generated
|
|
@ -20,9 +20,9 @@ macro_rules
|
|||
-- Auxiliary parsers and functions for declaring notation with binders
|
||||
|
||||
syntax binderIdent := ident <|> "_"
|
||||
syntax unbracktedExplicitBinders := binderIdent+ (" : " term)?
|
||||
syntax unbracketedExplicitBinders := binderIdent+ (" : " term)?
|
||||
syntax bracketedExplicitBinders := "(" binderIdent+ " : " term ")"
|
||||
syntax explicitBinders := bracketedExplicitBinders+ <|> unbracktedExplicitBinders
|
||||
syntax explicitBinders := bracketedExplicitBinders+ <|> unbracketedExplicitBinders
|
||||
|
||||
def expandExplicitBindersAux (combinator : Syntax) (idents : Array Syntax) (type? : Option Syntax) (body : Syntax) : MacroM Syntax :=
|
||||
let rec loop (i : Nat) (acc : Syntax) := do
|
||||
|
|
@ -51,7 +51,7 @@ def expandBrackedBindersAux (combinator : Syntax) (binders : Array Syntax) (body
|
|||
def expandExplicitBinders (combinatorDeclName : Name) (explicitBinders : Syntax) (body : Syntax) : MacroM Syntax := do
|
||||
let combinator := mkIdentFrom (← getRef) combinatorDeclName
|
||||
let explicitBinders := explicitBinders[0]
|
||||
if explicitBinders.getKind == `Lean.unbracktedExplicitBinders then
|
||||
if explicitBinders.getKind == `Lean.unbracketedExplicitBinders then
|
||||
let idents := explicitBinders[0].getArgs
|
||||
let type? := if explicitBinders[1].isNone then none else some explicitBinders[1][1]
|
||||
expandExplicitBindersAux combinator idents type? body
|
||||
|
|
|
|||
2
stage0/src/Init/Prelude.lean
generated
2
stage0/src/Init/Prelude.lean
generated
|
|
@ -1841,7 +1841,7 @@ def mkAtom (val : String) : Syntax :=
|
|||
Syntax.atom SourceInfo.none val
|
||||
|
||||
def mkAtomFrom (src : Syntax) (val : String) : Syntax :=
|
||||
Syntax.atom src.getHeadInfo val
|
||||
Syntax.atom (SourceInfo.fromRef src) val
|
||||
|
||||
/- Parser descriptions -/
|
||||
|
||||
|
|
|
|||
2
stage0/src/Lean/Data.lean
generated
2
stage0/src/Lean/Data.lean
generated
|
|
@ -4,7 +4,9 @@ Released under Apache 2.0 license as described in the file LICENSE.
|
|||
Authors: Sebastian Ullrich
|
||||
-/
|
||||
import Lean.Data.Format
|
||||
import Lean.Data.Parsec
|
||||
import Lean.Data.Json
|
||||
import Lean.Data.Xml
|
||||
import Lean.Data.JsonRpc
|
||||
import Lean.Data.KVMap
|
||||
import Lean.Data.LBool
|
||||
|
|
|
|||
139
stage0/src/Lean/Data/Json/Parser.lean
generated
139
stage0/src/Lean/Data/Json/Parser.lean
generated
|
|
@ -5,104 +5,19 @@ Released under Apache 2.0 license as described in the file LICENSE.
|
|||
Authors: Gabriel Ebner, Marc Huisinga
|
||||
-/
|
||||
import Lean.Data.Json.Basic
|
||||
import Lean.Data.Parsec
|
||||
|
||||
namespace Lean
|
||||
|
||||
open Std (RBNode RBNode.singleton RBNode.leaf)
|
||||
|
||||
inductive Quickparse.Result (α : Type) where
|
||||
| success (pos : String.Iterator) (res : α) : Result α
|
||||
| error (pos : String.Iterator) (err : String) : Result α
|
||||
|
||||
def Quickparse (α : Type) : Type := String.Iterator → Lean.Quickparse.Result α
|
||||
|
||||
instance (α : Type) : Inhabited (Quickparse α) :=
|
||||
⟨fun it => Quickparse.Result.error it ""⟩
|
||||
|
||||
namespace Quickparse
|
||||
|
||||
open Result
|
||||
|
||||
partial def skipWs (it : String.Iterator) : String.Iterator :=
|
||||
if it.hasNext then
|
||||
let c := it.curr
|
||||
if c = '\u0009' ∨ c = '\u000a' ∨ c = '\u000d' ∨ c = '\u0020' then
|
||||
skipWs it.next
|
||||
else
|
||||
it
|
||||
else
|
||||
it
|
||||
|
||||
@[inline]
|
||||
protected def pure (a : α) : Quickparse α := fun it =>
|
||||
success it a
|
||||
|
||||
@[inline]
|
||||
protected def bind {α β : Type} (f : Quickparse α) (g : α → Quickparse β) : Quickparse β := fun it =>
|
||||
match f it with
|
||||
| success rem a => g a rem
|
||||
| error pos msg => error pos msg
|
||||
|
||||
@[inline]
|
||||
def fail (msg : String) : Quickparse α := fun it =>
|
||||
error it msg
|
||||
|
||||
@[inline]
|
||||
instance : Monad Quickparse :=
|
||||
{ pure := @Quickparse.pure, bind := @Quickparse.bind }
|
||||
|
||||
def unexpectedEndOfInput := "unexpected end of input"
|
||||
|
||||
@[inline]
|
||||
def peek? : Quickparse (Option Char) := fun it =>
|
||||
if it.hasNext then
|
||||
success it it.curr
|
||||
else
|
||||
success it none
|
||||
|
||||
@[inline]
|
||||
def peek! : Quickparse Char := do
|
||||
let some c ← peek? | fail unexpectedEndOfInput
|
||||
c
|
||||
|
||||
@[inline]
|
||||
def skip : Quickparse Unit := fun it =>
|
||||
success it.next ()
|
||||
|
||||
@[inline]
|
||||
def next : Quickparse Char := do
|
||||
let c ← peek!
|
||||
skip
|
||||
c
|
||||
|
||||
def expect (s : String) : Quickparse Unit := fun it =>
|
||||
if it.extract (it.forward s.length) = s then
|
||||
success (it.forward s.length) ()
|
||||
else
|
||||
error it s!"expected: {s}"
|
||||
|
||||
@[inline]
|
||||
def ws : Quickparse Unit := fun it =>
|
||||
success (skipWs it) ()
|
||||
|
||||
def expectedEndOfInput := "expected end of input"
|
||||
|
||||
@[inline]
|
||||
def eoi : Quickparse Unit := fun it =>
|
||||
if it.hasNext then
|
||||
error it expectedEndOfInput
|
||||
else
|
||||
success it ()
|
||||
|
||||
end Quickparse
|
||||
|
||||
namespace Json.Parser
|
||||
|
||||
open Quickparse
|
||||
open Lean.Parsec
|
||||
|
||||
@[inline]
|
||||
def hexChar : Quickparse Nat := do
|
||||
let c ← next
|
||||
def hexChar : Parsec Nat := do
|
||||
let c ← anyChar
|
||||
if '0' ≤ c ∧ c ≤ '9' then
|
||||
pure $ c.val.toNat - '0'.val.toNat
|
||||
else if 'a' ≤ c ∧ c ≤ 'f' then
|
||||
|
|
@ -112,8 +27,8 @@ def hexChar : Quickparse Nat := do
|
|||
else
|
||||
fail "invalid hex character"
|
||||
|
||||
def escapedChar : Quickparse Char := do
|
||||
let c ← next
|
||||
def escapedChar : Parsec Char := do
|
||||
let c ← anyChar
|
||||
match c with
|
||||
| '\\' => '\\'
|
||||
| '"' => '"'
|
||||
|
|
@ -128,13 +43,13 @@ def escapedChar : Quickparse Char := do
|
|||
Char.ofNat $ 4096*u1 + 256*u2 + 16*u3 + u4
|
||||
| _ => fail "illegal \\u escape"
|
||||
|
||||
partial def strCore (acc : String) : Quickparse String := do
|
||||
partial def strCore (acc : String) : Parsec String := do
|
||||
let c ← peek!
|
||||
if c = '"' then -- "
|
||||
skip
|
||||
acc
|
||||
else
|
||||
let c ← next
|
||||
let c ← anyChar
|
||||
let ec ←
|
||||
if c = '\\' then
|
||||
escapedChar
|
||||
|
|
@ -147,9 +62,9 @@ partial def strCore (acc : String) : Quickparse String := do
|
|||
fail "unexpected character in string"
|
||||
strCore (acc.push ec)
|
||||
|
||||
def str : Quickparse String := strCore ""
|
||||
def str : Parsec String := strCore ""
|
||||
|
||||
partial def natCore (acc digits : Nat) : Quickparse (Nat × Nat) := do
|
||||
partial def natCore (acc digits : Nat) : Parsec (Nat × Nat) := do
|
||||
let some c ← peek? | (acc, digits)
|
||||
if '0' ≤ c ∧ c ≤ '9' then
|
||||
skip
|
||||
|
|
@ -159,7 +74,7 @@ partial def natCore (acc digits : Nat) : Quickparse (Nat × Nat) := do
|
|||
(acc, digits)
|
||||
|
||||
@[inline]
|
||||
def lookahead (p : Char → Prop) (desc : String) [DecidablePred p] : Quickparse Unit := do
|
||||
def lookahead (p : Char → Prop) (desc : String) [DecidablePred p] : Parsec Unit := do
|
||||
let c ← peek!
|
||||
if p c then
|
||||
()
|
||||
|
|
@ -167,22 +82,22 @@ def lookahead (p : Char → Prop) (desc : String) [DecidablePred p] : Quickparse
|
|||
fail $ "expected " ++ desc
|
||||
|
||||
@[inline]
|
||||
def natNonZero : Quickparse Nat := do
|
||||
def natNonZero : Parsec Nat := do
|
||||
lookahead (fun c => '1' ≤ c ∧ c ≤ '9') "1-9"
|
||||
let (n, _) ← natCore 0 0
|
||||
n
|
||||
|
||||
@[inline]
|
||||
def natNumDigits : Quickparse (Nat × Nat) := do
|
||||
def natNumDigits : Parsec (Nat × Nat) := do
|
||||
lookahead (fun c => '0' ≤ c ∧ c ≤ '9') "digit"
|
||||
natCore 0 0
|
||||
|
||||
@[inline]
|
||||
def natMaybeZero : Quickparse Nat := do
|
||||
def natMaybeZero : Parsec Nat := do
|
||||
let (n, _) ← natNumDigits
|
||||
n
|
||||
|
||||
def num : Quickparse JsonNumber := do
|
||||
def num : Parsec JsonNumber := do
|
||||
let c ← peek!
|
||||
let sign : Int ←
|
||||
if c = '-' then
|
||||
|
|
@ -224,10 +139,10 @@ def num : Quickparse JsonNumber := do
|
|||
else
|
||||
res
|
||||
|
||||
partial def arrayCore (anyCore : Unit → Quickparse Json) (acc : Array Json) : Quickparse (Array Json) := do
|
||||
partial def arrayCore (anyCore : Unit → Parsec Json) (acc : Array Json) : Parsec (Array Json) := do
|
||||
let hd ← anyCore ()
|
||||
let acc' := acc.push hd
|
||||
let c ← next
|
||||
let c ← anyChar
|
||||
if c = ']' then
|
||||
ws
|
||||
acc'
|
||||
|
|
@ -237,12 +152,12 @@ partial def arrayCore (anyCore : Unit → Quickparse Json) (acc : Array Json) :
|
|||
else
|
||||
fail "unexpected character in array"
|
||||
|
||||
partial def objectCore (anyCore : Unit → Quickparse Json) : Quickparse (RBNode String (fun _ => Json)) := do
|
||||
partial def objectCore (anyCore : Unit → Parsec Json) : Parsec (RBNode String (fun _ => Json)) := do
|
||||
lookahead (fun c => c = '"') "\""; skip; -- "
|
||||
let k ← strCore ""; ws
|
||||
lookahead (fun c => c = ':') ":"; skip; ws
|
||||
let v ← anyCore ()
|
||||
let c ← next
|
||||
let c ← anyChar
|
||||
if c = '}' then
|
||||
ws
|
||||
RBNode.singleton k v
|
||||
|
|
@ -255,7 +170,7 @@ partial def objectCore (anyCore : Unit → Quickparse Json) : Quickparse (RBNode
|
|||
|
||||
-- takes a unit parameter so that
|
||||
-- we can use the equation compiler and recursion
|
||||
partial def anyCore (u : Unit) : Quickparse Json := do
|
||||
partial def anyCore (u : Unit) : Parsec Json := do
|
||||
let c ← peek!
|
||||
if c = '[' then
|
||||
skip; ws
|
||||
|
|
@ -281,13 +196,13 @@ partial def anyCore (u : Unit) : Quickparse Json := do
|
|||
ws
|
||||
Json.str s
|
||||
else if c = 'f' then
|
||||
expect "false"; ws
|
||||
skipString "false"; ws
|
||||
Json.bool false
|
||||
else if c = 't' then
|
||||
expect "true"; ws
|
||||
skipString "true"; ws
|
||||
Json.bool true
|
||||
else if c = 'n' then
|
||||
expect "null"; ws
|
||||
skipString "null"; ws
|
||||
Json.null
|
||||
else if c = '-' ∨ ('0' ≤ c ∧ c ≤ '9') then
|
||||
let n ← num
|
||||
|
|
@ -297,10 +212,10 @@ partial def anyCore (u : Unit) : Quickparse Json := do
|
|||
fail "unexpected input"
|
||||
|
||||
|
||||
def any : Quickparse Json := do
|
||||
def any : Parsec Json := do
|
||||
ws
|
||||
let res ← anyCore ()
|
||||
eoi
|
||||
eof
|
||||
res
|
||||
|
||||
end Json.Parser
|
||||
|
|
@ -309,8 +224,8 @@ namespace Json
|
|||
|
||||
def parse (s : String) : Except String Lean.Json :=
|
||||
match Json.Parser.any s.mkIterator with
|
||||
| Quickparse.Result.success _ res => Except.ok res
|
||||
| Quickparse.Result.error it err => Except.error s!"offset {it.i.repr}: {err}"
|
||||
| Parsec.ParseResult.success _ res => Except.ok res
|
||||
| Parsec.ParseResult.error it err => Except.error s!"offset {it.i.repr}: {err}"
|
||||
|
||||
end Json
|
||||
|
||||
|
|
|
|||
170
stage0/src/Lean/Data/Parsec.lean
generated
Normal file
170
stage0/src/Lean/Data/Parsec.lean
generated
Normal file
|
|
@ -0,0 +1,170 @@
|
|||
|
||||
/-
|
||||
Copyright (c) 2021 Microsoft Corporation. All rights reserved.
|
||||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Author: Dany Fabian
|
||||
-/
|
||||
|
||||
namespace Lean
|
||||
|
||||
namespace Parsec
|
||||
inductive ParseResult (α : Type) where
|
||||
| success (pos : String.Iterator) (res : α)
|
||||
| error (pos : String.Iterator) (err : String)
|
||||
deriving Repr
|
||||
end Parsec
|
||||
|
||||
def Parsec (α : Type) : Type := String.Iterator → Lean.Parsec.ParseResult α
|
||||
|
||||
namespace Parsec
|
||||
|
||||
open ParseResult
|
||||
|
||||
instance (α : Type) : Inhabited (Parsec α) :=
|
||||
⟨λ it => error it ""⟩
|
||||
|
||||
@[inline]
|
||||
protected def pure (a : α) : Parsec α := λ it =>
|
||||
success it a
|
||||
|
||||
@[inline]
|
||||
def bind {α β : Type} (f : Parsec α) (g : α → Parsec β) : Parsec β := λ it =>
|
||||
match f it with
|
||||
| success rem a => g a rem
|
||||
| error pos msg => error pos msg
|
||||
|
||||
instance : Monad Parsec :=
|
||||
{ pure := Parsec.pure, bind }
|
||||
|
||||
@[inline]
|
||||
def fail (msg : String) : Parsec α := fun it =>
|
||||
error it msg
|
||||
|
||||
@[inline]
|
||||
def orElse (p q : Parsec α) : Parsec α := fun it =>
|
||||
match p it with
|
||||
| success rem a => success rem a
|
||||
| error rem err =>
|
||||
if it = rem then q it else error rem err
|
||||
|
||||
@[inline]
|
||||
def attempt (p : Parsec α) : Parsec α := λ it =>
|
||||
match p it with
|
||||
| success rem res => success rem res
|
||||
| error _ err => error it err
|
||||
|
||||
instance : Alternative Parsec :=
|
||||
{ failure := fail "", orElse }
|
||||
|
||||
def expectedEndOfInput := "expected end of input"
|
||||
|
||||
@[inline]
|
||||
def eof : Parsec Unit := fun it =>
|
||||
if it.hasNext then
|
||||
error it expectedEndOfInput
|
||||
else
|
||||
success it ()
|
||||
|
||||
@[inline]
|
||||
partial def manyCore (p : Parsec α) (acc : Array α) : Parsec $ Array α :=
|
||||
(do manyCore p (acc.push $ ←p))
|
||||
<|> pure acc
|
||||
|
||||
@[inline]
|
||||
def many (p : Parsec α) : Parsec $ Array α := manyCore p #[]
|
||||
|
||||
@[inline]
|
||||
def many1 (p : Parsec α) : Parsec $ Array α := do manyCore p #[←p]
|
||||
|
||||
@[inline]
|
||||
partial def manyCharsCore (p : Parsec Char) (acc : String) : Parsec String :=
|
||||
(do manyCharsCore p (acc.push $ ←p))
|
||||
<|> pure acc
|
||||
|
||||
@[inline]
|
||||
def manyChars (p : Parsec Char) : Parsec String := manyCharsCore p ""
|
||||
|
||||
@[inline]
|
||||
def many1Chars (p : Parsec Char) : Parsec String := do manyCharsCore p (←p).toString
|
||||
|
||||
def pstring (s : String) : Parsec String := λ it =>
|
||||
let substr := it.extract (it.forward s.length)
|
||||
if substr = s then
|
||||
success (it.forward s.length) substr
|
||||
else
|
||||
error it s!"expected: {s}"
|
||||
|
||||
@[inline]
|
||||
def skipString (s : String) : Parsec Unit := pstring s *> pure ()
|
||||
|
||||
def unexpectedEndOfInput := "unexpected end of input"
|
||||
|
||||
@[inline]
|
||||
def anyChar : Parsec Char := λ it =>
|
||||
if it.hasNext then success it.next it.curr else error it unexpectedEndOfInput
|
||||
|
||||
@[inline]
|
||||
def pchar (c : Char) : Parsec Char := attempt do
|
||||
if (←anyChar) = c then pure c else fail s!"expected: '{c}'"
|
||||
|
||||
@[inline]
|
||||
def skipChar (c : Char) : Parsec Unit := pchar c *> pure ()
|
||||
|
||||
@[inline]
|
||||
def digit : Parsec Char := attempt do
|
||||
let c ← anyChar
|
||||
if '0' ≤ c ∧ c ≤ '9' then c else fail s!"digit expected"
|
||||
|
||||
@[inline]
|
||||
def hexDigit : Parsec Char := attempt do
|
||||
let c ← anyChar
|
||||
if ('0' ≤ c ∧ c ≤ '9')
|
||||
∨ ('a' ≤ c ∧ c ≤ 'a')
|
||||
∨ ('A' ≤ c ∧ c ≤ 'A') then c else fail s!"hex digit expected"
|
||||
|
||||
@[inline]
|
||||
def asciiLetter : Parsec Char := attempt do
|
||||
let c ← anyChar
|
||||
if ('A' ≤ c ∧ c ≤ 'Z') ∨ ('a' ≤ c ∧ c ≤ 'z') then c else fail s!"ASCII letter expected"
|
||||
|
||||
@[inline]
|
||||
def satisfy (p : Char → Bool) : Parsec Char := attempt do
|
||||
let c ← anyChar
|
||||
if p c then c else fail "condition not satisfied"
|
||||
|
||||
@[inline]
|
||||
def notFollowedBy (p : Parsec α) : Parsec Unit := λ it =>
|
||||
match p it with
|
||||
| success _ _ => error it ""
|
||||
| error _ _ => success it ()
|
||||
|
||||
partial def skipWs (it : String.Iterator) : String.Iterator :=
|
||||
if it.hasNext then
|
||||
let c := it.curr
|
||||
if c = '\u0009' ∨ c = '\u000a' ∨ c = '\u000d' ∨ c = '\u0020' then
|
||||
skipWs it.next
|
||||
else
|
||||
it
|
||||
else
|
||||
it
|
||||
|
||||
@[inline]
|
||||
def peek? : Parsec (Option Char) := fun it =>
|
||||
if it.hasNext then
|
||||
success it it.curr
|
||||
else
|
||||
success it none
|
||||
|
||||
@[inline]
|
||||
def peek! : Parsec Char := do
|
||||
let some c ← peek? | fail unexpectedEndOfInput
|
||||
c
|
||||
|
||||
@[inline]
|
||||
def skip : Parsec Unit := fun it =>
|
||||
success it.next ()
|
||||
|
||||
@[inline]
|
||||
def ws : Parsec Unit := fun it =>
|
||||
success (skipWs it) ()
|
||||
end Parsec
|
||||
2
stage0/src/Lean/Data/Xml.lean
generated
Normal file
2
stage0/src/Lean/Data/Xml.lean
generated
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
import Lean.Data.Xml.Basic
|
||||
import Lean.Data.Xml.Parser
|
||||
41
stage0/src/Lean/Data/Xml/Basic.lean
generated
Normal file
41
stage0/src/Lean/Data/Xml/Basic.lean
generated
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
|
||||
/-
|
||||
Copyright (c) 2021 Microsoft Corporation. All rights reserved.
|
||||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Author: Dany Fabian
|
||||
-/
|
||||
|
||||
import Std.Data.RBMap
|
||||
namespace Lean
|
||||
namespace Xml
|
||||
|
||||
def Attributes := Std.RBMap String String compare
|
||||
instance : ToString Attributes := ⟨λ as => as.fold (λ s n v => s ++ s!" {n}=\"{v}\"") ""⟩
|
||||
|
||||
mutual
|
||||
inductive Element
|
||||
| Element
|
||||
(name : String)
|
||||
(attributes : Attributes)
|
||||
(content : Array Content)
|
||||
|
||||
inductive Content
|
||||
| Element (element : Element)
|
||||
| Comment (comment : String)
|
||||
| Character (content : String)
|
||||
deriving Inhabited
|
||||
end
|
||||
|
||||
mutual
|
||||
private partial def eToString : Element → String
|
||||
| Element.Element n a c => s!"<{n}{a}>{c.map cToString |>.foldl (· ++ ·) ""}</{n}>"
|
||||
|
||||
private partial def cToString : Content → String
|
||||
| Content.Element e => eToString e
|
||||
| Content.Comment c => s!"<!--{c}-->"
|
||||
| Content.Character c => c
|
||||
|
||||
end
|
||||
instance : ToString Element := ⟨eToString⟩
|
||||
instance : ToString Content := ⟨cToString⟩
|
||||
|
||||
488
stage0/src/Lean/Data/Xml/Parser.lean
generated
Normal file
488
stage0/src/Lean/Data/Xml/Parser.lean
generated
Normal file
|
|
@ -0,0 +1,488 @@
|
|||
/-
|
||||
Copyright (c) 2021 Microsoft Corporation. All rights reserved.
|
||||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Author: Dany Fabian
|
||||
-/
|
||||
|
||||
import Lean.Data.Parsec
|
||||
import Lean.Data.Xml.Basic
|
||||
open IO
|
||||
open System
|
||||
open Lean
|
||||
|
||||
namespace Lean
|
||||
namespace Xml
|
||||
|
||||
namespace Parser
|
||||
open Lean.Parsec
|
||||
open Parsec.ParseResult
|
||||
|
||||
abbrev LeanChar := Char
|
||||
|
||||
/-- consume a newline character sequence pretending, that we read '\n'. As per spec:
|
||||
https://www.w3.org/TR/xml/#sec-line-ends -/
|
||||
def endl : Parsec LeanChar := (skipString "\r\n" <|> skipChar '\r' <|> skipChar '\n') *> pure '\n'
|
||||
|
||||
def quote (p : Parsec α) : Parsec α :=
|
||||
skipChar '\'' *> p <* skipChar '\''
|
||||
<|> skipChar '"' *> p <* skipChar '"'
|
||||
|
||||
/-- https://www.w3.org/TR/xml/#NT-Char -/
|
||||
def Char : Parsec LeanChar :=
|
||||
(attempt do
|
||||
let c ← anyChar
|
||||
let cNat ← c.toNat
|
||||
if (0x20 ≤ cNat ∧ cNat ≤ 0xD7FF)
|
||||
∨ (0xE000 ≤ cNat ∧ cNat ≤ 0xFFFD)
|
||||
∨ (0x10000 ≤ cNat ∧ cNat ≤ 0x10FFFF) then c else fail "expected xml char")
|
||||
<|> pchar '\t' <|> endl
|
||||
|
||||
/-- https://www.w3.org/TR/xml/#NT-S -/
|
||||
def S : Parsec String :=
|
||||
many1Chars (pchar ' ' <|> endl <|> pchar '\t')
|
||||
|
||||
/-- https://www.w3.org/TR/xml/#NT-Eq -/
|
||||
def Eq : Parsec Unit :=
|
||||
optional S *> skipChar '=' <* optional S
|
||||
|
||||
private def nameStartCharRanges : Array (Nat × Nat) :=
|
||||
#[(0xC0, 0xD6),
|
||||
(0xD8, 0xF6),
|
||||
(0xF8, 0x2FF),
|
||||
(0x370, 0x37D),
|
||||
(0x37F, 0x1FFF),
|
||||
(0x200C, 0x200D),
|
||||
(0x2070, 0x218F),
|
||||
(0x2C00, 0x2FEF),
|
||||
(0x3001, 0xD7FF),
|
||||
(0xF900, 0xFDCF),
|
||||
(0xFDF0, 0xFFFD),
|
||||
(0x10000, 0xEFFFF)]
|
||||
|
||||
/-- https://www.w3.org/TR/xml/#NT-NameStartChar -/
|
||||
def NameStartChar : Parsec LeanChar := attempt do
|
||||
let c ← anyChar
|
||||
if ('A' ≤ c ∧ c ≤ 'Z') ∨ ('a' ≤ c ∧ c ≤ 'z') then c
|
||||
else if c = ':' ∨ c = '_' then c
|
||||
else
|
||||
let cNum := c.toNat
|
||||
if nameStartCharRanges.any (fun (lo, hi) => lo ≤ cNum ∧ cNum ≤ hi) then c
|
||||
else fail "expected a name character"
|
||||
|
||||
/-- https://www.w3.org/TR/xml/#NT-NameChar -/
|
||||
def NameChar : Parsec LeanChar :=
|
||||
NameStartChar <|> digit <|> pchar '-' <|> pchar '.' <|> pchar '\xB7'
|
||||
<|> satisfy (λ c => ('\u0300' ≤ c ∧ c ≤ '\u036F') ∨ ('\u203F' ≤ c ∧ c ≤ '\u2040'))
|
||||
|
||||
/-- https://www.w3.org/TR/xml/#NT-Name -/
|
||||
def Name : Parsec String := do
|
||||
let x ← NameStartChar
|
||||
manyCharsCore NameChar x.toString
|
||||
|
||||
/-- https://www.w3.org/TR/xml/#NT-VersionNum -/
|
||||
def VersionNum : Parsec Unit :=
|
||||
skipString "1." <* (many1 digit)
|
||||
|
||||
/-- https://www.w3.org/TR/xml/#NT-VersionInfo -/
|
||||
def VersionInfo : Parsec Unit := do
|
||||
S *>
|
||||
skipString "version"
|
||||
Eq
|
||||
quote VersionNum
|
||||
|
||||
/-- https://www.w3.org/TR/xml/#NT-EncName -/
|
||||
def EncName : Parsec String := do
|
||||
let x ← asciiLetter
|
||||
manyCharsCore (asciiLetter <|> digit <|> pchar '-' <|> pchar '_' <|> pchar '.') x.toString
|
||||
|
||||
/-- https://www.w3.org/TR/xml/#NT-EncodingDecl -/
|
||||
def EncodingDecl : Parsec String := do
|
||||
S *>
|
||||
skipString "encoding"
|
||||
Eq
|
||||
quote EncName
|
||||
|
||||
/-- https://www.w3.org/TR/xml/#NT-SDDecl -/
|
||||
def SDDecl : Parsec String := do
|
||||
S *> skipString "standalone" *> Eq *> quote (pstring "yes" <|> pstring "no")
|
||||
|
||||
/-- https://www.w3.org/TR/xml/#NT-XMLDecl -/
|
||||
def XMLdecl : Parsec Unit := do
|
||||
skipString "<?xml"
|
||||
VersionInfo
|
||||
optional EncodingDecl *>
|
||||
optional SDDecl *>
|
||||
optional S *>
|
||||
skipString "?>"
|
||||
|
||||
/-- https://www.w3.org/TR/xml/#NT-Comment -/
|
||||
def Comment : Parsec String :=
|
||||
let notDash := Char.toString <$> satisfy (λ c => c ≠ '-')
|
||||
skipString "<!--" *>
|
||||
Array.foldl String.append "" <$> many (notDash <|> (do
|
||||
let d ← pchar '-'
|
||||
let c ← notDash
|
||||
pure $ d.toString ++ c))
|
||||
<* skipString "-->"
|
||||
|
||||
/-- https://www.w3.org/TR/xml/#NT-PITarget -/
|
||||
def PITarget : Parsec String :=
|
||||
Name <* (skipChar 'X' <|> skipChar 'x') <* (skipChar 'M' <|> skipChar 'm') <* (skipChar 'L' <|> skipChar 'l')
|
||||
|
||||
/-- https://www.w3.org/TR/xml/#NT-PI -/
|
||||
def PI : Parsec Unit := do
|
||||
skipString "<?"
|
||||
<* PITarget <*
|
||||
optional (S *> manyChars (notFollowedBy (skipString "?>") *> Char))
|
||||
skipString "?>"
|
||||
|
||||
/-- https://www.w3.org/TR/xml/#NT-Misc -/
|
||||
def Misc : Parsec Unit :=
|
||||
Comment *> pure () <|> PI <|> S *> pure ()
|
||||
|
||||
/-- https://www.w3.org/TR/xml/#NT-SystemLiteral -/
|
||||
def SystemLiteral : Parsec String :=
|
||||
pchar '"' *> manyChars (satisfy λ c => c ≠ '"') <* pchar '"'
|
||||
<|> pchar '\'' *> manyChars (satisfy λ c => c ≠ '\'') <* '\''
|
||||
|
||||
/-- https://www.w3.org/TR/xml/#NT-PubidChar -/
|
||||
def PubidChar : Parsec LeanChar :=
|
||||
asciiLetter <|> digit <|> endl <|> attempt do
|
||||
let c ← anyChar
|
||||
if "-'()+,./:=?;!*#@$_%".contains c then c else fail "PublidChar expected"
|
||||
|
||||
/-- https://www.w3.org/TR/xml/#NT-PubidLiteral -/
|
||||
def PubidLiteral : Parsec String :=
|
||||
pchar '"' *> manyChars PubidChar <* pchar '"'
|
||||
<|> pchar '\'' *> manyChars (attempt do
|
||||
let c ← PubidChar
|
||||
if c = '\'' then fail "'\\'' not expected" else c) <* pchar '\''
|
||||
|
||||
/-- https://www.w3.org/TR/xml/#NT-ExternalID -/
|
||||
def ExternalID : Parsec Unit :=
|
||||
skipString "SYSTEM" *> S *> SystemLiteral *> pure ()
|
||||
<|> skipString "PUBLIC" *> S *> PubidLiteral *> S *> SystemLiteral *> pure ()
|
||||
|
||||
/-- https://www.w3.org/TR/xml/#NT-Mixed -/
|
||||
def Mixed : Parsec Unit :=
|
||||
(do
|
||||
skipChar '('
|
||||
optional S *>
|
||||
skipString "#PCDATA" *>
|
||||
many (optional S *> skipChar '|' *> optional S *> Name) *>
|
||||
optional S *>
|
||||
skipString ")*")
|
||||
<|> skipChar '(' *> (optional S) *> skipString "#PCDATA" <* (optional S) <* skipChar ')'
|
||||
|
||||
mutual
|
||||
/-- https://www.w3.org/TR/xml/#NT-cp -/
|
||||
partial def cp : Parsec Unit :=
|
||||
(Name *> pure () <|> choice <|> seq) <* optional (skipChar '?' <|> skipChar '*' <|> skipChar '+')
|
||||
|
||||
/-- https://www.w3.org/TR/xml/#NT-choice -/
|
||||
partial def choice : Parsec Unit := do
|
||||
skipChar '('
|
||||
optional S *>
|
||||
cp
|
||||
many1 (optional S *> skipChar '|' *> optional S *> cp) *>
|
||||
optional S *>
|
||||
skipChar ')'
|
||||
|
||||
/-- https://www.w3.org/TR/xml/#NT-seq -/
|
||||
partial def seq : Parsec Unit := do
|
||||
skipChar '('
|
||||
optional S *>
|
||||
cp
|
||||
many (optional S *> skipChar ',' *> optional S *> cp) *>
|
||||
optional S *>
|
||||
skipChar ')'
|
||||
end
|
||||
|
||||
/-- https://www.w3.org/TR/xml/#NT-children -/
|
||||
def children : Parsec Unit :=
|
||||
(choice <|> seq) <* optional (skipChar '?' <|> skipChar '*' <|> skipChar '+')
|
||||
|
||||
/-- https://www.w3.org/TR/xml/#NT-contentspec -/
|
||||
def contentspec : Parsec Unit := do
|
||||
skipString "EMPTY" <|> skipString "ANY" <|> Mixed <|> children
|
||||
|
||||
/-- https://www.w3.org/TR/xml/#NT-elementdecl -/
|
||||
def elementDecl : Parsec Unit := do
|
||||
skipString "<!ELEMENT"
|
||||
S *>
|
||||
Name *>
|
||||
contentspec *>
|
||||
optional S *>
|
||||
skipChar '>'
|
||||
|
||||
/-- https://www.w3.org/TR/xml/#NT-StringType -/
|
||||
def StringType : Parsec Unit :=
|
||||
skipString "CDATA"
|
||||
|
||||
/-- https://www.w3.org/TR/xml/#NT-TokenizedType -/
|
||||
def TokenizedType : Parsec Unit :=
|
||||
skipString "ID"
|
||||
<|> skipString "IDREF"
|
||||
<|> skipString "IDREFS"
|
||||
<|> skipString "ENTITY"
|
||||
<|> skipString "ENTITIES"
|
||||
<|> skipString "NMTOKEN"
|
||||
<|> skipString "NMTOKENS"
|
||||
|
||||
/-- https://www.w3.org/TR/xml/#NT-NotationType -/
|
||||
def NotationType : Parsec Unit := do
|
||||
skipString "NOTATION"
|
||||
S *>
|
||||
skipChar '(' <*
|
||||
optional S
|
||||
Name *> many (optional S *> skipChar '|' *> optional S *> Name) *>
|
||||
optional S *>
|
||||
skipChar ')'
|
||||
|
||||
/-- https://www.w3.org/TR/xml/#NT-Nmtoken -/
|
||||
def Nmtoken : Parsec String := do
|
||||
many1Chars NameChar
|
||||
|
||||
/-- https://www.w3.org/TR/xml/#NT-Enumeration -/
|
||||
def Enumeration : Parsec Unit := do
|
||||
skipChar '('
|
||||
optional S *>
|
||||
Nmtoken *> many (optional S *> skipChar '|' *> optional S *> Nmtoken) *>
|
||||
optional S *>
|
||||
skipChar ')'
|
||||
|
||||
/-- https://www.w3.org/TR/xml/#NT-EnumeratedType -/
|
||||
def EnumeratedType : Parsec Unit :=
|
||||
NotationType <|> Enumeration
|
||||
|
||||
/-- https://www.w3.org/TR/xml/#NT-AttType -/
|
||||
def AttType : Parsec Unit :=
|
||||
StringType <|> TokenizedType <|> EnumeratedType
|
||||
|
||||
def predefinedEntityToChar : String → Option LeanChar
|
||||
| "lt" => some '<'
|
||||
| "gt" => some '>'
|
||||
| "amp" => some '&'
|
||||
| "apos" => some '\''
|
||||
| "quot" => some '"'
|
||||
| _ => none
|
||||
|
||||
/-- https://www.w3.org/TR/xml/#NT-EntityRef -/
|
||||
def EntityRef : Parsec $ Option LeanChar := attempt $
|
||||
skipChar '&' *> predefinedEntityToChar <$> Name <* skipChar ';'
|
||||
|
||||
@[inline]
|
||||
def hexDigitToNat (c : LeanChar) : Nat :=
|
||||
if '0' ≤ c ∧ c ≤ '9' then c.toNat - '0'.toNat
|
||||
else if 'a' ≤ c ∧ c ≤ 'f' then c.toNat - 'a'.toNat + 10
|
||||
else c.toNat - 'A'.toNat + 10
|
||||
|
||||
def digitsToNat (base : Nat) (digits : Array Nat) : Nat :=
|
||||
digits.foldl (λ r d => r * base + d) 0
|
||||
|
||||
/-- https://www.w3.org/TR/xml/#NT-CharRef -/
|
||||
def CharRef : Parsec LeanChar := do
|
||||
skipString "&#"
|
||||
let charCode ←
|
||||
digitsToNat 10 <$> many1 (hexDigitToNat <$> digit)
|
||||
<|> skipChar 'x' *> digitsToNat 16 <$> many1 (hexDigitToNat <$> hexDigit)
|
||||
skipChar ';'
|
||||
Char.ofNat charCode
|
||||
|
||||
/-- https://www.w3.org/TR/xml/#NT-Reference -/
|
||||
def Reference : Parsec $ Option LeanChar :=
|
||||
EntityRef <|> some <$> CharRef
|
||||
|
||||
/-- https://www.w3.org/TR/xml/#NT-AttValue -/
|
||||
def AttValue : Parsec String := do
|
||||
let chars ←
|
||||
(do
|
||||
skipChar '"'
|
||||
many (some <$> satisfy (λ c => c ≠ '<' ∧ c ≠ '&' ∧ c ≠ '"') <|> Reference) <*
|
||||
skipChar '"')
|
||||
<|> (do
|
||||
skipChar '\''
|
||||
many (some <$> satisfy (λ c => c ≠ '<' ∧ c ≠ '&' ∧ c ≠ '\'') <|> Reference) <*
|
||||
skipChar '\'')
|
||||
return chars.foldl (λ s c => if let some c := c then s.push c else s) ""
|
||||
|
||||
/-- https://www.w3.org/TR/xml/#NT-DefaultDecl -/
|
||||
def DefaultDecl : Parsec Unit :=
|
||||
skipString "#REQUIRED"
|
||||
<|> skipString "#IMPLIED"
|
||||
<|> optional (skipString "#FIXED" <* S) *> AttValue *> pure ()
|
||||
|
||||
/-- https://www.w3.org/TR/xml/#NT-AttDef -/
|
||||
def AttDef : Parsec Unit :=
|
||||
S *> Name *> S *> AttType *> S *> DefaultDecl
|
||||
|
||||
/-- https://www.w3.org/TR/xml/#NT-AttlistDecl -/
|
||||
def AttlistDecl : Parsec Unit :=
|
||||
skipString "<!ATTLIST" *> S *> Name *> many AttDef *> optional S *> skipChar '>'
|
||||
|
||||
/-- https://www.w3.org/TR/xml/#NT-PEReference -/
|
||||
def PEReference : Parsec Unit :=
|
||||
skipChar '%' *> Name *> skipChar ';'
|
||||
|
||||
/-- https://www.w3.org/TR/xml/#NT-EntityValue -/
|
||||
def EntityValue : Parsec String := do
|
||||
let chars ←
|
||||
(do
|
||||
skipChar '"'
|
||||
many (some <$> satisfy (λ c => c ≠ '%' ∧ c ≠ '&' ∧ c ≠ '"') <|> PEReference *> pure none <|> Reference) <*
|
||||
skipChar '"')
|
||||
<|> (do
|
||||
skipChar '\''
|
||||
many (some <$> satisfy (λ c => c ≠ '%' ∧ c ≠ '&' ∧ c ≠ '\'') <|> PEReference *> pure none <|> Reference) <*
|
||||
skipChar '\'')
|
||||
return chars.foldl (λ s c => if let some c := c then s.push c else s) ""
|
||||
|
||||
|
||||
/-- https://www.w3.org/TR/xml/#NT-NDataDecl -/
|
||||
def NDataDecl : Parsec Unit :=
|
||||
S *> skipString "NDATA" <* S <* Name
|
||||
|
||||
/-- https://www.w3.org/TR/xml/#NT-EntityDef -/
|
||||
def EntityDef : Parsec Unit :=
|
||||
EntityValue *> pure () <|> (ExternalID <* optional NDataDecl)
|
||||
|
||||
/-- https://www.w3.org/TR/xml/#NT-GEDecl -/
|
||||
def GEDecl : Parsec Unit :=
|
||||
skipString "<!ENTITY" *> S *> Name *> S *> EntityDef *> optional S *> skipChar '>'
|
||||
|
||||
/-- https://www.w3.org/TR/xml/#NT-PEDef -/
|
||||
def PEDef : Parsec Unit :=
|
||||
EntityValue *> pure () <|> ExternalID
|
||||
|
||||
/-- https://www.w3.org/TR/xml/#NT-PEDecl -/
|
||||
def PEDecl : Parsec Unit :=
|
||||
skipString "<!ENTITY" *> S *> skipChar '%' *> S *> Name *> PEDef *> optional S *> skipChar '>'
|
||||
|
||||
/-- https://www.w3.org/TR/xml/#NT-EntityDecl -/
|
||||
def EntityDecl : Parsec Unit :=
|
||||
GEDecl <|> PEDecl
|
||||
|
||||
/-- https://www.w3.org/TR/xml/#NT-PublicID -/
|
||||
def PublicID : Parsec Unit :=
|
||||
skipString "PUBLIC" <* S <* PubidLiteral
|
||||
|
||||
/-- https://www.w3.org/TR/xml/#NT-NotationDecl -/
|
||||
def NotationDecl : Parsec Unit :=
|
||||
skipString "<!NOTATION" *> S *> Name *> (ExternalID <|> PublicID) *> optional S *> skipChar '>'
|
||||
|
||||
/-- https://www.w3.org/TR/xml/#NT-markupdecl -/
|
||||
def markupDecl : Parsec Unit :=
|
||||
elementDecl <|> AttlistDecl <|> EntityDecl <|> NotationDecl <|> PI <|> (Comment *> pure ())
|
||||
|
||||
/-- https://www.w3.org/TR/xml/#NT-DeclSep -/
|
||||
def DeclSep : Parsec Unit :=
|
||||
PEReference <|> S *> pure ()
|
||||
|
||||
/-- https://www.w3.org/TR/xml/#NT-intSubset -/
|
||||
def intSubset : Parsec Unit :=
|
||||
many (markupDecl <|> DeclSep) *> pure ()
|
||||
|
||||
/-- https://www.w3.org/TR/xml/#NT-doctypedecl -/
|
||||
def doctypedecl : Parsec Unit := do
|
||||
skipString "<!DOCTYPE"
|
||||
S *>
|
||||
Name *>
|
||||
optional (S *> ExternalID) *> pure ()
|
||||
<* optional S
|
||||
optional (skipChar '[' *> intSubset <* skipChar ']' <* optional S) *>
|
||||
skipChar '>'
|
||||
|
||||
/-- https://www.w3.org/TR/xml/#NT-prolog -/
|
||||
def prolog : Parsec Unit :=
|
||||
optional XMLdecl *>
|
||||
many Misc *>
|
||||
optional (doctypedecl <* many Misc) *> pure ()
|
||||
|
||||
/-- https://www.w3.org/TR/xml/#NT-Attribute -/
|
||||
def Attribute : Parsec (String × String) := do
|
||||
let name ← Name
|
||||
Eq
|
||||
let value ← AttValue
|
||||
(name, value)
|
||||
|
||||
protected def elementPrefix : Parsec (Array Content → Element) := do
|
||||
skipChar '<'
|
||||
let name ← Name
|
||||
let attributes ← many (S *> Attribute)
|
||||
optional S *> pure ()
|
||||
Element.Element name (Std.RBMap.fromList attributes.toList compare)
|
||||
|
||||
/-- https://www.w3.org/TR/xml/#NT-EmptyElemTag -/
|
||||
def EmptyElemTag (elem : Array Content → Element) : Parsec Element := do
|
||||
skipString "/>" *> pure (elem #[])
|
||||
|
||||
/-- https://www.w3.org/TR/xml/#NT-STag -/
|
||||
def STag (elem : Array Content → Element) : Parsec (Array Content → Element) := do
|
||||
skipChar '>' *> pure elem
|
||||
|
||||
/-- https://www.w3.org/TR/xml/#NT-ETag -/
|
||||
def ETag : Parsec Unit :=
|
||||
skipString "</" *> Name *> optional S *> skipChar '>'
|
||||
|
||||
/-- https://www.w3.org/TR/xml/#NT-CDStart -/
|
||||
def CDStart : Parsec Unit :=
|
||||
skipString "<![CDATA["
|
||||
|
||||
/-- https://www.w3.org/TR/xml/#NT-CDEnd -/
|
||||
def CDEnd : Parsec Unit :=
|
||||
skipString "]]>"
|
||||
|
||||
/-- https://www.w3.org/TR/xml/#NT-CData -/
|
||||
def CData : Parsec String :=
|
||||
manyChars (notFollowedBy (skipString "]]>") *> anyChar)
|
||||
|
||||
/-- https://www.w3.org/TR/xml/#NT-CDSect -/
|
||||
def CDSect : Parsec String :=
|
||||
CDStart *> CData <* CDEnd
|
||||
|
||||
/-- https://www.w3.org/TR/xml/#NT-CharData -/
|
||||
def CharData : Parsec String :=
|
||||
notFollowedBy (skipString "]]>") *> manyChars (satisfy λ c => c ≠ '<' ∧ c ≠ '&')
|
||||
|
||||
mutual
|
||||
/-- https://www.w3.org/TR/xml/#NT-content -/
|
||||
partial def content : Parsec (Array Content) := do
|
||||
let x ← optional (Content.Character <$> CharData)
|
||||
let xs ← many do
|
||||
let y ←
|
||||
attempt (some <$> Content.Element <$> element)
|
||||
<|> (do let c ← Reference; c.map (Content.Character ∘ Char.toString))
|
||||
<|> some <$> Content.Character <$> CDSect
|
||||
<|> PI *> none
|
||||
<|> some <$> Content.Comment <$> Comment
|
||||
|
||||
let z ← optional (Content.Character <$> CharData)
|
||||
#[y, z]
|
||||
let xs := #[x] ++ xs.concatMap id |>.filterMap id
|
||||
let mut res := #[]
|
||||
for x in xs do
|
||||
if res.size > 0 then
|
||||
match res.back, x with
|
||||
| Content.Character x, Content.Character y => res ← res.set! (res.size - 1) (Content.Character $ x ++ y)
|
||||
| _, x => res ← res.push x
|
||||
else res ← res.push x
|
||||
res
|
||||
|
||||
/-- https://www.w3.org/TR/xml/#NT-element -/
|
||||
partial def element : Parsec Element := do
|
||||
let elem ← Parser.elementPrefix
|
||||
EmptyElemTag elem <|> STag elem <*> content <* ETag
|
||||
|
||||
end
|
||||
|
||||
/-- https://www.w3.org/TR/xml/#NT-document -/
|
||||
def document : Parsec Element := prolog *> element <* many Misc <* eof
|
||||
|
||||
end Parser
|
||||
|
||||
def parse (s : String) : Except String Element :=
|
||||
match Xml.Parser.document s.mkIterator with
|
||||
| Parsec.ParseResult.success _ res => Except.ok res
|
||||
| Parsec.ParseResult.error it err => Except.error s!"offset {it.i.repr}: {err}\n{(it.prevn 10).extract it}"
|
||||
|
||||
end Xml
|
||||
8
stage0/src/Lean/Elab/App.lean
generated
8
stage0/src/Lean/Elab/App.lean
generated
|
|
@ -673,7 +673,7 @@ private def elabAppLValsAux (namedArgs : Array NamedArg) (args : Array Arg) (exp
|
|||
| f, [] => elabAppArgs f namedArgs args expectedType? explicit ellipsis
|
||||
| f, lval::lvals => do
|
||||
if let LVal.fieldName (ref := fieldStx) (targetStx := targetStx) .. := lval then
|
||||
addDotCompletionInfo targetStx f expectedType? fieldStx
|
||||
addDotCompletionInfo targetStx f expectedType? fieldStx
|
||||
let (f, lvalRes) ← resolveLVal f lval
|
||||
match lvalRes with
|
||||
| LValResolution.projIdx structName idx =>
|
||||
|
|
@ -785,9 +785,9 @@ private partial def elabAppFn (f : Syntax) (lvals : List LVal) (namedArgs : Arra
|
|||
f.getArgs.foldlM (fun acc f => elabAppFn f lvals namedArgs args expectedType? explicit ellipsis true acc) acc
|
||||
else
|
||||
let elabFieldName (e field : Syntax) := do
|
||||
let newLVals := field.getId.eraseMacroScopes.components.map fun n =>
|
||||
-- We use `none` here since `field` can't be part of a composite name
|
||||
LVal.fieldName field (toString n) none e
|
||||
let newLVals := field.identComponents.map fun comp =>
|
||||
-- We use `none` in `suffix?` since `field` can't be part of a composite name
|
||||
LVal.fieldName comp (toString comp.getId) none e
|
||||
elabAppFn e (newLVals ++ lvals) namedArgs args expectedType? explicit ellipsis overloaded acc
|
||||
let elabFieldIdx (e idxStx : Syntax) := do
|
||||
let idx := idxStx.isFieldIdx?.get!
|
||||
|
|
|
|||
14
stage0/src/Lean/Elab/Binders.lean
generated
14
stage0/src/Lean/Elab/Binders.lean
generated
|
|
@ -107,19 +107,19 @@ private def matchBinder (stx : Syntax) : TermElabM (Array BinderView) := do
|
|||
if k == `Lean.Parser.Term.simpleBinder then
|
||||
-- binderIdent+ >> optType
|
||||
let ids ← getBinderIds stx[0]
|
||||
let type := expandOptType stx stx[1]
|
||||
let type := expandOptType (mkNullNode ids) stx[1]
|
||||
ids.mapM fun id => do pure { id := (← expandBinderIdent id), type := type, bi := BinderInfo.default }
|
||||
else if k == `Lean.Parser.Term.explicitBinder then
|
||||
-- `(` binderIdent+ binderType (binderDefault <|> binderTactic)? `)`
|
||||
let ids ← getBinderIds stx[1]
|
||||
let type := expandBinderType stx stx[2]
|
||||
let type := expandBinderType (mkNullNode ids) stx[2]
|
||||
let optModifier := stx[3]
|
||||
let type ← expandBinderModifier type optModifier
|
||||
ids.mapM fun id => do pure { id := (← expandBinderIdent id), type := type, bi := BinderInfo.default }
|
||||
else if k == `Lean.Parser.Term.implicitBinder then
|
||||
-- `{` binderIdent+ binderType `}`
|
||||
let ids ← getBinderIds stx[1]
|
||||
let type := expandBinderType stx stx[2]
|
||||
let type := expandBinderType (mkNullNode ids) stx[2]
|
||||
ids.mapM fun id => do pure { id := (← expandBinderIdent id), type := type, bi := BinderInfo.implicit }
|
||||
else if k == `Lean.Parser.Term.instBinder then
|
||||
-- `[` optIdent type `]`
|
||||
|
|
@ -133,7 +133,7 @@ private def registerFailedToInferBinderTypeInfo (type : Expr) (ref : Syntax) : T
|
|||
registerCustomErrorIfMVar type ref "failed to infer binder type"
|
||||
|
||||
private def addLocalVarInfo (stx : Syntax) (fvar : Expr) : TermElabM Unit := do
|
||||
addTermInfo (lctx? := some (← getLCtx)) stx fvar
|
||||
addTermInfo (isBinder := true) stx fvar
|
||||
|
||||
private def ensureAtomicBinderName (binderView : BinderView) : TermElabM Unit :=
|
||||
let n := binderView.id.getId.eraseMacroScopes
|
||||
|
|
@ -329,7 +329,7 @@ private partial def elabFunBinderViews (binderViews : Array BinderView) (i : Nat
|
|||
We do not believe this is an useful feature, and it would complicate the logic here.
|
||||
-/
|
||||
let lctx := s.lctx.mkLocalDecl fvarId binderView.id.getId type binderView.bi
|
||||
addTermInfo (lctx? := some lctx) binderView.id fvar
|
||||
addTermInfo (lctx? := some lctx) (isBinder := true) binderView.id fvar
|
||||
let s ← withRef binderView.id <| propagateExpectedType fvar type s
|
||||
let s := { s with lctx := lctx }
|
||||
match (← isClass? type) with
|
||||
|
|
@ -580,7 +580,7 @@ def mkLetIdDeclView (letIdDecl : Syntax) : LetIdDeclView :=
|
|||
let id := letIdDecl[0]
|
||||
let binders := letIdDecl[1].getArgs
|
||||
let optType := letIdDecl[2]
|
||||
let type := expandOptType letIdDecl optType
|
||||
let type := expandOptType id optType
|
||||
let value := letIdDecl[4]
|
||||
{ id := id, binders := binders, type := type, value := value }
|
||||
|
||||
|
|
@ -601,7 +601,7 @@ def elabLetDeclCore (stx : Syntax) (expectedType? : Option Expr) (useLetExpr : B
|
|||
-- node `Lean.Parser.Term.letPatDecl $ try (termParser >> pushNone >> optType >> " := ") >> termParser
|
||||
let pat := letDecl[0]
|
||||
let optType := letDecl[2]
|
||||
let type := expandOptType stx optType
|
||||
let type := expandOptType pat optType
|
||||
let val := letDecl[4]
|
||||
let stxNew ← `(let x : $type := $val; match x with | $pat => $body)
|
||||
let stxNew := match useLetExpr, elabBodyFirst with
|
||||
|
|
|
|||
1
stage0/src/Lean/Elab/Deriving/FromToJson.lean
generated
1
stage0/src/Lean/Elab/Deriving/FromToJson.lean
generated
|
|
@ -132,7 +132,6 @@ where
|
|||
let localDecl ← getLocalDecl x.fvarId!
|
||||
if !localDecl.userName.hasMacroScopes then
|
||||
userNames := userNames.push localDecl.userName
|
||||
let xTy ← inferType x
|
||||
let a := mkIdent (← mkFreshUserName `a)
|
||||
identNames := identNames.push a
|
||||
let jsonAccess ← identNames.mapIdxM (fun idx _ => `(jsons[$(quote idx.val)]))
|
||||
|
|
|
|||
2
stage0/src/Lean/Elab/Do.lean
generated
2
stage0/src/Lean/Elab/Do.lean
generated
|
|
@ -949,7 +949,7 @@ def declToTerm (decl : Syntax) (k : Syntax) : M Syntax := withRef decl <| withFr
|
|||
let ref := arg
|
||||
if arg.getKind == `Lean.Parser.Term.doIdDecl then
|
||||
let id := arg[0]
|
||||
let type := expandOptType ref arg[1]
|
||||
let type := expandOptType id arg[1]
|
||||
let doElem := arg[3]
|
||||
-- `doElem` must be a `doExpr action`. See `doLetArrowToCode`
|
||||
match isDoExpr? doElem with
|
||||
|
|
|
|||
5
stage0/src/Lean/Elab/InfoTree.lean
generated
5
stage0/src/Lean/Elab/InfoTree.lean
generated
|
|
@ -37,6 +37,7 @@ structure TermInfo extends ElabInfo where
|
|||
lctx : LocalContext -- The local context when the term was elaborated.
|
||||
expectedType? : Option Expr
|
||||
expr : Expr
|
||||
isBinder : Bool := false
|
||||
deriving Inhabited
|
||||
|
||||
structure CommandInfo extends ElabInfo where
|
||||
|
|
@ -101,12 +102,12 @@ inductive InfoTree where
|
|||
| hole (mvarId : MVarId) -- The elaborator creates holes (aka metavariables) for tactics and postponed terms
|
||||
deriving Inhabited
|
||||
|
||||
partial def InfoTree.findInfo? (p : Info → Bool) (t : InfoTree) : Option InfoTree :=
|
||||
partial def InfoTree.findInfo? (p : Info → Bool) (t : InfoTree) : Option Info :=
|
||||
match t with
|
||||
| context _ t => findInfo? p t
|
||||
| node i ts =>
|
||||
if p i then
|
||||
some t
|
||||
some i
|
||||
else
|
||||
ts.findSome? (findInfo? p)
|
||||
| _ => none
|
||||
|
|
|
|||
9
stage0/src/Lean/Elab/LetRec.lean
generated
9
stage0/src/Lean/Elab/LetRec.lean
generated
|
|
@ -36,15 +36,16 @@ private def mkLetRecDeclView (letRec : Syntax) : TermElabM LetRecView := do
|
|||
if decl.isOfKind `Lean.Parser.Term.letPatDecl then
|
||||
throwErrorAt decl "patterns are not allowed in 'let rec' expressions"
|
||||
else if decl.isOfKind `Lean.Parser.Term.letIdDecl || decl.isOfKind `Lean.Parser.Term.letEqnsDecl then
|
||||
let shortDeclName := decl[0].getId
|
||||
let declId := decl[0]
|
||||
let shortDeclName := declId.getId
|
||||
let currDeclName? ← getDeclName?
|
||||
let declName := currDeclName?.getD Name.anonymous ++ shortDeclName
|
||||
checkNotAlreadyDeclared declName
|
||||
applyAttributesAt declName attrs AttributeApplicationTime.beforeElaboration
|
||||
addDocString' declName docStr?
|
||||
addAuxDeclarationRanges declName decl decl[0]
|
||||
addAuxDeclarationRanges declName decl declId
|
||||
let binders := decl[1].getArgs
|
||||
let typeStx := expandOptType decl decl[2]
|
||||
let typeStx := expandOptType declId decl[2]
|
||||
let (type, numParams) ← elabBinders binders fun xs => do
|
||||
let type ← elabType typeStx
|
||||
registerCustomErrorIfMVar type typeStx "failed to infer 'let rec' declaration type"
|
||||
|
|
@ -114,6 +115,8 @@ private def registerLetRecsToLift (views : Array LetRecDeclView) (fvars : Array
|
|||
@[builtinTermElab «letrec»] def elabLetRec : TermElab := fun stx expectedType? => do
|
||||
let view ← mkLetRecDeclView stx
|
||||
withAuxLocalDecls view.decls fun fvars => do
|
||||
for decl in view.decls, fvar in fvars do
|
||||
addTermInfo (isBinder := true) decl.ref[0] fvar
|
||||
let values ← elabLetRecDeclValues view
|
||||
let body ← elabTermEnsuringType view.body expectedType?
|
||||
registerLetRecsToLift view.decls fvars values
|
||||
|
|
|
|||
26
stage0/src/Lean/Elab/Mixfix.lean
generated
26
stage0/src/Lean/Elab/Mixfix.lean
generated
|
|
@ -10,19 +10,19 @@ namespace Lean.Elab.Command
|
|||
@[builtinMacro Lean.Parser.Command.mixfix] def expandMixfix : Macro := fun stx =>
|
||||
withAttrKindGlobal stx fun stx => do
|
||||
match stx with
|
||||
| `(infixl $[: $prec]? $[(name := $name)]? $[(priority := $prio)]? $op => $f) =>
|
||||
let prec1 := quote <| (← evalOptPrec prec) + 1
|
||||
`(notation $[: $prec]? $[(name := $name)]? $[(priority := $prio)]? lhs$[:$prec]? $op:strLit rhs:$prec1 => $f lhs rhs)
|
||||
| `(infix $[: $prec]? $[(name := $name)]? $[(priority := $prio)]? $op => $f) =>
|
||||
let prec1 := quote <| (← evalOptPrec prec) + 1
|
||||
`(notation $[: $prec]? $[(name := $name)]? $[(priority := $prio)]? lhs:$prec1 $op:strLit rhs:$prec1 => $f lhs rhs)
|
||||
| `(infixr $[: $prec]? $[(name := $name)]? $[(priority := $prio)]? $op => $f) =>
|
||||
let prec1 := quote <| (← evalOptPrec prec) + 1
|
||||
`(notation $[: $prec]? $[(name := $name)]? $[(priority := $prio)]? lhs:$prec1 $op:strLit rhs $[: $prec]? => $f lhs rhs)
|
||||
| `(prefix $[: $prec]? $[(name := $name)]? $[(priority := $prio)]? $op => $f) =>
|
||||
`(notation $[: $prec]? $[(name := $name)]? $[(priority := $prio)]? $op:strLit arg $[: $prec]? => $f arg)
|
||||
| `(postfix $[: $prec]? $[(name := $name)]? $[(priority := $prio)]? $op => $f) =>
|
||||
`(notation $[: $prec]? $[(name := $name)]? $[(priority := $prio)]? arg$[:$prec]? $op:strLit => $f arg)
|
||||
| `(infixl:$prec $[(name := $name)]? $[(priority := $prio)]? $op => $f) =>
|
||||
let prec1 := quote <| (← evalPrec prec) + 1
|
||||
`(notation:$prec $[(name := $name)]? $[(priority := $prio)]? lhs:$prec $op:strLit rhs:$prec1 => $f lhs rhs)
|
||||
| `(infix:$prec $[(name := $name)]? $[(priority := $prio)]? $op => $f) =>
|
||||
let prec1 := quote <| (← evalPrec prec) + 1
|
||||
`(notation:$prec $[(name := $name)]? $[(priority := $prio)]? lhs:$prec1 $op:strLit rhs:$prec1 => $f lhs rhs)
|
||||
| `(infixr:$prec $[(name := $name)]? $[(priority := $prio)]? $op => $f) =>
|
||||
let prec1 := quote <| (← evalPrec prec) + 1
|
||||
`(notation:$prec $[(name := $name)]? $[(priority := $prio)]? lhs:$prec1 $op:strLit rhs:$prec => $f lhs rhs)
|
||||
| `(prefix:$prec $[(name := $name)]? $[(priority := $prio)]? $op => $f) =>
|
||||
`(notation:$prec $[(name := $name)]? $[(priority := $prio)]? $op:strLit arg:$prec => $f arg)
|
||||
| `(postfix:$prec $[(name := $name)]? $[(priority := $prio)]? $op => $f) =>
|
||||
`(notation:$prec $[(name := $name)]? $[(priority := $prio)]? arg:$prec $op:strLit => $f arg)
|
||||
| _ => Macro.throwUnsupported
|
||||
where
|
||||
-- set "global" `attrKind`, apply `f`, and restore `attrKind` to result
|
||||
|
|
|
|||
33
stage0/src/Lean/Elab/Term.lean
generated
33
stage0/src/Lean/Elab/Term.lean
generated
|
|
@ -937,7 +937,7 @@ private def postponeElabTerm (stx : Syntax) (expectedType? : Option Expr) : Term
|
|||
def getSyntheticMVarDecl? (mvarId : MVarId) : TermElabM (Option SyntheticMVarDecl) :=
|
||||
return (← get).syntheticMVars.find? fun d => d.mvarId == mvarId
|
||||
|
||||
def mkTermInfo (elaborator : Name) (stx : Syntax) (e : Expr) (expectedType? : Option Expr := none) (lctx? : Option LocalContext := none) : TermElabM (Sum Info MVarId) := do
|
||||
def mkTermInfo (elaborator : Name) (stx : Syntax) (e : Expr) (expectedType? : Option Expr := none) (lctx? : Option LocalContext := none) (isBinder := false) : TermElabM (Sum Info MVarId) := do
|
||||
let isHole? : TermElabM (Option MVarId) := do
|
||||
match e with
|
||||
| Expr.mvar mvarId _ =>
|
||||
|
|
@ -947,11 +947,11 @@ def mkTermInfo (elaborator : Name) (stx : Syntax) (e : Expr) (expectedType? : Op
|
|||
| _ => return none
|
||||
| _ => pure none
|
||||
match (← isHole?) with
|
||||
| none => return Sum.inl <| Info.ofTermInfo { elaborator, lctx := lctx?.getD (← getLCtx), expr := e, stx, expectedType? }
|
||||
| none => return Sum.inl <| Info.ofTermInfo { elaborator, lctx := lctx?.getD (← getLCtx), expr := e, stx, expectedType?, isBinder }
|
||||
| some mvarId => return Sum.inr mvarId
|
||||
|
||||
def addTermInfo (stx : Syntax) (e : Expr) (expectedType? : Option Expr := none) (lctx? : Option LocalContext := none) (elaborator := Name.anonymous) : TermElabM Unit := do
|
||||
withInfoContext' (pure ()) (fun _ => mkTermInfo elaborator stx e expectedType? lctx?) |> discard
|
||||
def addTermInfo (stx : Syntax) (e : Expr) (expectedType? : Option Expr := none) (lctx? : Option LocalContext := none) (elaborator := Name.anonymous) (isBinder := false) : TermElabM Unit := do
|
||||
withInfoContext' (pure ()) (fun _ => mkTermInfo elaborator stx e expectedType? lctx? isBinder) |> discard
|
||||
|
||||
/-
|
||||
Helper function for `elabTerm` is tries the registered elaboration functions for `stxNode` kind until it finds one that supports the syntax or
|
||||
|
|
@ -1379,29 +1379,8 @@ def resolveName' (ident : Syntax) (explicitLevels : List Level) (expectedType? :
|
|||
| Syntax.ident info rawStr n preresolved =>
|
||||
let r ← resolveName ident n preresolved explicitLevels expectedType?
|
||||
r.mapM fun (c, fields) => do
|
||||
let (cSstr, fields) := fields.foldr (init := (rawStr, [])) fun field (restSstr, fs) =>
|
||||
let fieldSstr := restSstr.takeRightWhile (· ≠ '.')
|
||||
({ restSstr with stopPos := restSstr.stopPos - (fieldSstr.bsize + 1) }, (field, fieldSstr) :: fs)
|
||||
let mkIdentFromPos pos rawVal val :=
|
||||
let info := match info with
|
||||
| SourceInfo.original .. => SourceInfo.original "".toSubstring pos "".toSubstring (pos + rawVal.bsize)
|
||||
| _ => SourceInfo.synthetic pos (pos + rawVal.bsize)
|
||||
Syntax.ident info rawVal val []
|
||||
let id := match c with
|
||||
| Expr.const id _ _ => id
|
||||
| Expr.fvar id _ => id
|
||||
| _ => unreachable!
|
||||
let id := mkIdentFromPos (ident.getPos?.getD 0) cSstr id
|
||||
match info.getPos? with
|
||||
| none =>
|
||||
return (c, id, fields.map fun (field, _) => mkIdentFrom ident (Name.mkSimple field))
|
||||
| some pos =>
|
||||
let mut pos := pos + cSstr.bsize + 1
|
||||
let mut newFields := #[]
|
||||
for (field, fieldSstr) in fields do
|
||||
newFields := newFields.push <| mkIdentFromPos pos fieldSstr (Name.mkSimple field)
|
||||
pos := pos + fieldSstr.bsize + 1
|
||||
return (c, id, newFields.toList)
|
||||
let ids := ident.identComponents (nFields? := fields.length)
|
||||
return (c, ids.head!, ids.tail!)
|
||||
| _ => throwError "identifier expected"
|
||||
|
||||
def resolveId? (stx : Syntax) (kind := "term") (withInfo := false) : TermElabM (Option Expr) :=
|
||||
|
|
|
|||
4
stage0/src/Lean/Parser/Command.lean
generated
4
stage0/src/Lean/Parser/Command.lean
generated
|
|
@ -11,8 +11,8 @@ namespace Parser
|
|||
|
||||
/--
|
||||
Syntax quotation for terms and (lists of) commands. We prefer terms, so ambiguous quotations like
|
||||
`($x $y) will be parsed as an application, not two commands. Use `($x:command $y:command) instead.
|
||||
Multiple command will be put in a `null node, but a single command will not (so that you can directly
|
||||
`` `($x $y) `` will be parsed as an application, not two commands. Use `` `($x:command $y:command) `` instead.
|
||||
Multiple command will be put in a `` `null `` node, but a single command will not (so that you can directly
|
||||
match against a quotation in a command kind's elaborator). -/
|
||||
-- TODO: use two separate quotation parsers with parser priorities instead
|
||||
@[builtinTermParser] def Term.quot := leading_parser "`(" >> incQuotDepth (termParser <|> many1Unbox commandParser) >> ")"
|
||||
|
|
|
|||
2
stage0/src/Lean/Parser/Syntax.lean
generated
2
stage0/src/Lean/Parser/Syntax.lean
generated
|
|
@ -59,7 +59,7 @@ def «infixl» := leading_parser "infixl"
|
|||
def «infixr» := leading_parser "infixr"
|
||||
def «postfix» := leading_parser "postfix"
|
||||
def mixfixKind := «prefix» <|> «infix» <|> «infixl» <|> «infixr» <|> «postfix»
|
||||
@[builtinCommandParser] def «mixfix» := leading_parser Term.attrKind >> mixfixKind >> optPrecedence >> optNamedName >> optNamedPrio >> ppSpace >> strLit >> darrow >> termParser
|
||||
@[builtinCommandParser] def «mixfix» := leading_parser Term.attrKind >> mixfixKind >> precedence >> optNamedName >> optNamedPrio >> ppSpace >> strLit >> darrow >> termParser
|
||||
-- NOTE: We use `suppressInsideQuot` in the following parsers because quotations inside them are evaluated in the same stage and
|
||||
-- thus should be ignored when we use `checkInsideQuot` to prepare the next stage for a builtin syntax change
|
||||
def identPrec := leading_parser ident >> optPrecedence
|
||||
|
|
|
|||
6
stage0/src/Lean/PrettyPrinter/Parenthesizer.lean
generated
6
stage0/src/Lean/PrettyPrinter/Parenthesizer.lean
generated
|
|
@ -137,7 +137,7 @@ unsafe def mkCategoryParenthesizerAttribute : IO (KeyedDeclsAttribute CategoryPa
|
|||
name := `categoryParenthesizer,
|
||||
descr := "Register a parenthesizer for a syntax category.
|
||||
|
||||
[parenthesizer cat] registers a declaration of type `Lean.PrettyPrinter.CategoryParenthesizer` for the category `cat`,
|
||||
[categoryParenthesizer cat] registers a declaration of type `Lean.PrettyPrinter.CategoryParenthesizer` for the category `cat`,
|
||||
which is used when parenthesizing calls of `categoryParser cat prec`. Implementations should call `maybeParenthesize`
|
||||
with the precedence and `cat`. If no category parenthesizer is registered, the category will never be parenthesized,
|
||||
but still be traversed for parenthesizing nested categories.",
|
||||
|
|
@ -146,7 +146,7 @@ unsafe def mkCategoryParenthesizerAttribute : IO (KeyedDeclsAttribute CategoryPa
|
|||
let env ← getEnv
|
||||
let id ← Attribute.Builtin.getId stx
|
||||
if Parser.isParserCategory env id then pure id
|
||||
else throwError "invalid [parenthesizer] argument, unknown parser category '{toString id}'"
|
||||
else throwError "invalid [categoryParenthesizer] argument, unknown parser category '{toString id}'"
|
||||
} `Lean.PrettyPrinter.categoryParenthesizerAttribute
|
||||
@[builtinInit mkCategoryParenthesizerAttribute] constant categoryParenthesizerAttribute : KeyedDeclsAttribute CategoryParenthesizer
|
||||
|
||||
|
|
@ -208,7 +208,7 @@ def maybeParenthesize (cat : Name) (canJuxtapose : Bool) (mkParen : Syntax → S
|
|||
x
|
||||
let { minPrec := some minPrec, trailPrec := trailPrec, trailCat := trailCat, .. } ← get
|
||||
| trace[PrettyPrinter.parenthesize] "visited a syntax tree without precedences?!{line ++ fmt stx}"
|
||||
trace[PrettyPrinter.parenthesize] ("...precedences are {prec} >? {minPrec}" ++ if canJuxtapose then m!", {(trailPrec, trailCat)} <=? {(st.contPrec, st.contCat)}" else "")
|
||||
trace[PrettyPrinter.parenthesize] (m!"...precedences are {prec} >? {minPrec}" ++ if canJuxtapose then m!", {(trailPrec, trailCat)} <=? {(st.contPrec, st.contCat)}" else "")
|
||||
-- Should we parenthesize?
|
||||
if (prec > minPrec || canJuxtapose && match trailPrec, st.contPrec with | some trailPrec, some contPrec => trailCat == st.contCat && trailPrec <= contPrec | _, _ => false) then
|
||||
-- The recursive `visit` call, by the invariant, has moved to the preceding node. In order to parenthesize
|
||||
|
|
|
|||
|
|
@ -90,6 +90,21 @@ partial def handleDefinition (kind : GoToKind) (p : TextDocumentPositionParams)
|
|||
return #[ll]
|
||||
return #[]
|
||||
|
||||
let locationLinksFromBinder (t : InfoTree) (i : Elab.Info) (id : FVarId) := do
|
||||
if let some i' := t.findInfo? fun
|
||||
| Info.ofTermInfo { isBinder := true, expr := Expr.fvar id' .., .. } => id' == id
|
||||
| _ => false then
|
||||
if let some r := i'.range? then
|
||||
let r := r.toLspRange text
|
||||
let ll : LocationLink := {
|
||||
originSelectionRange? := (·.toLspRange text) <$> i.range?
|
||||
targetUri := p.textDocument.uri
|
||||
targetRange := r
|
||||
targetSelectionRange := r
|
||||
}
|
||||
return #[ll]
|
||||
return #[]
|
||||
|
||||
withWaitFindSnap doc (fun s => s.endPos > hoverPos)
|
||||
(notFoundX := pure #[]) fun snap => do
|
||||
for t in snap.cmdState.infoState.trees do
|
||||
|
|
@ -98,14 +113,16 @@ partial def handleDefinition (kind : GoToKind) (p : TextDocumentPositionParams)
|
|||
let mut expr := ti.expr
|
||||
if kind = type then
|
||||
expr ← ci.runMetaM i.lctx do
|
||||
Meta.instantiateMVars (← Meta.inferType expr)
|
||||
if let some n := expr.constName? then
|
||||
return ← ci.runMetaM i.lctx <| locationLinksFromDecl i n
|
||||
Expr.getAppFn (← Meta.instantiateMVars (← Meta.inferType expr))
|
||||
match expr with
|
||||
| Expr.const n .. => return ← ci.runMetaM i.lctx <| locationLinksFromDecl i n
|
||||
| Expr.fvar id .. => return ← ci.runMetaM i.lctx <| locationLinksFromBinder t i id
|
||||
| _ => pure ()
|
||||
if let Info.ofFieldInfo fi := i then
|
||||
if kind = type then
|
||||
let expr ← ci.runMetaM i.lctx do
|
||||
Meta.instantiateMVars (← Meta.inferType fi.val)
|
||||
if let some n := expr.constName? then
|
||||
if let some n := expr.getAppFn.constName? then
|
||||
return ← ci.runMetaM i.lctx <| locationLinksFromDecl i n
|
||||
else
|
||||
return ← ci.runMetaM i.lctx <| locationLinksFromDecl i fi.projName
|
||||
|
|
@ -145,6 +162,7 @@ partial def handlePlainGoal (p : PlainGoalParams)
|
|||
return none
|
||||
|
||||
open Elab in
|
||||
open Meta in
|
||||
partial def handlePlainTermGoal (p : PlainTermGoalParams)
|
||||
: RequestM (RequestTask (Option PlainTermGoal)) := do
|
||||
let doc ← readDoc
|
||||
|
|
@ -154,8 +172,11 @@ partial def handlePlainTermGoal (p : PlainTermGoalParams)
|
|||
(notFoundX := pure none) fun snap => do
|
||||
for t in snap.cmdState.infoState.trees do
|
||||
if let some (ci, i@(Info.ofTermInfo ti)) := t.termGoalAt? hoverPos then
|
||||
let goal ← ci.runMetaM i.lctx <| open Meta in do
|
||||
let ty ← instantiateMVars <| ti.expectedType?.getD (← inferType ti.expr)
|
||||
let ty ← ci.runMetaM i.lctx do
|
||||
instantiateMVars <| ti.expectedType?.getD (← inferType ti.expr)
|
||||
-- for binders, hide the last hypothesis (the binder itself)
|
||||
let lctx' := if ti.isBinder then i.lctx.pop else i.lctx
|
||||
let goal ← ci.runMetaM lctx' do
|
||||
withPPInaccessibleNames <| Meta.ppGoal (← mkFreshExprMVar ty).mvarId!
|
||||
let range := if let some r := i.range? then r.toLspRange text else ⟨p.position, p.position⟩
|
||||
return some { goal := toString goal, range }
|
||||
|
|
|
|||
44
stage0/src/Lean/Syntax.lean
generated
44
stage0/src/Lean/Syntax.lean
generated
|
|
@ -172,6 +172,50 @@ partial def getTailWithPos : Syntax → Option Syntax
|
|||
| node _ args => args.findSomeRev? getTailWithPos
|
||||
| _ => none
|
||||
|
||||
open SourceInfo in
|
||||
/-- Split an `ident` into its dot-separated components while preserving source info.
|
||||
Macro scopes are first erased. For example, `` `foo.bla.boo._@._hyg.4 `` ↦ `` [`foo, `bla, `boo] ``.
|
||||
If `nFields` is set, we take that many fields from the end and keep the remaining components
|
||||
as one name. For example, `` `foo.bla.boo `` with `(nFields := 1)` ↦ `` [`foo.bla, `boo] ``. -/
|
||||
def identComponents (stx : Syntax) (nFields? : Option Nat := none) : List Syntax :=
|
||||
match stx with
|
||||
| ident (SourceInfo.original lead pos trail _) rawStr val _ =>
|
||||
let val := val.eraseMacroScopes
|
||||
-- With original info, we assume that `rawStr` represents `val`.
|
||||
let nameComps := nameComps val nFields?
|
||||
let rawComps := splitNameLit rawStr
|
||||
let rawComps :=
|
||||
if let some nFields := nFields? then
|
||||
let nPrefix := rawComps.length - nFields
|
||||
let prefixSz := rawComps.take nPrefix |>.foldl (init := 0) fun acc (ss : Substring) => acc + ss.bsize + 1
|
||||
let prefixSz := prefixSz - 1 -- The last component has no dot
|
||||
rawStr.extract 0 prefixSz :: rawComps.drop nPrefix
|
||||
else
|
||||
rawComps
|
||||
assert! nameComps.length == rawComps.length
|
||||
nameComps.zip rawComps |>.map fun (id, ss) =>
|
||||
let off := ss.startPos - rawStr.startPos
|
||||
let lead := if off == 0 then lead else "".toSubstring
|
||||
let trail := if ss.stopPos == rawStr.stopPos then trail else "".toSubstring
|
||||
let info := original lead (pos + off) trail (pos + off + ss.bsize)
|
||||
ident info ss id []
|
||||
| ident si _ val _ =>
|
||||
let val := val.eraseMacroScopes
|
||||
/- With non-original info:
|
||||
- `rawStr` can take all kinds of forms so we only use `val`.
|
||||
- there is no source extent to offset, so we pass it as-is. -/
|
||||
nameComps val nFields? |>.map fun n => ident si n.toString.toSubstring n []
|
||||
| _ => unreachable!
|
||||
where
|
||||
nameComps (n : Name) (nFields? : Option Nat) : List Name :=
|
||||
if let some nFields := nFields? then
|
||||
let nameComps := n.components
|
||||
let nPrefix := nameComps.length - nFields
|
||||
let namePrefix := nameComps.take nPrefix |>.foldl (init := Name.anonymous) fun acc n => acc ++ n
|
||||
namePrefix :: nameComps.drop nPrefix
|
||||
else
|
||||
n.components
|
||||
|
||||
structure TopDown where
|
||||
firstChoiceOnly : Bool
|
||||
stx : Syntax
|
||||
|
|
|
|||
17
stage0/src/include/lean/compiler_hints.h
generated
17
stage0/src/include/lean/compiler_hints.h
generated
|
|
@ -1,17 +0,0 @@
|
|||
/*
|
||||
Copyright (c) 2017 Microsoft Corporation. All rights reserved.
|
||||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
|
||||
Author: Gabriel Ebner
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#if defined(__GNUC__) || defined(__clang__)
|
||||
#define LEAN_UNLIKELY(x) (__builtin_expect((x), 0))
|
||||
#define LEAN_LIKELY(x) (__builtin_expect((x), 1))
|
||||
#define LEAN_ALWAYS_INLINE __attribute__((always_inline))
|
||||
#else
|
||||
#define LEAN_UNLIKELY(x) (x)
|
||||
#define LEAN_LIKELY(x) (x)
|
||||
#define LEAN_ALWAYS_INLINE
|
||||
#endif
|
||||
243
stage0/src/include/lean/lean.h
generated
243
stage0/src/include/lean/lean.h
generated
|
|
@ -89,46 +89,16 @@ LEAN_CASSERT(sizeof(void*) == 8);
|
|||
|
||||
/* Lean object header */
|
||||
typedef struct {
|
||||
#if defined(LEAN_COMPRESSED_OBJECT_HEADER)
|
||||
/* (high) 8-bits : tag
|
||||
8-bits : num fields for constructors, element size for scalar arrays
|
||||
1-bit : single-threaded
|
||||
1-bit : multi-threaded
|
||||
1-bit : persistent
|
||||
(low) 45-bits : RC */
|
||||
size_t m_header;
|
||||
#define LEAN_RC_NBITS 45
|
||||
#define LEAN_PERSISTENT_BIT 45
|
||||
#define LEAN_MT_BIT 46
|
||||
#define LEAN_ST_BIT 47
|
||||
#elif defined(LEAN_COMPRESSED_OBJECT_HEADER_SMALL_RC)
|
||||
/* (high) 8-bits : tag
|
||||
8-bits : num fields for constructors, element size for scalar arrays
|
||||
8-bits : memory kind
|
||||
8-bits : <unused>
|
||||
(low) 32-bits : RC */
|
||||
size_t m_header;
|
||||
#define LEAN_RC_NBITS 32
|
||||
#define LEAN_ST_MEM_KIND 0
|
||||
#define LEAN_MT_MEM_KIND 1
|
||||
#define LEAN_PERSISTENT_MEM_KIND 2
|
||||
#define LEAN_OTHER_MEM_KIND 3
|
||||
#else
|
||||
size_t m_rc;
|
||||
uint8_t m_tag;
|
||||
uint8_t m_mem_kind;
|
||||
uint16_t m_other; /* num fields for constructors, element size for scalar arrays, etc. */
|
||||
#define LEAN_ST_MEM_KIND 0
|
||||
#define LEAN_MT_MEM_KIND 1
|
||||
#define LEAN_PERSISTENT_MEM_KIND 2
|
||||
#define LEAN_OTHER_MEM_KIND 3
|
||||
#endif
|
||||
int m_rc; /* > 0 - single thread object, < 0 - multi threaded object, == 0 - persistent object. */
|
||||
unsigned m_cs_sz:16; /* for small objects stored in compact regions, this field contains the object size. It is 0, otherwise */
|
||||
unsigned m_other:8; /* number of fields for constructors, element size for scalar arrays */
|
||||
unsigned m_tag:8;
|
||||
} lean_object;
|
||||
|
||||
/*
|
||||
In our runtime, a Lean function consume the reference counter (RC) of its argument or not.
|
||||
We say this behavior is part of the "calling convention" for the function. We say an argument uses:
|
||||
|
||||
x
|
||||
1- "standard" calling convention if it consumes/decrements the RC.
|
||||
In this calling convention each argument should be viewed as a resource that is consumed by the function.
|
||||
This is roughly equivalent to `S && a` in C++, where `S` is a smart pointer, and `a` is the argument.
|
||||
|
|
@ -378,19 +348,11 @@ lean_object * lean_alloc_object(size_t sz);
|
|||
void lean_free_object(lean_object * o);
|
||||
|
||||
static inline uint8_t lean_ptr_tag(lean_object * o) {
|
||||
#if defined(LEAN_COMPRESSED_OBJECT_HEADER) || defined(LEAN_COMPRESSED_OBJECT_HEADER_SMALL_RC)
|
||||
return LEAN_BYTE(o->m_header, 7);
|
||||
#else
|
||||
return o->m_tag;
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline unsigned lean_ptr_other(lean_object * o) {
|
||||
#if defined(LEAN_COMPRESSED_OBJECT_HEADER) || defined(LEAN_COMPRESSED_OBJECT_HEADER_SMALL_RC)
|
||||
return LEAN_BYTE(o->m_header, 6);
|
||||
#else
|
||||
return o->m_other;
|
||||
#endif
|
||||
}
|
||||
|
||||
/* The object size may be slightly bigger for constructor objects.
|
||||
|
|
@ -401,145 +363,54 @@ static inline unsigned lean_ptr_other(lean_object * o) {
|
|||
size_t lean_object_byte_size(lean_object * o);
|
||||
|
||||
static inline bool lean_is_mt(lean_object * o) {
|
||||
#if defined(LEAN_COMPRESSED_OBJECT_HEADER)
|
||||
return ((o->m_header >> LEAN_MT_BIT) & 1) != 0;
|
||||
#elif defined(LEAN_COMPRESSED_OBJECT_HEADER_SMALL_RC)
|
||||
return LEAN_BYTE(o->m_header, 5) == LEAN_MT_MEM_KIND;
|
||||
#else
|
||||
return o->m_mem_kind == LEAN_MT_MEM_KIND;
|
||||
#endif
|
||||
return o->m_rc < 0;
|
||||
}
|
||||
|
||||
static inline bool lean_is_st(lean_object * o) {
|
||||
#if defined(LEAN_COMPRESSED_OBJECT_HEADER)
|
||||
return ((o->m_header >> LEAN_ST_BIT) & 1) != 0;
|
||||
#elif defined(LEAN_COMPRESSED_OBJECT_HEADER_SMALL_RC)
|
||||
return LEAN_BYTE(o->m_header, 5) == LEAN_ST_MEM_KIND;
|
||||
#else
|
||||
return o->m_mem_kind == LEAN_ST_MEM_KIND;
|
||||
#endif
|
||||
return o->m_rc > 0;
|
||||
}
|
||||
|
||||
/* We never update the reference counter of objects stored in compact regions and allocated at initialization time. */
|
||||
static inline bool lean_is_persistent(lean_object * o) {
|
||||
#if defined(LEAN_COMPRESSED_OBJECT_HEADER)
|
||||
return ((o->m_header >> LEAN_PERSISTENT_BIT) & 1) != 0;
|
||||
#elif defined(LEAN_COMPRESSED_OBJECT_HEADER_SMALL_RC)
|
||||
return LEAN_BYTE(o->m_header, 5) == LEAN_PERSISTENT_MEM_KIND;
|
||||
#else
|
||||
return o->m_mem_kind == LEAN_PERSISTENT_MEM_KIND;
|
||||
#endif
|
||||
return o->m_rc == 0;
|
||||
}
|
||||
|
||||
static inline bool lean_has_rc(lean_object * o) {
|
||||
return lean_is_st(o) || lean_is_mt(o);
|
||||
return o->m_rc != 0;
|
||||
}
|
||||
|
||||
static inline _Atomic(size_t) * lean_get_rc_mt_addr(lean_object* o) {
|
||||
#if defined(LEAN_COMPRESSED_OBJECT_HEADER) || defined(LEAN_COMPRESSED_OBJECT_HEADER_SMALL_RC)
|
||||
return (_Atomic(size_t)*)(&(o->m_header));
|
||||
#else
|
||||
return (_Atomic(size_t)*)(&(o->m_rc));
|
||||
#endif
|
||||
static inline _Atomic(int) * lean_get_rc_mt_addr(lean_object* o) {
|
||||
return (_Atomic(int)*)(&(o->m_rc));
|
||||
}
|
||||
|
||||
void lean_inc_ref_cold(lean_object * o);
|
||||
void lean_inc_ref_n_cold(lean_object * o, unsigned n);
|
||||
|
||||
static inline void lean_inc_ref(lean_object * o) {
|
||||
#if defined(LEAN_COMPRESSED_OBJECT_HEADER)
|
||||
if (LEAN_LIKELY(lean_is_st(o))) {
|
||||
o->m_header++;
|
||||
} else if (lean_is_mt(o)) {
|
||||
LEAN_USING_STD;
|
||||
atomic_fetch_add_explicit(lean_get_rc_mt_addr(o), (size_t)1, memory_order_relaxed);
|
||||
}
|
||||
#elif defined(LEAN_COMPRESSED_OBJECT_HEADER_SMALL_RC)
|
||||
if (LEAN_LIKELY(lean_is_st(o))) {
|
||||
o->m_header++;
|
||||
#ifdef LEAN_CHECK_RC_OVERFLOW
|
||||
if (LEAN_UNLIKELY(((uint32_t)o->m_header) == 0)) {
|
||||
lean_internal_panic_rc_overflow();
|
||||
}
|
||||
#endif
|
||||
} else if (lean_is_mt(o)) {
|
||||
LEAN_USING_STD;
|
||||
#ifdef LEAN_CHECK_RC_OVERFLOW
|
||||
uint32_t old_rc = (uint32_t)
|
||||
#endif
|
||||
atomic_fetch_add_explicit(lean_get_rc_mt_addr(o), (size_t)1, memory_order_relaxed);
|
||||
#ifdef LEAN_CHECK_RC_OVERFLOW
|
||||
if (LEAN_UNLIKELY(old_rc + 1 == 0)) {
|
||||
lean_internal_panic_rc_overflow();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#else
|
||||
if (LEAN_LIKELY(lean_is_st(o))) {
|
||||
o->m_rc++;
|
||||
} else if (lean_is_mt(o)) {
|
||||
LEAN_USING_STD;
|
||||
atomic_fetch_add_explicit(lean_get_rc_mt_addr(o), (size_t)1, memory_order_relaxed);
|
||||
} else {
|
||||
lean_inc_ref_cold(o);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline void lean_inc_ref_n(lean_object * o, size_t n) {
|
||||
#if defined(LEAN_COMPRESSED_OBJECT_HEADER)
|
||||
if (LEAN_LIKELY(lean_is_st(o))) {
|
||||
o->m_header += n;
|
||||
} else if (lean_is_mt(o)) {
|
||||
LEAN_USING_STD;
|
||||
atomic_fetch_add_explicit(lean_get_rc_mt_addr(o), n, memory_order_relaxed);
|
||||
}
|
||||
#elif defined(LEAN_COMPRESSED_OBJECT_HEADER_SMALL_RC)
|
||||
if (LEAN_LIKELY(lean_is_st(o))) {
|
||||
o->m_header += n;
|
||||
#ifdef LEAN_CHECK_RC_OVERFLOW
|
||||
if (LEAN_UNLIKELY(((uint32_t)o->m_header) < n)) {
|
||||
lean_internal_panic_rc_overflow();
|
||||
}
|
||||
#endif
|
||||
} else if (lean_is_mt(o)) {
|
||||
LEAN_USING_STD;
|
||||
#ifdef LEAN_CHECK_RC_OVERFLOW
|
||||
uint32_t old_rc = (uint32_t)
|
||||
#endif
|
||||
atomic_fetch_add_explicit(lean_get_rc_mt_addr(o), n, memory_order_relaxed);
|
||||
#ifdef LEAN_CHECK_RC_OVERFLOW
|
||||
if (LEAN_UNLIKELY(old_rc + n < n)) {
|
||||
lean_internal_panic_rc_overflow();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#else
|
||||
if (LEAN_LIKELY(lean_is_st(o))) {
|
||||
o->m_rc += n;
|
||||
} else if (lean_is_mt(o)) {
|
||||
LEAN_USING_STD;
|
||||
atomic_fetch_add_explicit(lean_get_rc_mt_addr(o), n, memory_order_relaxed);
|
||||
lean_inc_ref_n_cold(o, n);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
bool lean_dec_ref_core_cold(lean_object * o);
|
||||
|
||||
static inline bool lean_dec_ref_core(lean_object * o) {
|
||||
#if defined(LEAN_COMPRESSED_OBJECT_HEADER) || defined(LEAN_COMPRESSED_OBJECT_HEADER_SMALL_RC)
|
||||
if (LEAN_LIKELY(lean_is_st(o))) {
|
||||
o->m_header--;
|
||||
return ((o->m_header) & ((1ull << LEAN_RC_NBITS) - 1)) == 0;
|
||||
} else if (lean_is_mt(o)) {
|
||||
LEAN_USING_STD;
|
||||
return (atomic_fetch_sub_explicit(lean_get_rc_mt_addr(o), (size_t)1, memory_order_acq_rel) & ((1ull << LEAN_RC_NBITS) - 1)) == 1;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
#else
|
||||
if (LEAN_LIKELY(lean_is_st(o))) {
|
||||
if (LEAN_LIKELY(o->m_rc > 1)) {
|
||||
o->m_rc--;
|
||||
return o->m_rc == 0;
|
||||
} else if (lean_is_mt(o)) {
|
||||
LEAN_USING_STD;
|
||||
return atomic_fetch_sub_explicit(lean_get_rc_mt_addr(o), (size_t)1, memory_order_acq_rel) == 1;
|
||||
} else {
|
||||
return false;
|
||||
} else {
|
||||
return lean_dec_ref_core_cold(o);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Generic Lean object delete operation. */
|
||||
|
|
@ -579,97 +450,41 @@ static inline lean_ref_object * lean_to_ref(lean_object * o) { assert(lean_is_re
|
|||
static inline lean_external_object * lean_to_external(lean_object * o) { assert(lean_is_external(o)); return (lean_external_object*)(o); }
|
||||
|
||||
static inline bool lean_is_exclusive(lean_object * o) {
|
||||
#if defined(LEAN_COMPRESSED_OBJECT_HEADER) || defined(LEAN_COMPRESSED_OBJECT_HEADER_SMALL_RC)
|
||||
if (LEAN_LIKELY(lean_is_st(o))) {
|
||||
return ((o->m_header) & ((1ull << LEAN_RC_NBITS) - 1)) == 1;
|
||||
} else {
|
||||
// In theory, an MT object with RC 1 can also be used for destructive updates as long as
|
||||
// the single reference is reachable only from a single thread (which is the case when
|
||||
// it is on the stack/passed to a primitive, in contrast to stored in another object).
|
||||
// However, we would need to add an additional check to this function (which is inlined)
|
||||
// and also reset the mem kind of `o` to ST, and the object will be iterated over anyway
|
||||
// when we put it back in an MT context. So we focus on the more common ST case instead.
|
||||
return false;
|
||||
}
|
||||
#else
|
||||
if (LEAN_LIKELY(lean_is_st(o))) {
|
||||
return o->m_rc == 1;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline bool lean_is_shared(lean_object * o) {
|
||||
#if defined(LEAN_COMPRESSED_OBJECT_HEADER) || defined(LEAN_COMPRESSED_OBJECT_HEADER_SMALL_RC)
|
||||
if (LEAN_LIKELY(lean_is_st(o))) {
|
||||
return ((o->m_header) & ((1ull << LEAN_RC_NBITS) - 1)) > 1;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
#else
|
||||
if (LEAN_LIKELY(lean_is_st(o))) {
|
||||
return o->m_rc > 1;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline bool lean_nonzero_rc(lean_object * o) {
|
||||
#if defined(LEAN_COMPRESSED_OBJECT_HEADER) || defined(LEAN_COMPRESSED_OBJECT_HEADER_SMALL_RC)
|
||||
if (LEAN_LIKELY(lean_is_st(o))) {
|
||||
return ((o->m_header) & ((1ull << LEAN_RC_NBITS) - 1)) > 0;
|
||||
} else if (lean_is_mt(o)) {
|
||||
LEAN_USING_STD;
|
||||
return (atomic_load_explicit(lean_get_rc_mt_addr(o), memory_order_acquire) & ((1ull << LEAN_RC_NBITS) - 1)) > 0;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
#else
|
||||
if (LEAN_LIKELY(lean_is_st(o))) {
|
||||
return o->m_rc > 0;
|
||||
} else if (lean_is_mt(o)) {
|
||||
LEAN_USING_STD;
|
||||
return atomic_load_explicit(lean_get_rc_mt_addr(o), memory_order_acquire) > 0;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void lean_mark_mt(lean_object * o);
|
||||
void lean_mark_persistent(lean_object * o);
|
||||
|
||||
static inline void lean_set_st_header(lean_object * o, unsigned tag, unsigned other) {
|
||||
#if defined(LEAN_COMPRESSED_OBJECT_HEADER)
|
||||
o->m_header = ((size_t)(tag) << 56) | ((size_t)(other) << 48) | (1ull << LEAN_ST_BIT) | 1;
|
||||
#elif defined(LEAN_COMPRESSED_OBJECT_HEADER_SMALL_RC)
|
||||
o->m_header = ((size_t)(tag) << 56) | ((size_t)(other) << 48) | ((size_t)LEAN_ST_MEM_KIND << 40) | 1;
|
||||
#else
|
||||
o->m_rc = 1;
|
||||
o->m_tag = tag;
|
||||
o->m_mem_kind = LEAN_ST_MEM_KIND;
|
||||
o->m_other = other;
|
||||
#endif
|
||||
o->m_cs_sz = 0;
|
||||
}
|
||||
|
||||
/* Remark: we don't need a reference counter for objects that are not stored in the heap.
|
||||
Thus, we use the area to store the object size for small objects. */
|
||||
static inline void lean_set_non_heap_header(lean_object * o, size_t sz, unsigned tag, unsigned other) {
|
||||
assert(sz > 0);
|
||||
assert(sz < (1ull << 45));
|
||||
assert(sz < (1ull << 16));
|
||||
assert(sz == 1 || !lean_is_big_object_tag(tag));
|
||||
#if defined(LEAN_COMPRESSED_OBJECT_HEADER)
|
||||
o->m_header = ((size_t)(tag) << 56) | ((size_t)(other) << 48) | sz;
|
||||
#elif defined(LEAN_COMPRESSED_OBJECT_HEADER_SMALL_RC)
|
||||
o->m_header = ((size_t)(tag) << 56) | ((size_t)(other) << 48) | ((size_t)LEAN_OTHER_MEM_KIND << 40) | sz;
|
||||
#else
|
||||
o->m_rc = sz;
|
||||
o->m_rc = 0;
|
||||
o->m_tag = tag;
|
||||
o->m_mem_kind = LEAN_OTHER_MEM_KIND;
|
||||
o->m_other = other;
|
||||
#endif
|
||||
o->m_cs_sz = sz;
|
||||
}
|
||||
|
||||
/* `lean_set_non_heap_header` for (potentially) big objects such as arrays and strings. */
|
||||
|
|
@ -713,11 +528,7 @@ static inline void lean_ctor_set(b_lean_obj_arg o, unsigned i, lean_obj_arg v) {
|
|||
|
||||
static inline void lean_ctor_set_tag(b_lean_obj_arg o, uint8_t new_tag) {
|
||||
assert(new_tag <= LeanMaxCtorTag);
|
||||
#if defined(LEAN_COMPRESSED_OBJECT_HEADER) || defined(LEAN_COMPRESSED_OBJECT_HEADER_SMALL_RC)
|
||||
LEAN_BYTE(o->m_header, 7) = new_tag;
|
||||
#else
|
||||
o->m_tag = new_tag;
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline void lean_ctor_release(b_lean_obj_arg o, unsigned i) {
|
||||
|
|
|
|||
61
stage0/src/runtime/alloc.cpp
generated
61
stage0/src/runtime/alloc.cpp
generated
|
|
@ -10,6 +10,12 @@ Author: Leonardo de Moura
|
|||
#include <lean/alloc.h>
|
||||
#include <lean/lean.h>
|
||||
|
||||
#if defined(__GNUC__) || defined(__clang__)
|
||||
#define LEAN_NOINLINE __attribute__((noinline))
|
||||
#else
|
||||
#define LEAN_NOINLINE
|
||||
#endif
|
||||
|
||||
#define LEAN_PAGE_SIZE 8192 // 8 Kb
|
||||
#define LEAN_SEGMENT_SIZE 8*1024*1024 // 8 Mb
|
||||
#define LEAN_NUM_SLOTS (LEAN_MAX_SMALL_OBJECT_SIZE / LEAN_OBJECT_SIZE_DELTA)
|
||||
|
|
@ -370,6 +376,7 @@ static void finalize_heap(void * _h) {
|
|||
g_heap_manager->push_orphan(h);
|
||||
}
|
||||
|
||||
LEAN_NOINLINE
|
||||
static void init_heap(bool main) {
|
||||
lean_assert(g_heap == nullptr);
|
||||
g_heap = new heap();
|
||||
|
|
@ -396,24 +403,33 @@ void init_thread_heap() {
|
|||
init_heap(false);
|
||||
}
|
||||
|
||||
LEAN_NOINLINE
|
||||
void * lean_alloc_small_cold(unsigned sz, unsigned slot_idx, page * p) {
|
||||
if (g_heap->m_page_free_list[slot_idx] == nullptr) {
|
||||
g_heap->import_objs();
|
||||
lean_assert(g_heap->m_curr_page[slot_idx] == p);
|
||||
/* g_heap->import_objs() may add objects to p->m_header.m_free_list */
|
||||
if (p->m_header.m_free_list == nullptr)
|
||||
p = alloc_page(g_heap, sz);
|
||||
} else {
|
||||
p = page_list_pop(g_heap->m_page_free_list[slot_idx]);
|
||||
p->m_header.m_in_page_free_list = false;
|
||||
page_list_insert(g_heap->m_curr_page[slot_idx], p);
|
||||
}
|
||||
void * r = p->m_header.m_free_list;
|
||||
lean_assert(r);
|
||||
p->m_header.m_free_list = get_next_obj(r);
|
||||
p->m_header.m_num_free--;
|
||||
lean_assert(get_page_of(r) == p);
|
||||
return r;
|
||||
}
|
||||
|
||||
extern "C" void * lean_alloc_small(unsigned sz, unsigned slot_idx) {
|
||||
page * p = g_heap->m_curr_page[slot_idx];
|
||||
g_heap->m_heartbeat++;
|
||||
void * r = p->m_header.m_free_list;
|
||||
if (LEAN_UNLIKELY(r == nullptr)) {
|
||||
if (g_heap->m_page_free_list[slot_idx] == nullptr) {
|
||||
g_heap->import_objs();
|
||||
lean_assert(g_heap->m_curr_page[slot_idx] == p);
|
||||
/* g_heap->import_objs() may add objects to p->m_header.m_free_list */
|
||||
if (p->m_header.m_free_list == nullptr)
|
||||
p = alloc_page(g_heap, sz);
|
||||
} else {
|
||||
p = page_list_pop(g_heap->m_page_free_list[slot_idx]);
|
||||
p->m_header.m_in_page_free_list = false;
|
||||
page_list_insert(g_heap->m_curr_page[slot_idx], p);
|
||||
}
|
||||
r = p->m_header.m_free_list;
|
||||
lean_assert(r);
|
||||
return lean_alloc_small_cold(sz, slot_idx, p);
|
||||
}
|
||||
p->m_header.m_free_list = get_next_obj(r);
|
||||
p->m_header.m_num_free--;
|
||||
|
|
@ -448,6 +464,17 @@ void * alloc(size_t sz) {
|
|||
return lean_alloc_small(sz, slot_idx);
|
||||
}
|
||||
|
||||
LEAN_NOINLINE
|
||||
static void dealloc_small_core_cold(void * o) {
|
||||
set_next_obj(o, g_heap->m_to_export_list);
|
||||
g_heap->m_to_export_list = o;
|
||||
g_heap->m_to_export_list_size++;
|
||||
if (g_heap->m_to_export_list_size > LEAN_MAX_TO_EXPORT_OBJS) {
|
||||
LEAN_RUNTIME_STAT_CODE(g_num_exports++);
|
||||
g_heap->export_objs();
|
||||
}
|
||||
}
|
||||
|
||||
static inline void dealloc_small_core(void * o) {
|
||||
LEAN_RUNTIME_STAT_CODE(g_num_small_dealloc++);
|
||||
if (LEAN_UNLIKELY(g_heap == nullptr)) {
|
||||
|
|
@ -458,13 +485,7 @@ static inline void dealloc_small_core(void * o) {
|
|||
if (LEAN_LIKELY(p->get_heap() == g_heap)) {
|
||||
p->push_free_obj(o);
|
||||
} else {
|
||||
set_next_obj(o, g_heap->m_to_export_list);
|
||||
g_heap->m_to_export_list = o;
|
||||
g_heap->m_to_export_list_size++;
|
||||
if (g_heap->m_to_export_list_size > LEAN_MAX_TO_EXPORT_OBJS) {
|
||||
LEAN_RUNTIME_STAT_CODE(g_num_exports++);
|
||||
g_heap->export_objs();
|
||||
}
|
||||
dealloc_small_core_cold(o);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
93
stage0/src/runtime/object.cpp
generated
93
stage0/src/runtime/object.cpp
generated
|
|
@ -69,8 +69,26 @@ extern "C" object * lean_sorry(uint8) {
|
|||
lean_unreachable();
|
||||
}
|
||||
|
||||
extern "C" void lean_inc_ref_cold(lean_object * o) {
|
||||
if (o->m_rc == 0)
|
||||
return;
|
||||
atomic_fetch_sub_explicit(lean_get_rc_mt_addr(o), 1, memory_order_relaxed);
|
||||
}
|
||||
|
||||
extern "C" void lean_inc_ref_n_cold(lean_object * o, unsigned n) {
|
||||
if (o->m_rc == 0)
|
||||
return;
|
||||
atomic_fetch_sub_explicit(lean_get_rc_mt_addr(o), n, memory_order_relaxed);
|
||||
}
|
||||
|
||||
extern "C" bool lean_dec_ref_core_cold(lean_object * o) {
|
||||
if (o->m_rc == 1) return true;
|
||||
if (o->m_rc == 0) return false;
|
||||
return atomic_fetch_add_explicit(lean_get_rc_mt_addr(o), 1, memory_order_acq_rel) == -1;
|
||||
}
|
||||
|
||||
extern "C" size_t lean_object_byte_size(lean_object * o) {
|
||||
if (lean_is_mt(o) || lean_is_st(o) || lean_is_persistent(o)) {
|
||||
if (o->m_cs_sz == 0) {
|
||||
/* Recall that multi-threaded, single-threaded and persistent objects are stored in the heap.
|
||||
Persistent objects are multi-threaded and/or single-threaded that have been "promoted" to
|
||||
a persistent status. */
|
||||
|
|
@ -86,15 +104,7 @@ extern "C" size_t lean_object_byte_size(lean_object * o) {
|
|||
case LeanArray: return lean_array_byte_size(o);
|
||||
case LeanScalarArray: return lean_sarray_byte_size(o);
|
||||
case LeanString: return lean_string_byte_size(o);
|
||||
default:
|
||||
/* For potentially big objects, we cannot store the size in the RC field when `defined(LEAN_COMPRESSED_OBJECT_HEADER_SMALL_RC)`.
|
||||
In this case, the RC is 32-bits, and it is not enough for big arrays/strings.
|
||||
Thus, we compute them using the respective *_byte_size operations. */
|
||||
#if defined(LEAN_COMPRESSED_OBJECT_HEADER) || defined(LEAN_COMPRESSED_OBJECT_HEADER_SMALL_RC)
|
||||
return o->m_header & ((1ull << LEAN_RC_NBITS) - 1);
|
||||
#else
|
||||
return o->m_rc;
|
||||
#endif
|
||||
default: return o->m_cs_sz;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -118,25 +128,28 @@ extern "C" void lean_free_object(lean_object * o) {
|
|||
}
|
||||
|
||||
static inline lean_object * get_next(lean_object * o) {
|
||||
#if defined(LEAN_COMPRESSED_OBJECT_HEADER) || defined(LEAN_COMPRESSED_OBJECT_HEADER_SMALL_RC)
|
||||
size_t header = o->m_header;
|
||||
LEAN_BYTE(header, 6) = 0;
|
||||
LEAN_BYTE(header, 7) = 0;
|
||||
return (lean_object*)(header);
|
||||
#else
|
||||
return (lean_object*)((size_t)(o->m_rc));
|
||||
#endif
|
||||
if (sizeof(void*) == 8) {
|
||||
size_t header = ((size_t*)o)[0];
|
||||
LEAN_BYTE(header, 7) = 0;
|
||||
LEAN_BYTE(header, 6) = 0;
|
||||
return (lean_object*)(header);
|
||||
} else {
|
||||
// 32-bit version
|
||||
return ((lean_object**)o)[0];
|
||||
}
|
||||
}
|
||||
|
||||
static inline void set_next(lean_object * o, lean_object * n) {
|
||||
#if defined(LEAN_COMPRESSED_OBJECT_HEADER) || defined(LEAN_COMPRESSED_OBJECT_HEADER_SMALL_RC)
|
||||
size_t new_header = (size_t)n;
|
||||
LEAN_BYTE(new_header, 6) = LEAN_BYTE(o->m_header, 6);
|
||||
LEAN_BYTE(new_header, 7) = LEAN_BYTE(o->m_header, 7);
|
||||
o->m_header = new_header;
|
||||
#else
|
||||
o->m_rc = (size_t)n;
|
||||
#endif
|
||||
if (sizeof(void*) == 8) {
|
||||
size_t new_header = (size_t)n;
|
||||
LEAN_BYTE(new_header, 7) = o->m_tag;
|
||||
LEAN_BYTE(new_header, 6) = o->m_other;
|
||||
((size_t*)o)[0] = new_header;
|
||||
lean_assert(get_next(o) == n);
|
||||
} else {
|
||||
// 32-bit version
|
||||
((lean_object**)o)[0] = n;
|
||||
}
|
||||
}
|
||||
|
||||
static inline void push_back(lean_object * & todo, lean_object * v) {
|
||||
|
|
@ -449,14 +462,7 @@ extern "C" void lean_mark_persistent(object * o) {
|
|||
object * o = todo.back();
|
||||
todo.pop_back();
|
||||
if (!lean_is_scalar(o) && lean_has_rc(o)) {
|
||||
#if defined(LEAN_COMPRESSED_OBJECT_HEADER)
|
||||
o->m_header &= ~((1ull << LEAN_ST_BIT) | (1ull << LEAN_MT_BIT));
|
||||
o->m_header |= (1ull << LEAN_PERSISTENT_BIT);
|
||||
#elif defined(LEAN_COMPRESSED_OBJECT_HEADER_SMALL_RC)
|
||||
LEAN_BYTE(o->m_header, 5) = LEAN_PERSISTENT_MEM_KIND;
|
||||
#else
|
||||
o->m_mem_kind = LEAN_PERSISTENT_MEM_KIND;
|
||||
#endif
|
||||
o->m_rc = 0;
|
||||
#if defined(__has_feature)
|
||||
#if __has_feature(address_sanitizer)
|
||||
// do not report as leak
|
||||
|
|
@ -538,14 +544,7 @@ extern "C" void lean_mark_mt(object * o) {
|
|||
object * o = todo.back();
|
||||
todo.pop_back();
|
||||
if (!lean_is_scalar(o) && lean_is_st(o)) {
|
||||
#if defined(LEAN_COMPRESSED_OBJECT_HEADER)
|
||||
o->m_header &= ~(1ull << LEAN_ST_BIT);
|
||||
o->m_header |= (1ull << LEAN_MT_BIT);
|
||||
#elif defined(LEAN_COMPRESSED_OBJECT_HEADER_SMALL_RC)
|
||||
LEAN_BYTE(o->m_header, 5) = LEAN_MT_MEM_KIND;
|
||||
#else
|
||||
o->m_mem_kind = LEAN_MT_MEM_KIND;
|
||||
#endif
|
||||
o->m_rc = -o->m_rc;
|
||||
uint8_t tag = lean_ptr_tag(o);
|
||||
if (tag <= LeanMaxCtorTag) {
|
||||
object ** it = lean_ctor_obj_cptr(o);
|
||||
|
|
@ -916,16 +915,10 @@ void deactivate_task(lean_task_object * t) {
|
|||
}
|
||||
|
||||
static inline void lean_set_task_header(lean_object * o) {
|
||||
#if defined(LEAN_COMPRESSED_OBJECT_HEADER)
|
||||
o->m_header = ((size_t)(LeanTask) << 56) | (1ull << LEAN_MT_BIT) | 1;
|
||||
#elif defined(LEAN_COMPRESSED_OBJECT_HEADER_SMALL_RC)
|
||||
o->m_header = ((size_t)(LeanTask) << 56) | ((size_t)LEAN_MT_MEM_KIND << 40) | 1;
|
||||
#else
|
||||
o->m_rc = 1;
|
||||
o->m_rc = -1;
|
||||
o->m_tag = LeanTask;
|
||||
o->m_mem_kind = LEAN_MT_MEM_KIND;
|
||||
o->m_other = 0;
|
||||
#endif
|
||||
o->m_cs_sz = 0;
|
||||
}
|
||||
|
||||
static lean_task_object * alloc_task(obj_arg c, unsigned prio, bool keep_alive) {
|
||||
|
|
|
|||
2
stage0/src/util/object_ref.h
generated
2
stage0/src/util/object_ref.h
generated
|
|
@ -18,7 +18,7 @@ protected:
|
|||
object * m_obj;
|
||||
public:
|
||||
object_ref():m_obj(box(0)) {}
|
||||
explicit object_ref(obj_arg o):m_obj(o) { lean_assert(is_scalar(o) || !is_heap_obj(o) || lean_nonzero_rc(o)); }
|
||||
explicit object_ref(obj_arg o):m_obj(o) {}
|
||||
object_ref(b_obj_arg o, bool):m_obj(o) { inc(o); }
|
||||
object_ref(object_ref const & s):m_obj(s.m_obj) { inc(m_obj); }
|
||||
object_ref(object_ref && s):m_obj(s.m_obj) { s.m_obj = box(0); }
|
||||
|
|
|
|||
2
stage0/stdlib/CMakeLists.txt
generated
2
stage0/stdlib/CMakeLists.txt
generated
File diff suppressed because one or more lines are too long
46
stage0/stdlib/Init/Data/Format/Syntax.c
generated
46
stage0/stdlib/Init/Data/Format/Syntax.c
generated
|
|
@ -49,6 +49,7 @@ lean_object* l_List_map___at_Lean_Syntax_formatStxAux___spec__4___boxed(lean_obj
|
|||
static lean_object* l_Lean_Syntax_formatStxAux___closed__5;
|
||||
lean_object* l_Std_fmt___at___private_Init_Data_Format_Syntax_0__Lean_Syntax_formatInfo___spec__2(lean_object*);
|
||||
static lean_object* l_Lean_Syntax_formatStxAux___closed__16;
|
||||
lean_object* l_Std_fmt___at___private_Init_Data_Format_Syntax_0__Lean_Syntax_formatInfo___spec__4___boxed(lean_object*);
|
||||
lean_object* l_List_map___at_Lean_Syntax_formatStxAux___spec__6___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Name_toString(lean_object*, uint8_t);
|
||||
lean_object* l_Lean_Syntax_instToFormatSyntax(lean_object*);
|
||||
|
|
@ -95,7 +96,6 @@ static lean_object* l_Lean_Syntax_formatStxAux___closed__26;
|
|||
lean_object* l_Lean_Name_replacePrefix(lean_object*, lean_object*, lean_object*);
|
||||
lean_object* lean_nat_to_int(lean_object*);
|
||||
lean_object* l_Lean_Syntax_formatStxAux(lean_object*, uint8_t, lean_object*, lean_object*);
|
||||
lean_object* l_Std_fmt___at___private_Init_Data_Format_Syntax_0__Lean_Syntax_formatInfo___spec__3___boxed(lean_object*);
|
||||
uint8_t lean_nat_dec_lt(lean_object*, lean_object*);
|
||||
lean_object* l_List_map___at_Lean_Syntax_formatStxAux___spec__6(lean_object*, uint8_t, lean_object*, lean_object*);
|
||||
lean_object* l___private_Init_Data_Format_Syntax_0__Lean_Syntax_formatInfo_match__1___rarg(uint8_t x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5) {
|
||||
|
|
@ -199,13 +199,6 @@ return x_6;
|
|||
lean_object* l_Std_fmt___at___private_Init_Data_Format_Syntax_0__Lean_Syntax_formatInfo___spec__3(lean_object* x_1) {
|
||||
_start:
|
||||
{
|
||||
lean_inc(x_1);
|
||||
return x_1;
|
||||
}
|
||||
}
|
||||
lean_object* l_Std_fmt___at___private_Init_Data_Format_Syntax_0__Lean_Syntax_formatInfo___spec__4(lean_object* x_1) {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_2; lean_object* x_3;
|
||||
x_2 = l_Nat_repr(x_1);
|
||||
x_3 = lean_alloc_ctor(2, 1, 0);
|
||||
|
|
@ -213,6 +206,13 @@ lean_ctor_set(x_3, 0, x_2);
|
|||
return x_3;
|
||||
}
|
||||
}
|
||||
lean_object* l_Std_fmt___at___private_Init_Data_Format_Syntax_0__Lean_Syntax_formatInfo___spec__4(lean_object* x_1) {
|
||||
_start:
|
||||
{
|
||||
lean_inc(x_1);
|
||||
return x_1;
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l___private_Init_Data_Format_Syntax_0__Lean_Syntax_formatInfo___closed__1() {
|
||||
_start:
|
||||
{
|
||||
|
|
@ -282,28 +282,28 @@ x_11 = l___private_Init_Data_Format_Syntax_0__Lean_Syntax_formatInfo___closed__4
|
|||
x_12 = lean_alloc_ctor(4, 2, 0);
|
||||
lean_ctor_set(x_12, 0, x_10);
|
||||
lean_ctor_set(x_12, 1, x_11);
|
||||
x_13 = lean_alloc_ctor(4, 2, 0);
|
||||
lean_ctor_set(x_13, 0, x_12);
|
||||
lean_ctor_set(x_13, 1, x_3);
|
||||
x_13 = l_Std_fmt___at___private_Init_Data_Format_Syntax_0__Lean_Syntax_formatInfo___spec__3(x_5);
|
||||
x_14 = lean_alloc_ctor(4, 2, 0);
|
||||
lean_ctor_set(x_14, 0, x_13);
|
||||
lean_ctor_set(x_14, 1, x_11);
|
||||
x_15 = l_Std_fmt___at___private_Init_Data_Format_Syntax_0__Lean_Syntax_formatInfo___spec__4(x_5);
|
||||
lean_ctor_set(x_14, 0, x_12);
|
||||
lean_ctor_set(x_14, 1, x_13);
|
||||
x_15 = lean_alloc_ctor(4, 2, 0);
|
||||
lean_ctor_set(x_15, 0, x_14);
|
||||
lean_ctor_set(x_15, 1, x_11);
|
||||
x_16 = lean_alloc_ctor(4, 2, 0);
|
||||
lean_ctor_set(x_16, 0, x_14);
|
||||
lean_ctor_set(x_16, 1, x_15);
|
||||
lean_ctor_set(x_16, 0, x_15);
|
||||
lean_ctor_set(x_16, 1, x_3);
|
||||
x_17 = lean_alloc_ctor(4, 2, 0);
|
||||
lean_ctor_set(x_17, 0, x_16);
|
||||
lean_ctor_set(x_17, 1, x_11);
|
||||
x_18 = l_Std_fmt___at___private_Init_Data_Format_Syntax_0__Lean_Syntax_formatInfo___spec__2(x_6);
|
||||
lean_dec(x_6);
|
||||
x_18 = l_Std_fmt___at___private_Init_Data_Format_Syntax_0__Lean_Syntax_formatInfo___spec__3(x_7);
|
||||
x_19 = lean_alloc_ctor(4, 2, 0);
|
||||
lean_ctor_set(x_19, 0, x_17);
|
||||
lean_ctor_set(x_19, 1, x_18);
|
||||
x_20 = lean_alloc_ctor(4, 2, 0);
|
||||
lean_ctor_set(x_20, 0, x_19);
|
||||
lean_ctor_set(x_20, 1, x_11);
|
||||
x_21 = l_Std_fmt___at___private_Init_Data_Format_Syntax_0__Lean_Syntax_formatInfo___spec__4(x_7);
|
||||
x_21 = l_Std_fmt___at___private_Init_Data_Format_Syntax_0__Lean_Syntax_formatInfo___spec__2(x_6);
|
||||
lean_dec(x_6);
|
||||
x_22 = lean_alloc_ctor(4, 2, 0);
|
||||
lean_ctor_set(x_22, 0, x_20);
|
||||
lean_ctor_set(x_22, 1, x_21);
|
||||
|
|
@ -320,7 +320,7 @@ lean_inc(x_24);
|
|||
x_25 = lean_ctor_get(x_2, 1);
|
||||
lean_inc(x_25);
|
||||
lean_dec(x_2);
|
||||
x_26 = l_Std_fmt___at___private_Init_Data_Format_Syntax_0__Lean_Syntax_formatInfo___spec__4(x_24);
|
||||
x_26 = l_Std_fmt___at___private_Init_Data_Format_Syntax_0__Lean_Syntax_formatInfo___spec__3(x_24);
|
||||
x_27 = l___private_Init_Data_Format_Syntax_0__Lean_Syntax_formatInfo___closed__2;
|
||||
x_28 = lean_alloc_ctor(4, 2, 0);
|
||||
lean_ctor_set(x_28, 0, x_27);
|
||||
|
|
@ -335,7 +335,7 @@ lean_ctor_set(x_31, 1, x_3);
|
|||
x_32 = lean_alloc_ctor(4, 2, 0);
|
||||
lean_ctor_set(x_32, 0, x_31);
|
||||
lean_ctor_set(x_32, 1, x_29);
|
||||
x_33 = l_Std_fmt___at___private_Init_Data_Format_Syntax_0__Lean_Syntax_formatInfo___spec__4(x_25);
|
||||
x_33 = l_Std_fmt___at___private_Init_Data_Format_Syntax_0__Lean_Syntax_formatInfo___spec__3(x_25);
|
||||
x_34 = lean_alloc_ctor(4, 2, 0);
|
||||
lean_ctor_set(x_34, 0, x_32);
|
||||
lean_ctor_set(x_34, 1, x_33);
|
||||
|
|
@ -361,11 +361,11 @@ lean_dec(x_1);
|
|||
return x_2;
|
||||
}
|
||||
}
|
||||
lean_object* l_Std_fmt___at___private_Init_Data_Format_Syntax_0__Lean_Syntax_formatInfo___spec__3___boxed(lean_object* x_1) {
|
||||
lean_object* l_Std_fmt___at___private_Init_Data_Format_Syntax_0__Lean_Syntax_formatInfo___spec__4___boxed(lean_object* x_1) {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_2;
|
||||
x_2 = l_Std_fmt___at___private_Init_Data_Format_Syntax_0__Lean_Syntax_formatInfo___spec__3(x_1);
|
||||
x_2 = l_Std_fmt___at___private_Init_Data_Format_Syntax_0__Lean_Syntax_formatInfo___spec__4(x_1);
|
||||
lean_dec(x_1);
|
||||
return x_2;
|
||||
}
|
||||
|
|
|
|||
855
stage0/stdlib/Init/Data/String/Basic.c
generated
855
stage0/stdlib/Init/Data/String/Basic.c
generated
File diff suppressed because it is too large
Load diff
4
stage0/stdlib/Init/Data/ToString/Basic.c
generated
4
stage0/stdlib/Init/Data/ToString/Basic.c
generated
|
|
@ -55,7 +55,6 @@ lean_object* l_String_toInt_x21_match__1___rarg(lean_object*, lean_object*, lean
|
|||
lean_object* lean_string_utf8_byte_size(lean_object*);
|
||||
lean_object* l_instToStringSubstring(lean_object*);
|
||||
lean_object* l_String_toInt_x21(lean_object*);
|
||||
lean_object* l___private_Init_Data_String_Basic_0__Substring_nextn(lean_object*, lean_object*, lean_object*);
|
||||
lean_object* lean_nat_add(lean_object*, lean_object*);
|
||||
lean_object* l_List_toStringAux___rarg(lean_object*, uint8_t, lean_object*);
|
||||
lean_object* l_instToStringFormat(lean_object*);
|
||||
|
|
@ -104,6 +103,7 @@ lean_object* l_String_toInt_x21_match__1(lean_object*);
|
|||
lean_object* l_instToStringSum___rarg(lean_object*, lean_object*, lean_object*);
|
||||
static lean_object* l_instToStringSum___rarg___closed__1;
|
||||
static lean_object* l_List_toString___rarg___closed__1;
|
||||
lean_object* l_Substring_nextn(lean_object*, lean_object*, lean_object*);
|
||||
static lean_object* l_instToStringOption___rarg___closed__2;
|
||||
static lean_object* l_String_toInt_x3f___lambda__2___closed__1;
|
||||
lean_object* l_List_toString_match__1___rarg(lean_object*, lean_object*, lean_object*);
|
||||
|
|
@ -1564,7 +1564,7 @@ lean_ctor_set(x_8, 0, x_1);
|
|||
lean_ctor_set(x_8, 1, x_2);
|
||||
lean_ctor_set(x_8, 2, x_7);
|
||||
x_9 = lean_unsigned_to_nat(1u);
|
||||
x_10 = l___private_Init_Data_String_Basic_0__Substring_nextn(x_8, x_9, x_2);
|
||||
x_10 = l_Substring_nextn(x_8, x_9, x_2);
|
||||
lean_dec(x_8);
|
||||
x_11 = lean_nat_add(x_2, x_10);
|
||||
lean_dec(x_10);
|
||||
|
|
|
|||
1548
stage0/stdlib/Init/Meta.c
generated
1548
stage0/stdlib/Init/Meta.c
generated
File diff suppressed because it is too large
Load diff
174
stage0/stdlib/Init/NotationExtra.c
generated
174
stage0/stdlib/Init/NotationExtra.c
generated
|
|
@ -16,6 +16,7 @@ extern "C" {
|
|||
static lean_object* l_Lean_myMacro____x40_Init_NotationExtra___hyg_1097____closed__12;
|
||||
lean_object* l_myMacro____x40_Init_NotationExtra___hyg_2091____boxed(lean_object*, lean_object*, lean_object*);
|
||||
static lean_object* l_myMacro____x40_Init_NotationExtra___hyg_4451____closed__17;
|
||||
static lean_object* l_Lean_unbracketedExplicitBinders___closed__4;
|
||||
static lean_object* l_myMacro____x40_Init_NotationExtra___hyg_4451____closed__8;
|
||||
static lean_object* l_Lean_termMacro_x2etrace_x5b_____x5d_____closed__4;
|
||||
static lean_object* l_Lean_command__Unif__hint______Where___x7c_x2d_u22a2_____closed__5;
|
||||
|
|
@ -30,6 +31,7 @@ static lean_object* l_Lean_termMacro_x2etrace_x5b_____x5d_____closed__17;
|
|||
size_t l_USize_add(size_t, size_t);
|
||||
static lean_object* l_Lean_termMacro_x2etrace_x5b_____x5d_____closed__8;
|
||||
static lean_object* l_Array_foldrMUnsafe_fold___at_myMacro____x40_Init_NotationExtra___hyg_4451____spec__4___closed__5;
|
||||
static lean_object* l_Lean_unbracketedExplicitBinders___closed__1;
|
||||
static lean_object* l_Lean_unifConstraint___closed__1;
|
||||
static lean_object* l_Lean_expandExplicitBindersAux_loop___closed__5;
|
||||
static lean_object* l_Lean_command__Unif__hint______Where___x7c_x2d_u22a2_____closed__31;
|
||||
|
|
@ -42,11 +44,11 @@ lean_object* lean_nat_div(lean_object*, lean_object*);
|
|||
static lean_object* l_Lean_command__Unif__hint______Where___x7c_x2d_u22a2_____closed__28;
|
||||
static lean_object* l_myMacro____x40_Init_NotationExtra___hyg_4860____lambda__3___closed__7;
|
||||
static lean_object* l_termExists___x2c_____closed__5;
|
||||
lean_object* l_Lean_unbracktedExplicitBinders;
|
||||
static lean_object* l_Lean_explicitBinders___closed__4;
|
||||
static lean_object* l_Lean_command__Unif__hint______Where___x7c_x2d_u22a2_____closed__18;
|
||||
static lean_object* l_myMacro____x40_Init_NotationExtra___hyg_4451____closed__6;
|
||||
static lean_object* l_Lean_termMacro_x2etrace_x5b_____x5d_____closed__9;
|
||||
static lean_object* l_Lean_unbracketedExplicitBinders___closed__2;
|
||||
extern lean_object* l_Lean_nullKind;
|
||||
static lean_object* l_myMacro____x40_Init_NotationExtra___hyg_4451____closed__1;
|
||||
static lean_object* l_Lean_unifConstraint___closed__8;
|
||||
|
|
@ -60,7 +62,6 @@ static lean_object* l_myMacro____x40_Init_NotationExtra___hyg_5416____closed__5;
|
|||
uint8_t l_USize_decEq(size_t, size_t);
|
||||
lean_object* lean_array_uget(lean_object*, size_t);
|
||||
static lean_object* l_Lean_explicitBinders___closed__3;
|
||||
static lean_object* l_Lean_unbracktedExplicitBinders___closed__5;
|
||||
static lean_object* l_myMacro____x40_Init_NotationExtra___hyg_4232____closed__12;
|
||||
static lean_object* l_termExists___x2c_____closed__1;
|
||||
static lean_object* l_Lean_expandExplicitBinders___closed__1;
|
||||
|
|
@ -96,7 +97,6 @@ static lean_object* l_myMacro____x40_Init_NotationExtra___hyg_4860____lambda__3_
|
|||
static lean_object* l_Lean_myMacro____x40_Init_NotationExtra___hyg_1097____closed__38;
|
||||
static lean_object* l_unexpandExists___closed__3;
|
||||
static lean_object* l_Lean_bracketedExplicitBinders___closed__7;
|
||||
static lean_object* l_Lean_unbracktedExplicitBinders___closed__4;
|
||||
static lean_object* l_term_u03a3_x27___x2c_____closed__3;
|
||||
uint8_t lean_name_eq(lean_object*, lean_object*);
|
||||
static lean_object* l_command__ClassAbbrev_____x3a___x3a_x3d_____x2c___closed__31;
|
||||
|
|
@ -121,7 +121,6 @@ static lean_object* l_term_u2203___x2c_____closed__7;
|
|||
static lean_object* l_Lean_command__Unif__hint______Where___x7c_x2d_u22a2_____closed__26;
|
||||
lean_object* l_term_u2203___x2c__;
|
||||
static lean_object* l_tacticFunext_______closed__3;
|
||||
static lean_object* l_Lean_unbracktedExplicitBinders___closed__9;
|
||||
static lean_object* l_Lean_bracketedExplicitBinders___closed__3;
|
||||
static lean_object* l_myMacro____x40_Init_NotationExtra___hyg_4860____lambda__3___closed__2;
|
||||
static lean_object* l_Lean_myMacro____x40_Init_NotationExtra___hyg_1097____closed__32;
|
||||
|
|
@ -136,10 +135,10 @@ static lean_object* l_myMacro____x40_Init_NotationExtra___hyg_2091____closed__1;
|
|||
static lean_object* l_Lean_myMacro____x40_Init_NotationExtra___hyg_1097____closed__20;
|
||||
static lean_object* l_Array_foldrMUnsafe_fold___at_myMacro____x40_Init_NotationExtra___hyg_4451____spec__4___closed__4;
|
||||
static lean_object* l_term_u03a3_x27___x2c_____closed__7;
|
||||
static lean_object* l_Lean_unbracktedExplicitBinders___closed__8;
|
||||
lean_object* lean_string_utf8_byte_size(lean_object*);
|
||||
static lean_object* l_Lean_myMacro____x40_Init_NotationExtra___hyg_1097____closed__41;
|
||||
static lean_object* l_Lean_bracketedExplicitBinders___closed__5;
|
||||
static lean_object* l_Lean_unbracketedExplicitBinders___closed__7;
|
||||
static lean_object* l_Lean_myMacro____x40_Init_NotationExtra___hyg_1097____closed__13;
|
||||
static lean_object* l_unexpandExists___closed__5;
|
||||
static lean_object* l_tacticFunext_______closed__5;
|
||||
|
|
@ -153,6 +152,7 @@ static lean_object* l_term_u03a3___x2c_____closed__6;
|
|||
static lean_object* l_Lean_myMacro____x40_Init_NotationExtra___hyg_27____closed__33;
|
||||
extern lean_object* l_Lean_nameLitKind;
|
||||
static lean_object* l_myMacro____x40_Init_NotationExtra___hyg_4860____lambda__3___closed__1;
|
||||
static lean_object* l_Lean_unbracketedExplicitBinders___closed__3;
|
||||
static lean_object* l_termExists___x2c_____closed__7;
|
||||
static lean_object* l_term_u03a3___x2c_____closed__2;
|
||||
static lean_object* l_myMacro____x40_Init_NotationExtra___hyg_4232____closed__7;
|
||||
|
|
@ -191,6 +191,7 @@ lean_object* lean_array_fget(lean_object*, lean_object*);
|
|||
static lean_object* l_term_u03a3_x27___x2c_____closed__5;
|
||||
static lean_object* l_term_u2203___x2c_____closed__2;
|
||||
uint8_t lean_nat_dec_eq(lean_object*, lean_object*);
|
||||
static lean_object* l_Lean_unbracketedExplicitBinders___closed__9;
|
||||
static lean_object* l_myMacro____x40_Init_NotationExtra___hyg_5416____closed__7;
|
||||
static lean_object* l_tacticFunext_______closed__6;
|
||||
static lean_object* l_Array_forInUnsafe_loop___at___private_Init_NotationExtra_0__Lean_mkHintBody___spec__1___closed__2;
|
||||
|
|
@ -203,6 +204,7 @@ lean_object* l___private_Init_Meta_0__Lean_getEscapedNameParts_x3f(lean_object*,
|
|||
static lean_object* l_solve___closed__8;
|
||||
lean_object* l_Array_foldrMUnsafe_fold___at_myMacro____x40_Init_NotationExtra___hyg_4451____spec__4(lean_object*, size_t, size_t, lean_object*, lean_object*, lean_object*);
|
||||
static lean_object* l_Lean_unifConstraint___closed__9;
|
||||
static lean_object* l_Lean_unbracketedExplicitBinders___closed__11;
|
||||
static lean_object* l_command__ClassAbbrev_____x3a___x3a_x3d_____x2c___closed__29;
|
||||
static lean_object* l_Lean_unifConstraintElem___closed__4;
|
||||
lean_object* lean_nat_sub(lean_object*, lean_object*);
|
||||
|
|
@ -229,6 +231,7 @@ static lean_object* l_term_u03a3_x27___x2c_____closed__8;
|
|||
static lean_object* l_termExists___x2c_____closed__8;
|
||||
static lean_object* l_myMacro____x40_Init_NotationExtra___hyg_5416____closed__3;
|
||||
static lean_object* l_Lean_expandExplicitBindersAux_loop___closed__7;
|
||||
static lean_object* l_Lean_unbracketedExplicitBinders___closed__8;
|
||||
static lean_object* l_Lean_unifConstraintElem___closed__1;
|
||||
static lean_object* l_Lean_myMacro____x40_Init_NotationExtra___hyg_1097____closed__11;
|
||||
static lean_object* l_command__ClassAbbrev_____x3a___x3a_x3d_____x2c___closed__7;
|
||||
|
|
@ -253,13 +256,13 @@ static lean_object* l_term_u03a3_x27___x2c_____closed__6;
|
|||
lean_object* l___private_Init_Meta_0__Lean_quoteNameMk(lean_object*);
|
||||
static lean_object* l_Lean_myMacro____x40_Init_NotationExtra___hyg_1097____closed__22;
|
||||
static lean_object* l_Lean_myMacro____x40_Init_NotationExtra___hyg_27____closed__8;
|
||||
static lean_object* l_Lean_unbracktedExplicitBinders___closed__10;
|
||||
static lean_object* l_termExists___x2c_____closed__6;
|
||||
static lean_object* l_Lean_myMacro____x40_Init_NotationExtra___hyg_1097____closed__19;
|
||||
static lean_object* l_Lean_unbracketedExplicitBinders___closed__6;
|
||||
static lean_object* l_solve___closed__13;
|
||||
static lean_object* l_Lean_command__Unif__hint______Where___x7c_x2d_u22a2_____closed__20;
|
||||
static lean_object* l_Lean_unbracketedExplicitBinders___closed__13;
|
||||
lean_object* l_Lean_bracketedExplicitBinders;
|
||||
static lean_object* l_Lean_unbracktedExplicitBinders___closed__6;
|
||||
lean_object* l_myMacro____x40_Init_NotationExtra___hyg_4860____lambda__1___boxed(lean_object*, lean_object*);
|
||||
static lean_object* l_Lean_myMacro____x40_Init_NotationExtra___hyg_27____closed__1;
|
||||
lean_object* l_myMacro____x40_Init_NotationExtra___hyg_4860____boxed(lean_object*, lean_object*, lean_object*);
|
||||
|
|
@ -303,6 +306,7 @@ static lean_object* l_term_u03a3___x2c_____closed__3;
|
|||
static lean_object* l_command__ClassAbbrev_____x3a___x3a_x3d_____x2c___closed__18;
|
||||
lean_object* l_Lean_addMacroScope(lean_object*, lean_object*, lean_object*);
|
||||
static lean_object* l_myMacro____x40_Init_NotationExtra___hyg_4232____closed__3;
|
||||
static lean_object* l_Lean_unbracketedExplicitBinders___closed__12;
|
||||
lean_object* l_tacticFunext____;
|
||||
static lean_object* l_myMacro____x40_Init_NotationExtra___hyg_5416____closed__6;
|
||||
static lean_object* l_myMacro____x40_Init_NotationExtra___hyg_4451____closed__2;
|
||||
|
|
@ -328,7 +332,6 @@ static lean_object* l_Lean_bracketedExplicitBinders___closed__4;
|
|||
static lean_object* l_myMacro____x40_Init_NotationExtra___hyg_4860____lambda__3___closed__8;
|
||||
static lean_object* l_term___xd7_x27_____closed__4;
|
||||
lean_object* l_Lean_expandExplicitBindersAux_loop_match__2___rarg(lean_object*, lean_object*, lean_object*);
|
||||
static lean_object* l_Lean_unbracktedExplicitBinders___closed__11;
|
||||
lean_object* l_myMacro____x40_Init_NotationExtra___hyg_4860____lambda__2(lean_object*);
|
||||
static lean_object* l_Lean_command__Unif__hint______Where___x7c_x2d_u22a2_____closed__6;
|
||||
static lean_object* l_Lean_myMacro____x40_Init_NotationExtra___hyg_27____closed__31;
|
||||
|
|
@ -366,6 +369,7 @@ static lean_object* l_Lean_myMacro____x40_Init_NotationExtra___hyg_27____closed_
|
|||
static lean_object* l_Lean_myMacro____x40_Init_NotationExtra___hyg_1097____closed__1;
|
||||
lean_object* l_Lean_Syntax_getArgs(lean_object*);
|
||||
lean_object* l_Lean_Name_append(lean_object*, lean_object*);
|
||||
static lean_object* l_Lean_unbracketedExplicitBinders___closed__10;
|
||||
static lean_object* l_term_u03a3_x27___x2c_____closed__2;
|
||||
lean_object* l_Lean_Syntax_getKind(lean_object*);
|
||||
lean_object* l_Lean_MacroScopesView_review(lean_object*);
|
||||
|
|
@ -387,7 +391,6 @@ static lean_object* l_solve___closed__3;
|
|||
static lean_object* l_tacticFunext_______closed__10;
|
||||
lean_object* l_myMacro____x40_Init_NotationExtra___hyg_4451__match__1(lean_object*);
|
||||
lean_object* l_myMacro____x40_Init_NotationExtra___hyg_5416____boxed(lean_object*, lean_object*, lean_object*);
|
||||
static lean_object* l_Lean_unbracktedExplicitBinders___closed__7;
|
||||
lean_object* l_Array_ofSubarray___rarg(lean_object*);
|
||||
static lean_object* l_solve___closed__15;
|
||||
lean_object* l_myMacro____x40_Init_NotationExtra___hyg_1923_(lean_object*, lean_object*, lean_object*);
|
||||
|
|
@ -452,12 +455,13 @@ lean_object* l_Lean_expandExplicitBindersAux_loop___boxed(lean_object*, lean_obj
|
|||
static lean_object* l_command__ClassAbbrev_____x3a___x3a_x3d_____x2c___closed__21;
|
||||
static lean_object* l_Lean_expandExplicitBindersAux_loop___closed__9;
|
||||
static lean_object* l_command__ClassAbbrev_____x3a___x3a_x3d_____x2c___closed__23;
|
||||
lean_object* l_Lean_unbracketedExplicitBinders;
|
||||
static lean_object* l_Lean_myMacro____x40_Init_NotationExtra___hyg_27____closed__13;
|
||||
static lean_object* l_myMacro____x40_Init_NotationExtra___hyg_4451____closed__3;
|
||||
static lean_object* l_Lean_myMacro____x40_Init_NotationExtra___hyg_1097____closed__8;
|
||||
static lean_object* l_tacticFunext_______closed__12;
|
||||
static lean_object* l_Lean_unbracketedExplicitBinders___closed__5;
|
||||
static lean_object* l_Lean_myMacro____x40_Init_NotationExtra___hyg_1097____closed__17;
|
||||
static lean_object* l_Lean_unbracktedExplicitBinders___closed__13;
|
||||
static lean_object* l_Lean_expandExplicitBindersAux_loop___closed__8;
|
||||
static lean_object* l_Lean_binderIdent___closed__2;
|
||||
static lean_object* l_term___xd7____1___closed__4;
|
||||
|
|
@ -470,7 +474,6 @@ static lean_object* l_Lean_myMacro____x40_Init_NotationExtra___hyg_1097____close
|
|||
static lean_object* l_solve___closed__4;
|
||||
static lean_object* l_Lean_expandExplicitBindersAux_loop___closed__2;
|
||||
static lean_object* l_Lean_command__Unif__hint______Where___x7c_x2d_u22a2_____closed__27;
|
||||
static lean_object* l_Lean_unbracktedExplicitBinders___closed__1;
|
||||
static lean_object* l_term___xd7_x27_____closed__2;
|
||||
static lean_object* l_Lean_termMacro_x2etrace_x5b_____x5d_____closed__18;
|
||||
static lean_object* l_Lean_myMacro____x40_Init_NotationExtra___hyg_1097____closed__5;
|
||||
|
|
@ -488,7 +491,6 @@ static lean_object* l_Lean_myMacro____x40_Init_NotationExtra___hyg_27____closed_
|
|||
static lean_object* l_Lean_myMacro____x40_Init_NotationExtra___hyg_1097____closed__14;
|
||||
static lean_object* l_Lean_termMacro_x2etrace_x5b_____x5d_____closed__5;
|
||||
lean_object* l_unsafeCast(lean_object*, lean_object*, lean_object*);
|
||||
static lean_object* l_Lean_unbracktedExplicitBinders___closed__3;
|
||||
static lean_object* l_myMacro____x40_Init_NotationExtra___hyg_4860____lambda__3___closed__15;
|
||||
static lean_object* l_Lean_myMacro____x40_Init_NotationExtra___hyg_1097____closed__15;
|
||||
static lean_object* l_myMacro____x40_Init_NotationExtra___hyg_4232____closed__11;
|
||||
|
|
@ -512,7 +514,6 @@ static lean_object* l_Lean_myMacro____x40_Init_NotationExtra___hyg_27____closed_
|
|||
static lean_object* l_Lean_unifConstraintElem___closed__10;
|
||||
lean_object* l_myMacro____x40_Init_NotationExtra___hyg_2007____boxed(lean_object*, lean_object*, lean_object*);
|
||||
static lean_object* l_myMacro____x40_Init_NotationExtra___hyg_1839____closed__2;
|
||||
static lean_object* l_Lean_unbracktedExplicitBinders___closed__12;
|
||||
static lean_object* l_Lean_command__Unif__hint______Where___x7c_x2d_u22a2_____closed__1;
|
||||
static lean_object* l_term_u2203___x2c_____closed__6;
|
||||
static lean_object* l_Lean_myMacro____x40_Init_NotationExtra___hyg_27____closed__16;
|
||||
|
|
@ -523,7 +524,6 @@ static lean_object* l_term___xd7_x27_____closed__3;
|
|||
lean_object* l___private_Init_NotationExtra_0__Lean_mkHintBody___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
static lean_object* l_command__ClassAbbrev_____x3a___x3a_x3d_____x2c___closed__4;
|
||||
static lean_object* l_Lean_termMacro_x2etrace_x5b_____x5d_____closed__2;
|
||||
static lean_object* l_Lean_unbracktedExplicitBinders___closed__2;
|
||||
static lean_object* l_myMacro____x40_Init_NotationExtra___hyg_4451____closed__4;
|
||||
static lean_object* l_term___xd7_x27_____closed__7;
|
||||
static lean_object* l_myMacro____x40_Init_NotationExtra___hyg_2007____closed__1;
|
||||
|
|
@ -1466,25 +1466,25 @@ x_1 = l_Lean_binderIdent___closed__8;
|
|||
return x_1;
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l_Lean_unbracktedExplicitBinders___closed__1() {
|
||||
static lean_object* _init_l_Lean_unbracketedExplicitBinders___closed__1() {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_1;
|
||||
x_1 = lean_mk_string("unbracktedExplicitBinders");
|
||||
x_1 = lean_mk_string("unbracketedExplicitBinders");
|
||||
return x_1;
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l_Lean_unbracktedExplicitBinders___closed__2() {
|
||||
static lean_object* _init_l_Lean_unbracketedExplicitBinders___closed__2() {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_1; lean_object* x_2; lean_object* x_3;
|
||||
x_1 = l_Lean_termMacro_x2etrace_x5b_____x5d_____closed__2;
|
||||
x_2 = l_Lean_unbracktedExplicitBinders___closed__1;
|
||||
x_2 = l_Lean_unbracketedExplicitBinders___closed__1;
|
||||
x_3 = lean_name_mk_string(x_1, x_2);
|
||||
return x_3;
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l_Lean_unbracktedExplicitBinders___closed__3() {
|
||||
static lean_object* _init_l_Lean_unbracketedExplicitBinders___closed__3() {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_1;
|
||||
|
|
@ -1492,21 +1492,21 @@ x_1 = lean_mk_string("many1");
|
|||
return x_1;
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l_Lean_unbracktedExplicitBinders___closed__4() {
|
||||
static lean_object* _init_l_Lean_unbracketedExplicitBinders___closed__4() {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_1; lean_object* x_2; lean_object* x_3;
|
||||
x_1 = lean_box(0);
|
||||
x_2 = l_Lean_unbracktedExplicitBinders___closed__3;
|
||||
x_2 = l_Lean_unbracketedExplicitBinders___closed__3;
|
||||
x_3 = lean_name_mk_string(x_1, x_2);
|
||||
return x_3;
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l_Lean_unbracktedExplicitBinders___closed__5() {
|
||||
static lean_object* _init_l_Lean_unbracketedExplicitBinders___closed__5() {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_1; lean_object* x_2; lean_object* x_3;
|
||||
x_1 = l_Lean_unbracktedExplicitBinders___closed__4;
|
||||
x_1 = l_Lean_unbracketedExplicitBinders___closed__4;
|
||||
x_2 = l_Lean_binderIdent;
|
||||
x_3 = lean_alloc_ctor(1, 2, 0);
|
||||
lean_ctor_set(x_3, 0, x_1);
|
||||
|
|
@ -1514,7 +1514,7 @@ lean_ctor_set(x_3, 1, x_2);
|
|||
return x_3;
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l_Lean_unbracktedExplicitBinders___closed__6() {
|
||||
static lean_object* _init_l_Lean_unbracketedExplicitBinders___closed__6() {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_1;
|
||||
|
|
@ -1522,17 +1522,17 @@ x_1 = lean_mk_string("optional");
|
|||
return x_1;
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l_Lean_unbracktedExplicitBinders___closed__7() {
|
||||
static lean_object* _init_l_Lean_unbracketedExplicitBinders___closed__7() {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_1; lean_object* x_2; lean_object* x_3;
|
||||
x_1 = lean_box(0);
|
||||
x_2 = l_Lean_unbracktedExplicitBinders___closed__6;
|
||||
x_2 = l_Lean_unbracketedExplicitBinders___closed__6;
|
||||
x_3 = lean_name_mk_string(x_1, x_2);
|
||||
return x_3;
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l_Lean_unbracktedExplicitBinders___closed__8() {
|
||||
static lean_object* _init_l_Lean_unbracketedExplicitBinders___closed__8() {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_1;
|
||||
|
|
@ -1540,22 +1540,22 @@ x_1 = lean_mk_string(" : ");
|
|||
return x_1;
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l_Lean_unbracktedExplicitBinders___closed__9() {
|
||||
static lean_object* _init_l_Lean_unbracketedExplicitBinders___closed__9() {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_1; lean_object* x_2;
|
||||
x_1 = l_Lean_unbracktedExplicitBinders___closed__8;
|
||||
x_1 = l_Lean_unbracketedExplicitBinders___closed__8;
|
||||
x_2 = lean_alloc_ctor(5, 1, 0);
|
||||
lean_ctor_set(x_2, 0, x_1);
|
||||
return x_2;
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l_Lean_unbracktedExplicitBinders___closed__10() {
|
||||
static lean_object* _init_l_Lean_unbracketedExplicitBinders___closed__10() {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4;
|
||||
x_1 = l_Lean_termMacro_x2etrace_x5b_____x5d_____closed__6;
|
||||
x_2 = l_Lean_unbracktedExplicitBinders___closed__9;
|
||||
x_2 = l_Lean_unbracketedExplicitBinders___closed__9;
|
||||
x_3 = l_Lean_termMacro_x2etrace_x5b_____x5d_____closed__20;
|
||||
x_4 = lean_alloc_ctor(2, 3, 0);
|
||||
lean_ctor_set(x_4, 0, x_1);
|
||||
|
|
@ -1564,25 +1564,25 @@ lean_ctor_set(x_4, 2, x_3);
|
|||
return x_4;
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l_Lean_unbracktedExplicitBinders___closed__11() {
|
||||
static lean_object* _init_l_Lean_unbracketedExplicitBinders___closed__11() {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_1; lean_object* x_2; lean_object* x_3;
|
||||
x_1 = l_Lean_unbracktedExplicitBinders___closed__7;
|
||||
x_2 = l_Lean_unbracktedExplicitBinders___closed__10;
|
||||
x_1 = l_Lean_unbracketedExplicitBinders___closed__7;
|
||||
x_2 = l_Lean_unbracketedExplicitBinders___closed__10;
|
||||
x_3 = lean_alloc_ctor(1, 2, 0);
|
||||
lean_ctor_set(x_3, 0, x_1);
|
||||
lean_ctor_set(x_3, 1, x_2);
|
||||
return x_3;
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l_Lean_unbracktedExplicitBinders___closed__12() {
|
||||
static lean_object* _init_l_Lean_unbracketedExplicitBinders___closed__12() {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4;
|
||||
x_1 = l_Lean_termMacro_x2etrace_x5b_____x5d_____closed__6;
|
||||
x_2 = l_Lean_unbracktedExplicitBinders___closed__5;
|
||||
x_3 = l_Lean_unbracktedExplicitBinders___closed__11;
|
||||
x_2 = l_Lean_unbracketedExplicitBinders___closed__5;
|
||||
x_3 = l_Lean_unbracketedExplicitBinders___closed__11;
|
||||
x_4 = lean_alloc_ctor(2, 3, 0);
|
||||
lean_ctor_set(x_4, 0, x_1);
|
||||
lean_ctor_set(x_4, 1, x_2);
|
||||
|
|
@ -1590,13 +1590,13 @@ lean_ctor_set(x_4, 2, x_3);
|
|||
return x_4;
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l_Lean_unbracktedExplicitBinders___closed__13() {
|
||||
static lean_object* _init_l_Lean_unbracketedExplicitBinders___closed__13() {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4;
|
||||
x_1 = l_Lean_unbracktedExplicitBinders___closed__1;
|
||||
x_2 = l_Lean_unbracktedExplicitBinders___closed__2;
|
||||
x_3 = l_Lean_unbracktedExplicitBinders___closed__12;
|
||||
x_1 = l_Lean_unbracketedExplicitBinders___closed__1;
|
||||
x_2 = l_Lean_unbracketedExplicitBinders___closed__2;
|
||||
x_3 = l_Lean_unbracketedExplicitBinders___closed__12;
|
||||
x_4 = lean_alloc_ctor(9, 3, 0);
|
||||
lean_ctor_set(x_4, 0, x_1);
|
||||
lean_ctor_set(x_4, 1, x_2);
|
||||
|
|
@ -1604,11 +1604,11 @@ lean_ctor_set(x_4, 2, x_3);
|
|||
return x_4;
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l_Lean_unbracktedExplicitBinders() {
|
||||
static lean_object* _init_l_Lean_unbracketedExplicitBinders() {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_1;
|
||||
x_1 = l_Lean_unbracktedExplicitBinders___closed__13;
|
||||
x_1 = l_Lean_unbracketedExplicitBinders___closed__13;
|
||||
return x_1;
|
||||
}
|
||||
}
|
||||
|
|
@ -1646,7 +1646,7 @@ _start:
|
|||
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4;
|
||||
x_1 = l_Lean_termMacro_x2etrace_x5b_____x5d_____closed__6;
|
||||
x_2 = l_Lean_bracketedExplicitBinders___closed__3;
|
||||
x_3 = l_Lean_unbracktedExplicitBinders___closed__5;
|
||||
x_3 = l_Lean_unbracketedExplicitBinders___closed__5;
|
||||
x_4 = lean_alloc_ctor(2, 3, 0);
|
||||
lean_ctor_set(x_4, 0, x_1);
|
||||
lean_ctor_set(x_4, 1, x_2);
|
||||
|
|
@ -1660,7 +1660,7 @@ _start:
|
|||
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4;
|
||||
x_1 = l_Lean_termMacro_x2etrace_x5b_____x5d_____closed__6;
|
||||
x_2 = l_Lean_bracketedExplicitBinders___closed__4;
|
||||
x_3 = l_Lean_unbracktedExplicitBinders___closed__9;
|
||||
x_3 = l_Lean_unbracketedExplicitBinders___closed__9;
|
||||
x_4 = lean_alloc_ctor(2, 3, 0);
|
||||
lean_ctor_set(x_4, 0, x_1);
|
||||
lean_ctor_set(x_4, 1, x_2);
|
||||
|
|
@ -1750,7 +1750,7 @@ static lean_object* _init_l_Lean_explicitBinders___closed__3() {
|
|||
_start:
|
||||
{
|
||||
lean_object* x_1; lean_object* x_2; lean_object* x_3;
|
||||
x_1 = l_Lean_unbracktedExplicitBinders___closed__4;
|
||||
x_1 = l_Lean_unbracketedExplicitBinders___closed__4;
|
||||
x_2 = l_Lean_bracketedExplicitBinders;
|
||||
x_3 = lean_alloc_ctor(1, 2, 0);
|
||||
lean_ctor_set(x_3, 0, x_1);
|
||||
|
|
@ -1764,7 +1764,7 @@ _start:
|
|||
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4;
|
||||
x_1 = l_Lean_binderIdent___closed__4;
|
||||
x_2 = l_Lean_explicitBinders___closed__3;
|
||||
x_3 = l_Lean_unbracktedExplicitBinders;
|
||||
x_3 = l_Lean_unbracketedExplicitBinders;
|
||||
x_4 = lean_alloc_ctor(2, 3, 0);
|
||||
lean_ctor_set(x_4, 0, x_1);
|
||||
lean_ctor_set(x_4, 1, x_2);
|
||||
|
|
@ -2507,7 +2507,7 @@ x_8 = lean_unsigned_to_nat(0u);
|
|||
x_9 = l_Lean_Syntax_getArg(x_2, x_8);
|
||||
lean_inc(x_9);
|
||||
x_10 = l_Lean_Syntax_getKind(x_9);
|
||||
x_11 = l_Lean_unbracktedExplicitBinders___closed__2;
|
||||
x_11 = l_Lean_unbracketedExplicitBinders___closed__2;
|
||||
x_12 = lean_name_eq(x_10, x_11);
|
||||
lean_dec(x_10);
|
||||
if (x_12 == 0)
|
||||
|
|
@ -2844,7 +2844,7 @@ static lean_object* _init_l_Lean_unifConstraintElem___closed__9() {
|
|||
_start:
|
||||
{
|
||||
lean_object* x_1; lean_object* x_2; lean_object* x_3;
|
||||
x_1 = l_Lean_unbracktedExplicitBinders___closed__7;
|
||||
x_1 = l_Lean_unbracketedExplicitBinders___closed__7;
|
||||
x_2 = l_Lean_unifConstraintElem___closed__8;
|
||||
x_3 = lean_alloc_ctor(1, 2, 0);
|
||||
lean_ctor_set(x_3, 0, x_1);
|
||||
|
|
@ -2970,7 +2970,7 @@ static lean_object* _init_l_Lean_command__Unif__hint______Where___x7c_x2d_u22a2_
|
|||
_start:
|
||||
{
|
||||
lean_object* x_1; lean_object* x_2; lean_object* x_3;
|
||||
x_1 = l_Lean_unbracktedExplicitBinders___closed__7;
|
||||
x_1 = l_Lean_unbracketedExplicitBinders___closed__7;
|
||||
x_2 = l_Lean_termMacro_x2etrace_x5b_____x5d_____closed__11;
|
||||
x_3 = lean_alloc_ctor(1, 2, 0);
|
||||
lean_ctor_set(x_3, 0, x_1);
|
||||
|
|
@ -5994,7 +5994,7 @@ x_156 = l_Lean_myMacro____x40_Init_NotationExtra___hyg_27____closed__26;
|
|||
x_157 = lean_array_push(x_156, x_155);
|
||||
x_158 = l_Lean_myMacro____x40_Init_NotationExtra___hyg_27____closed__28;
|
||||
x_159 = lean_array_push(x_157, x_158);
|
||||
x_160 = l_Lean_unbracktedExplicitBinders___closed__2;
|
||||
x_160 = l_Lean_unbracketedExplicitBinders___closed__2;
|
||||
x_161 = lean_alloc_ctor(1, 2, 0);
|
||||
lean_ctor_set(x_161, 0, x_160);
|
||||
lean_ctor_set(x_161, 1, x_159);
|
||||
|
|
@ -6046,7 +6046,7 @@ x_184 = l_Lean_myMacro____x40_Init_NotationExtra___hyg_27____closed__26;
|
|||
x_185 = lean_array_push(x_184, x_183);
|
||||
x_186 = l_Lean_myMacro____x40_Init_NotationExtra___hyg_27____closed__28;
|
||||
x_187 = lean_array_push(x_185, x_186);
|
||||
x_188 = l_Lean_unbracktedExplicitBinders___closed__2;
|
||||
x_188 = l_Lean_unbracketedExplicitBinders___closed__2;
|
||||
x_189 = lean_alloc_ctor(1, 2, 0);
|
||||
lean_ctor_set(x_189, 0, x_188);
|
||||
lean_ctor_set(x_189, 1, x_187);
|
||||
|
|
@ -6110,7 +6110,7 @@ x_217 = l_Lean_myMacro____x40_Init_NotationExtra___hyg_27____closed__26;
|
|||
x_218 = lean_array_push(x_217, x_216);
|
||||
x_219 = l_Lean_myMacro____x40_Init_NotationExtra___hyg_27____closed__28;
|
||||
x_220 = lean_array_push(x_218, x_219);
|
||||
x_221 = l_Lean_unbracktedExplicitBinders___closed__2;
|
||||
x_221 = l_Lean_unbracketedExplicitBinders___closed__2;
|
||||
x_222 = lean_alloc_ctor(1, 2, 0);
|
||||
lean_ctor_set(x_222, 0, x_221);
|
||||
lean_ctor_set(x_222, 1, x_220);
|
||||
|
|
@ -6161,7 +6161,7 @@ x_244 = l_Lean_myMacro____x40_Init_NotationExtra___hyg_27____closed__26;
|
|||
x_245 = lean_array_push(x_244, x_243);
|
||||
x_246 = l_Lean_myMacro____x40_Init_NotationExtra___hyg_27____closed__28;
|
||||
x_247 = lean_array_push(x_245, x_246);
|
||||
x_248 = l_Lean_unbracktedExplicitBinders___closed__2;
|
||||
x_248 = l_Lean_unbracketedExplicitBinders___closed__2;
|
||||
x_249 = lean_alloc_ctor(1, 2, 0);
|
||||
lean_ctor_set(x_249, 0, x_248);
|
||||
lean_ctor_set(x_249, 1, x_247);
|
||||
|
|
@ -6192,7 +6192,7 @@ else
|
|||
lean_object* x_261; lean_object* x_262; uint8_t x_263;
|
||||
x_261 = l_Lean_Syntax_getArg(x_202, x_7);
|
||||
lean_dec(x_202);
|
||||
x_262 = l_Lean_unbracktedExplicitBinders___closed__2;
|
||||
x_262 = l_Lean_unbracketedExplicitBinders___closed__2;
|
||||
lean_inc(x_261);
|
||||
x_263 = l_Lean_Syntax_isOfKind(x_261, x_262);
|
||||
if (x_263 == 0)
|
||||
|
|
@ -7331,7 +7331,7 @@ static lean_object* _init_l_tacticFunext_______closed__10() {
|
|||
_start:
|
||||
{
|
||||
lean_object* x_1; lean_object* x_2; lean_object* x_3;
|
||||
x_1 = l_Lean_unbracktedExplicitBinders___closed__4;
|
||||
x_1 = l_Lean_unbracketedExplicitBinders___closed__4;
|
||||
x_2 = l_tacticFunext_______closed__9;
|
||||
x_3 = lean_alloc_ctor(1, 2, 0);
|
||||
lean_ctor_set(x_3, 0, x_1);
|
||||
|
|
@ -8993,7 +8993,7 @@ static lean_object* _init_l_command__ClassAbbrev_____x3a___x3a_x3d_____x2c___clo
|
|||
_start:
|
||||
{
|
||||
lean_object* x_1; lean_object* x_2; lean_object* x_3;
|
||||
x_1 = l_Lean_unbracktedExplicitBinders___closed__7;
|
||||
x_1 = l_Lean_unbracketedExplicitBinders___closed__7;
|
||||
x_2 = l_command__ClassAbbrev_____x3a___x3a_x3d_____x2c___closed__16;
|
||||
x_3 = lean_alloc_ctor(1, 2, 0);
|
||||
lean_ctor_set(x_3, 0, x_1);
|
||||
|
|
@ -9085,7 +9085,7 @@ static lean_object* _init_l_command__ClassAbbrev_____x3a___x3a_x3d_____x2c___clo
|
|||
_start:
|
||||
{
|
||||
lean_object* x_1; lean_object* x_2; lean_object* x_3;
|
||||
x_1 = l_Lean_unbracktedExplicitBinders___closed__7;
|
||||
x_1 = l_Lean_unbracketedExplicitBinders___closed__7;
|
||||
x_2 = l_command__ClassAbbrev_____x3a___x3a_x3d_____x2c___closed__24;
|
||||
x_3 = lean_alloc_ctor(1, 2, 0);
|
||||
lean_ctor_set(x_3, 0, x_1);
|
||||
|
|
@ -10170,7 +10170,7 @@ static lean_object* _init_l_solve___closed__12() {
|
|||
_start:
|
||||
{
|
||||
lean_object* x_1; lean_object* x_2; lean_object* x_3;
|
||||
x_1 = l_Lean_unbracktedExplicitBinders___closed__4;
|
||||
x_1 = l_Lean_unbracketedExplicitBinders___closed__4;
|
||||
x_2 = l_solve___closed__11;
|
||||
x_3 = lean_alloc_ctor(1, 2, 0);
|
||||
lean_ctor_set(x_3, 0, x_1);
|
||||
|
|
@ -10839,34 +10839,34 @@ l_Lean_binderIdent___closed__8 = _init_l_Lean_binderIdent___closed__8();
|
|||
lean_mark_persistent(l_Lean_binderIdent___closed__8);
|
||||
l_Lean_binderIdent = _init_l_Lean_binderIdent();
|
||||
lean_mark_persistent(l_Lean_binderIdent);
|
||||
l_Lean_unbracktedExplicitBinders___closed__1 = _init_l_Lean_unbracktedExplicitBinders___closed__1();
|
||||
lean_mark_persistent(l_Lean_unbracktedExplicitBinders___closed__1);
|
||||
l_Lean_unbracktedExplicitBinders___closed__2 = _init_l_Lean_unbracktedExplicitBinders___closed__2();
|
||||
lean_mark_persistent(l_Lean_unbracktedExplicitBinders___closed__2);
|
||||
l_Lean_unbracktedExplicitBinders___closed__3 = _init_l_Lean_unbracktedExplicitBinders___closed__3();
|
||||
lean_mark_persistent(l_Lean_unbracktedExplicitBinders___closed__3);
|
||||
l_Lean_unbracktedExplicitBinders___closed__4 = _init_l_Lean_unbracktedExplicitBinders___closed__4();
|
||||
lean_mark_persistent(l_Lean_unbracktedExplicitBinders___closed__4);
|
||||
l_Lean_unbracktedExplicitBinders___closed__5 = _init_l_Lean_unbracktedExplicitBinders___closed__5();
|
||||
lean_mark_persistent(l_Lean_unbracktedExplicitBinders___closed__5);
|
||||
l_Lean_unbracktedExplicitBinders___closed__6 = _init_l_Lean_unbracktedExplicitBinders___closed__6();
|
||||
lean_mark_persistent(l_Lean_unbracktedExplicitBinders___closed__6);
|
||||
l_Lean_unbracktedExplicitBinders___closed__7 = _init_l_Lean_unbracktedExplicitBinders___closed__7();
|
||||
lean_mark_persistent(l_Lean_unbracktedExplicitBinders___closed__7);
|
||||
l_Lean_unbracktedExplicitBinders___closed__8 = _init_l_Lean_unbracktedExplicitBinders___closed__8();
|
||||
lean_mark_persistent(l_Lean_unbracktedExplicitBinders___closed__8);
|
||||
l_Lean_unbracktedExplicitBinders___closed__9 = _init_l_Lean_unbracktedExplicitBinders___closed__9();
|
||||
lean_mark_persistent(l_Lean_unbracktedExplicitBinders___closed__9);
|
||||
l_Lean_unbracktedExplicitBinders___closed__10 = _init_l_Lean_unbracktedExplicitBinders___closed__10();
|
||||
lean_mark_persistent(l_Lean_unbracktedExplicitBinders___closed__10);
|
||||
l_Lean_unbracktedExplicitBinders___closed__11 = _init_l_Lean_unbracktedExplicitBinders___closed__11();
|
||||
lean_mark_persistent(l_Lean_unbracktedExplicitBinders___closed__11);
|
||||
l_Lean_unbracktedExplicitBinders___closed__12 = _init_l_Lean_unbracktedExplicitBinders___closed__12();
|
||||
lean_mark_persistent(l_Lean_unbracktedExplicitBinders___closed__12);
|
||||
l_Lean_unbracktedExplicitBinders___closed__13 = _init_l_Lean_unbracktedExplicitBinders___closed__13();
|
||||
lean_mark_persistent(l_Lean_unbracktedExplicitBinders___closed__13);
|
||||
l_Lean_unbracktedExplicitBinders = _init_l_Lean_unbracktedExplicitBinders();
|
||||
lean_mark_persistent(l_Lean_unbracktedExplicitBinders);
|
||||
l_Lean_unbracketedExplicitBinders___closed__1 = _init_l_Lean_unbracketedExplicitBinders___closed__1();
|
||||
lean_mark_persistent(l_Lean_unbracketedExplicitBinders___closed__1);
|
||||
l_Lean_unbracketedExplicitBinders___closed__2 = _init_l_Lean_unbracketedExplicitBinders___closed__2();
|
||||
lean_mark_persistent(l_Lean_unbracketedExplicitBinders___closed__2);
|
||||
l_Lean_unbracketedExplicitBinders___closed__3 = _init_l_Lean_unbracketedExplicitBinders___closed__3();
|
||||
lean_mark_persistent(l_Lean_unbracketedExplicitBinders___closed__3);
|
||||
l_Lean_unbracketedExplicitBinders___closed__4 = _init_l_Lean_unbracketedExplicitBinders___closed__4();
|
||||
lean_mark_persistent(l_Lean_unbracketedExplicitBinders___closed__4);
|
||||
l_Lean_unbracketedExplicitBinders___closed__5 = _init_l_Lean_unbracketedExplicitBinders___closed__5();
|
||||
lean_mark_persistent(l_Lean_unbracketedExplicitBinders___closed__5);
|
||||
l_Lean_unbracketedExplicitBinders___closed__6 = _init_l_Lean_unbracketedExplicitBinders___closed__6();
|
||||
lean_mark_persistent(l_Lean_unbracketedExplicitBinders___closed__6);
|
||||
l_Lean_unbracketedExplicitBinders___closed__7 = _init_l_Lean_unbracketedExplicitBinders___closed__7();
|
||||
lean_mark_persistent(l_Lean_unbracketedExplicitBinders___closed__7);
|
||||
l_Lean_unbracketedExplicitBinders___closed__8 = _init_l_Lean_unbracketedExplicitBinders___closed__8();
|
||||
lean_mark_persistent(l_Lean_unbracketedExplicitBinders___closed__8);
|
||||
l_Lean_unbracketedExplicitBinders___closed__9 = _init_l_Lean_unbracketedExplicitBinders___closed__9();
|
||||
lean_mark_persistent(l_Lean_unbracketedExplicitBinders___closed__9);
|
||||
l_Lean_unbracketedExplicitBinders___closed__10 = _init_l_Lean_unbracketedExplicitBinders___closed__10();
|
||||
lean_mark_persistent(l_Lean_unbracketedExplicitBinders___closed__10);
|
||||
l_Lean_unbracketedExplicitBinders___closed__11 = _init_l_Lean_unbracketedExplicitBinders___closed__11();
|
||||
lean_mark_persistent(l_Lean_unbracketedExplicitBinders___closed__11);
|
||||
l_Lean_unbracketedExplicitBinders___closed__12 = _init_l_Lean_unbracketedExplicitBinders___closed__12();
|
||||
lean_mark_persistent(l_Lean_unbracketedExplicitBinders___closed__12);
|
||||
l_Lean_unbracketedExplicitBinders___closed__13 = _init_l_Lean_unbracketedExplicitBinders___closed__13();
|
||||
lean_mark_persistent(l_Lean_unbracketedExplicitBinders___closed__13);
|
||||
l_Lean_unbracketedExplicitBinders = _init_l_Lean_unbracketedExplicitBinders();
|
||||
lean_mark_persistent(l_Lean_unbracketedExplicitBinders);
|
||||
l_Lean_bracketedExplicitBinders___closed__1 = _init_l_Lean_bracketedExplicitBinders___closed__1();
|
||||
lean_mark_persistent(l_Lean_bracketedExplicitBinders___closed__1);
|
||||
l_Lean_bracketedExplicitBinders___closed__2 = _init_l_Lean_bracketedExplicitBinders___closed__2();
|
||||
|
|
|
|||
2
stage0/stdlib/Init/Prelude.c
generated
2
stage0/stdlib/Init/Prelude.c
generated
|
|
@ -10060,7 +10060,7 @@ lean_object* l_Lean_mkAtomFrom(lean_object* x_1, lean_object* x_2) {
|
|||
_start:
|
||||
{
|
||||
lean_object* x_3; lean_object* x_4;
|
||||
x_3 = l_Lean_Syntax_getHeadInfo(x_1);
|
||||
x_3 = l_Lean_SourceInfo_fromRef(x_1);
|
||||
x_4 = lean_alloc_ctor(2, 2, 0);
|
||||
lean_ctor_set(x_4, 0, x_3);
|
||||
lean_ctor_set(x_4, 1, x_2);
|
||||
|
|
|
|||
4
stage0/stdlib/Lean/Compiler/ExportAttr.c
generated
4
stage0/stdlib/Lean/Compiler/ExportAttr.c
generated
|
|
@ -70,7 +70,6 @@ lean_object* lean_string_utf8_byte_size(lean_object*);
|
|||
static uint32_t l_Lean_exportAttr___lambda__3___closed__1;
|
||||
lean_object* l_Lean_exportAttr___lambda__3___boxed(lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_initFn____x40_Lean_Compiler_ExportAttr___hyg_84____spec__5___lambda__2___boxed(lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l___private_Init_Data_String_Basic_0__Substring_nextn(lean_object*, lean_object*, lean_object*);
|
||||
static lean_object* l_Lean_registerPersistentEnvExtensionUnsafe___at_Lean_initFn____x40_Lean_Compiler_ExportAttr___hyg_84____spec__5___lambda__2___closed__1;
|
||||
lean_object* lean_nat_add(lean_object*, lean_object*);
|
||||
lean_object* l_Array_qpartition_loop___at_Lean_initFn____x40_Lean_Compiler_ExportAttr___hyg_84____spec__4___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
|
|
@ -116,6 +115,7 @@ static lean_object* l_Lean_exportAttr___lambda__1___closed__2;
|
|||
lean_object* l_Std_RBNode_find___at___private_Lean_Hygiene_0__Lean_sanitizeSyntaxAux___spec__2(lean_object*, lean_object*);
|
||||
lean_object* l_Lean_registerBuiltinAttribute(lean_object*, lean_object*);
|
||||
lean_object* l_Lean_throwError___at_Lean_AttributeImpl_erase___default___spec__1(lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Substring_nextn(lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Std_RBNode_fold___at_Std_RBMap_size___spec__1___rarg(lean_object*, lean_object*);
|
||||
lean_object* l_Lean_initFn____x40_Lean_Compiler_ExportAttr___hyg_84____lambda__2(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_exportAttr___lambda__4(lean_object*, lean_object*);
|
||||
|
|
@ -262,7 +262,7 @@ lean_ctor_set(x_7, 0, x_1);
|
|||
lean_ctor_set(x_7, 1, x_2);
|
||||
lean_ctor_set(x_7, 2, x_6);
|
||||
x_8 = lean_unsigned_to_nat(1u);
|
||||
x_9 = l___private_Init_Data_String_Basic_0__Substring_nextn(x_7, x_8, x_2);
|
||||
x_9 = l_Substring_nextn(x_7, x_8, x_2);
|
||||
lean_dec(x_7);
|
||||
x_10 = lean_nat_add(x_2, x_9);
|
||||
lean_dec(x_9);
|
||||
|
|
|
|||
10
stage0/stdlib/Lean/Data.c
generated
10
stage0/stdlib/Lean/Data.c
generated
|
|
@ -1,6 +1,6 @@
|
|||
// Lean compiler output
|
||||
// Module: Lean.Data
|
||||
// Imports: Init Lean.Data.Format Lean.Data.Json Lean.Data.JsonRpc Lean.Data.KVMap Lean.Data.LBool Lean.Data.LOption Lean.Data.Lsp Lean.Data.Name Lean.Data.Occurrences Lean.Data.OpenDecl Lean.Data.Options Lean.Data.Position Lean.Data.SMap Lean.Data.Trie Lean.Data.PrefixTree Lean.Data.NameTrie
|
||||
// Imports: Init Lean.Data.Format Lean.Data.Parsec Lean.Data.Json Lean.Data.Xml Lean.Data.JsonRpc Lean.Data.KVMap Lean.Data.LBool Lean.Data.LOption Lean.Data.Lsp Lean.Data.Name Lean.Data.Occurrences Lean.Data.OpenDecl Lean.Data.Options Lean.Data.Position Lean.Data.SMap Lean.Data.Trie Lean.Data.PrefixTree Lean.Data.NameTrie
|
||||
#include <lean/lean.h>
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic ignored "-Wunused-parameter"
|
||||
|
|
@ -15,7 +15,9 @@ extern "C" {
|
|||
#endif
|
||||
lean_object* initialize_Init(lean_object*);
|
||||
lean_object* initialize_Lean_Data_Format(lean_object*);
|
||||
lean_object* initialize_Lean_Data_Parsec(lean_object*);
|
||||
lean_object* initialize_Lean_Data_Json(lean_object*);
|
||||
lean_object* initialize_Lean_Data_Xml(lean_object*);
|
||||
lean_object* initialize_Lean_Data_JsonRpc(lean_object*);
|
||||
lean_object* initialize_Lean_Data_KVMap(lean_object*);
|
||||
lean_object* initialize_Lean_Data_LBool(lean_object*);
|
||||
|
|
@ -41,9 +43,15 @@ lean_dec_ref(res);
|
|||
res = initialize_Lean_Data_Format(lean_io_mk_world());
|
||||
if (lean_io_result_is_error(res)) return res;
|
||||
lean_dec_ref(res);
|
||||
res = initialize_Lean_Data_Parsec(lean_io_mk_world());
|
||||
if (lean_io_result_is_error(res)) return res;
|
||||
lean_dec_ref(res);
|
||||
res = initialize_Lean_Data_Json(lean_io_mk_world());
|
||||
if (lean_io_result_is_error(res)) return res;
|
||||
lean_dec_ref(res);
|
||||
res = initialize_Lean_Data_Xml(lean_io_mk_world());
|
||||
if (lean_io_result_is_error(res)) return res;
|
||||
lean_dec_ref(res);
|
||||
res = initialize_Lean_Data_JsonRpc(lean_io_mk_world());
|
||||
if (lean_io_result_is_error(res)) return res;
|
||||
lean_dec_ref(res);
|
||||
|
|
|
|||
4
stage0/stdlib/Lean/Data/Json/Basic.c
generated
4
stage0/stdlib/Lean/Data/Json/Basic.c
generated
|
|
@ -56,7 +56,6 @@ lean_object* l_Lean_Json_getArrVal_x3f(lean_object*, lean_object*);
|
|||
lean_object* l_Lean_Json_getObj_x3f_match__1___rarg(lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Json_mkObj_match__1___rarg(lean_object*, lean_object*);
|
||||
lean_object* lean_string_utf8_byte_size(lean_object*);
|
||||
lean_object* l___private_Init_Data_String_Basic_0__Substring_nextn(lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_JsonNumber_lt_match__2___rarg(lean_object*, lean_object*);
|
||||
lean_object* lean_nat_add(lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Json_getObj_x3f_match__1(lean_object*);
|
||||
|
|
@ -109,6 +108,7 @@ lean_object* l_Lean_Json_getNat_x3f___boxed(lean_object*);
|
|||
lean_object* l___private_Init_Data_String_Basic_0__Substring_takeRightWhileAux___at_Lean_JsonNumber_toString___spec__1(lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_JsonNumber_normalize(lean_object*);
|
||||
lean_object* l_Int_pow(lean_object*, lean_object*);
|
||||
lean_object* l_Substring_nextn(lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Json_instCoeIntJson(lean_object*);
|
||||
uint8_t l_Lean_JsonNumber_instOrdJsonNumber(lean_object*, lean_object*);
|
||||
lean_object* l_Lean_JsonNumber_ltProp;
|
||||
|
|
@ -3219,7 +3219,7 @@ x_33 = lean_alloc_ctor(0, 3, 0);
|
|||
lean_ctor_set(x_33, 0, x_31);
|
||||
lean_ctor_set(x_33, 1, x_4);
|
||||
lean_ctor_set(x_33, 2, x_32);
|
||||
x_34 = l___private_Init_Data_String_Basic_0__Substring_nextn(x_33, x_9, x_4);
|
||||
x_34 = l_Substring_nextn(x_33, x_9, x_4);
|
||||
lean_dec(x_33);
|
||||
x_35 = lean_nat_add(x_4, x_34);
|
||||
lean_dec(x_34);
|
||||
|
|
|
|||
2321
stage0/stdlib/Lean/Data/Json/Parser.c
generated
2321
stage0/stdlib/Lean/Data/Json/Parser.c
generated
File diff suppressed because it is too large
Load diff
13
stage0/stdlib/Lean/Data/Lsp/Capabilities.c
generated
13
stage0/stdlib/Lean/Data/Lsp/Capabilities.c
generated
|
|
@ -39,7 +39,6 @@ lean_object* l_Lean_Json_opt___at___private_Lean_Data_Lsp_Capabilities_0__Lean_L
|
|||
static lean_object* l___private_Lean_Data_Lsp_Capabilities_0__Lean_Lsp_toJsonServerCapabilities____x40_Lean_Data_Lsp_Capabilities___hyg_115____closed__6;
|
||||
static lean_object* l_Lean_Lsp_ClientCapabilities_hasToJson___closed__1;
|
||||
lean_object* l_Lean_Lsp_ClientCapabilities_hasToJson___boxed(lean_object*);
|
||||
lean_object* l_Lean_Json_opt___at___private_Lean_Data_Lsp_Capabilities_0__Lean_Lsp_toJsonServerCapabilities____x40_Lean_Data_Lsp_Capabilities___hyg_115____spec__1___boxed(lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Json_getObjValAs_x3f___at___private_Lean_Data_Lsp_Capabilities_0__Lean_Lsp_fromJsonServerCapabilities____x40_Lean_Data_Lsp_Capabilities___hyg_197____spec__2(lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Lsp_instFromJsonClientCapabilities(lean_object*);
|
||||
lean_object* l_Lean_Json_getObjValAs_x3f___at___private_Lean_Data_Lsp_Capabilities_0__Lean_Lsp_fromJsonServerCapabilities____x40_Lean_Data_Lsp_Capabilities___hyg_197____spec__2___boxed(lean_object*, lean_object*);
|
||||
|
|
@ -204,6 +203,8 @@ else
|
|||
{
|
||||
lean_object* x_4; lean_object* x_5; lean_object* x_6; lean_object* x_7; lean_object* x_8;
|
||||
x_4 = lean_ctor_get(x_2, 0);
|
||||
lean_inc(x_4);
|
||||
lean_dec(x_2);
|
||||
x_5 = l___private_Lean_Data_Lsp_TextSync_0__Lean_Lsp_toJsonTextDocumentSyncOptions____x40_Lean_Data_Lsp_TextSync___hyg_607_(x_4);
|
||||
x_6 = lean_alloc_ctor(0, 2, 0);
|
||||
lean_ctor_set(x_6, 0, x_1);
|
||||
|
|
@ -352,7 +353,6 @@ x_2 = lean_ctor_get(x_1, 0);
|
|||
lean_inc(x_2);
|
||||
x_3 = l___private_Lean_Data_Lsp_Capabilities_0__Lean_Lsp_toJsonServerCapabilities____x40_Lean_Data_Lsp_Capabilities___hyg_115____closed__1;
|
||||
x_4 = l_Lean_Json_opt___at___private_Lean_Data_Lsp_Capabilities_0__Lean_Lsp_toJsonServerCapabilities____x40_Lean_Data_Lsp_Capabilities___hyg_115____spec__1(x_3, x_2);
|
||||
lean_dec(x_2);
|
||||
x_5 = lean_ctor_get(x_1, 1);
|
||||
lean_inc(x_5);
|
||||
x_6 = l___private_Lean_Data_Lsp_Capabilities_0__Lean_Lsp_toJsonServerCapabilities____x40_Lean_Data_Lsp_Capabilities___hyg_115____closed__2;
|
||||
|
|
@ -455,15 +455,6 @@ x_52 = l_Lean_Json_mkObj(x_51);
|
|||
return x_52;
|
||||
}
|
||||
}
|
||||
lean_object* l_Lean_Json_opt___at___private_Lean_Data_Lsp_Capabilities_0__Lean_Lsp_toJsonServerCapabilities____x40_Lean_Data_Lsp_Capabilities___hyg_115____spec__1___boxed(lean_object* x_1, lean_object* x_2) {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_3;
|
||||
x_3 = l_Lean_Json_opt___at___private_Lean_Data_Lsp_Capabilities_0__Lean_Lsp_toJsonServerCapabilities____x40_Lean_Data_Lsp_Capabilities___hyg_115____spec__1(x_1, x_2);
|
||||
lean_dec(x_2);
|
||||
return x_3;
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l_Lean_Lsp_instToJsonServerCapabilities___closed__1() {
|
||||
_start:
|
||||
{
|
||||
|
|
|
|||
90
stage0/stdlib/Lean/Data/Lsp/TextSync.c
generated
90
stage0/stdlib/Lean/Data/Lsp/TextSync.c
generated
|
|
@ -74,7 +74,6 @@ lean_object* l_Lean_Json_getObjValAs_x3f___at___private_Lean_Data_Lsp_TextSync_0
|
|||
static lean_object* l___private_Lean_Data_Lsp_TextSync_0__Lean_Lsp_toJsonTextDocumentSyncOptions____x40_Lean_Data_Lsp_TextSync___hyg_607____closed__10;
|
||||
lean_object* l_Lean_Lsp_instToJsonTextDocumentSyncKind_match__1___rarg(uint8_t, lean_object*, lean_object*, lean_object*);
|
||||
static lean_object* l_Lean_Lsp_instFromJsonTextDocumentChangeRegistrationOptions___closed__1;
|
||||
lean_object* l_Lean_Json_opt___at___private_Lean_Data_Lsp_TextSync_0__Lean_Lsp_toJsonTextDocumentSyncOptions____x40_Lean_Data_Lsp_TextSync___hyg_607____spec__1___boxed(lean_object*, lean_object*);
|
||||
lean_object* l___private_Lean_Data_Lsp_TextSync_0__Lean_Lsp_toJsonSaveOptions____x40_Lean_Data_Lsp_TextSync___hyg_439____boxed(lean_object*);
|
||||
static lean_object* l___private_Lean_Data_Lsp_TextSync_0__Lean_Lsp_toJsonSaveOptions____x40_Lean_Data_Lsp_TextSync___hyg_439____closed__1;
|
||||
static lean_object* l_Lean_Lsp_instFromJsonDidChangeTextDocumentParams___closed__1;
|
||||
|
|
@ -87,7 +86,7 @@ lean_object* l_Lean_Lsp_instFromJsonDidChangeTextDocumentParams;
|
|||
lean_object* l___private_Lean_Data_Lsp_TextSync_0__Lean_Lsp_fromJsonDidOpenTextDocumentParams____x40_Lean_Data_Lsp_TextSync___hyg_105____boxed(lean_object*);
|
||||
lean_object* l_Lean_Json_getObjValAs_x3f___at___private_Lean_Data_Lsp_TextSync_0__Lean_Lsp_fromJsonTextDocumentChangeRegistrationOptions____x40_Lean_Data_Lsp_TextSync___hyg_157____spec__1___boxed(lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Json_getObjValAs_x3f___at___private_Lean_Data_Lsp_TextSync_0__Lean_Lsp_fromJsonSaveOptions____x40_Lean_Data_Lsp_TextSync___hyg_464____spec__1(lean_object*, lean_object*);
|
||||
lean_object* l___private_Lean_Data_Lsp_TextSync_0__Lean_Lsp_toJsonSaveOptions____x40_Lean_Data_Lsp_TextSync___hyg_439_(lean_object*);
|
||||
lean_object* l___private_Lean_Data_Lsp_TextSync_0__Lean_Lsp_toJsonSaveOptions____x40_Lean_Data_Lsp_TextSync___hyg_439_(uint8_t);
|
||||
lean_object* l_Lean_Json_getObjValD(lean_object*, lean_object*);
|
||||
static lean_object* l_Lean_Lsp_instFromJsonTextDocumentSyncKind___closed__1;
|
||||
lean_object* l___private_Lean_Data_Lsp_TextSync_0__Lean_Lsp_fromJsonSaveOptions____x40_Lean_Data_Lsp_TextSync___hyg_464____boxed(lean_object*);
|
||||
|
|
@ -141,7 +140,6 @@ lean_object* l_Lean_Lsp_instFromJsonSaveOptions;
|
|||
lean_object* lean_nat_to_int(lean_object*);
|
||||
static lean_object* l___private_Lean_Data_Lsp_TextSync_0__Lean_Lsp_toJsonTextDocumentSyncOptions____x40_Lean_Data_Lsp_TextSync___hyg_607____closed__2;
|
||||
static lean_object* l___private_Lean_Data_Lsp_TextSync_0__Lean_Lsp_toJsonTextDocumentSyncOptions____x40_Lean_Data_Lsp_TextSync___hyg_607____closed__1;
|
||||
lean_object* l___private_Lean_Data_Lsp_TextSync_0__Lean_Lsp_toJsonTextDocumentSyncOptions____x40_Lean_Data_Lsp_TextSync___hyg_607____boxed(lean_object*);
|
||||
lean_object* l_Lean_Lsp_TextDocumentContentChangeEvent_hasToJson_match__1(lean_object*);
|
||||
lean_object* l_Lean_Lsp_instToJsonTextDocumentSyncOptions;
|
||||
lean_object* l_Lean_Json_getObjValAs_x3f___at_Lean_JsonRpc_instFromJsonMessage___spec__2(lean_object*, lean_object*);
|
||||
|
|
@ -1563,36 +1561,36 @@ x_1 = lean_mk_string("includeText");
|
|||
return x_1;
|
||||
}
|
||||
}
|
||||
lean_object* l___private_Lean_Data_Lsp_TextSync_0__Lean_Lsp_toJsonSaveOptions____x40_Lean_Data_Lsp_TextSync___hyg_439_(lean_object* x_1) {
|
||||
lean_object* l___private_Lean_Data_Lsp_TextSync_0__Lean_Lsp_toJsonSaveOptions____x40_Lean_Data_Lsp_TextSync___hyg_439_(uint8_t x_1) {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_2; uint8_t x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6; lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10;
|
||||
lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6; lean_object* x_7; lean_object* x_8; lean_object* x_9;
|
||||
x_2 = lean_alloc_ctor(1, 0, 1);
|
||||
x_3 = lean_unbox(x_1);
|
||||
lean_ctor_set_uint8(x_2, 0, x_3);
|
||||
x_4 = l___private_Lean_Data_Lsp_TextSync_0__Lean_Lsp_toJsonSaveOptions____x40_Lean_Data_Lsp_TextSync___hyg_439____closed__1;
|
||||
x_5 = lean_alloc_ctor(0, 2, 0);
|
||||
lean_ctor_set(x_5, 0, x_4);
|
||||
lean_ctor_set(x_5, 1, x_2);
|
||||
x_6 = lean_box(0);
|
||||
lean_ctor_set_uint8(x_2, 0, x_1);
|
||||
x_3 = l___private_Lean_Data_Lsp_TextSync_0__Lean_Lsp_toJsonSaveOptions____x40_Lean_Data_Lsp_TextSync___hyg_439____closed__1;
|
||||
x_4 = lean_alloc_ctor(0, 2, 0);
|
||||
lean_ctor_set(x_4, 0, x_3);
|
||||
lean_ctor_set(x_4, 1, x_2);
|
||||
x_5 = lean_box(0);
|
||||
x_6 = lean_alloc_ctor(1, 2, 0);
|
||||
lean_ctor_set(x_6, 0, x_4);
|
||||
lean_ctor_set(x_6, 1, x_5);
|
||||
x_7 = lean_alloc_ctor(1, 2, 0);
|
||||
lean_ctor_set(x_7, 0, x_5);
|
||||
lean_ctor_set(x_7, 1, x_6);
|
||||
x_8 = lean_alloc_ctor(1, 2, 0);
|
||||
lean_ctor_set(x_8, 0, x_7);
|
||||
lean_ctor_set(x_8, 1, x_6);
|
||||
x_9 = l_List_join___rarg(x_8);
|
||||
x_10 = l_Lean_Json_mkObj(x_9);
|
||||
return x_10;
|
||||
lean_ctor_set(x_7, 0, x_6);
|
||||
lean_ctor_set(x_7, 1, x_5);
|
||||
x_8 = l_List_join___rarg(x_7);
|
||||
x_9 = l_Lean_Json_mkObj(x_8);
|
||||
return x_9;
|
||||
}
|
||||
}
|
||||
lean_object* l___private_Lean_Data_Lsp_TextSync_0__Lean_Lsp_toJsonSaveOptions____x40_Lean_Data_Lsp_TextSync___hyg_439____boxed(lean_object* x_1) {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_2;
|
||||
x_2 = l___private_Lean_Data_Lsp_TextSync_0__Lean_Lsp_toJsonSaveOptions____x40_Lean_Data_Lsp_TextSync___hyg_439_(x_1);
|
||||
uint8_t x_2; lean_object* x_3;
|
||||
x_2 = lean_unbox(x_1);
|
||||
lean_dec(x_1);
|
||||
return x_2;
|
||||
x_3 = l___private_Lean_Data_Lsp_TextSync_0__Lean_Lsp_toJsonSaveOptions____x40_Lean_Data_Lsp_TextSync___hyg_439_(x_2);
|
||||
return x_3;
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l_Lean_Lsp_instToJsonSaveOptions___closed__1() {
|
||||
|
|
@ -1830,17 +1828,21 @@ return x_3;
|
|||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_4; lean_object* x_5; lean_object* x_6; lean_object* x_7; lean_object* x_8;
|
||||
lean_object* x_4; uint8_t x_5; lean_object* x_6; lean_object* x_7; lean_object* x_8; lean_object* x_9;
|
||||
x_4 = lean_ctor_get(x_2, 0);
|
||||
x_5 = l___private_Lean_Data_Lsp_TextSync_0__Lean_Lsp_toJsonSaveOptions____x40_Lean_Data_Lsp_TextSync___hyg_439_(x_4);
|
||||
x_6 = lean_alloc_ctor(0, 2, 0);
|
||||
lean_ctor_set(x_6, 0, x_1);
|
||||
lean_ctor_set(x_6, 1, x_5);
|
||||
x_7 = lean_box(0);
|
||||
x_8 = lean_alloc_ctor(1, 2, 0);
|
||||
lean_ctor_set(x_8, 0, x_6);
|
||||
lean_ctor_set(x_8, 1, x_7);
|
||||
return x_8;
|
||||
lean_inc(x_4);
|
||||
lean_dec(x_2);
|
||||
x_5 = lean_unbox(x_4);
|
||||
lean_dec(x_4);
|
||||
x_6 = l___private_Lean_Data_Lsp_TextSync_0__Lean_Lsp_toJsonSaveOptions____x40_Lean_Data_Lsp_TextSync___hyg_439_(x_5);
|
||||
x_7 = lean_alloc_ctor(0, 2, 0);
|
||||
lean_ctor_set(x_7, 0, x_1);
|
||||
lean_ctor_set(x_7, 1, x_6);
|
||||
x_8 = lean_box(0);
|
||||
x_9 = lean_alloc_ctor(1, 2, 0);
|
||||
lean_ctor_set(x_9, 0, x_7);
|
||||
lean_ctor_set(x_9, 1, x_8);
|
||||
return x_9;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1965,6 +1967,8 @@ x_3 = lean_ctor_get_uint8(x_1, sizeof(void*)*1 + 1);
|
|||
x_4 = lean_ctor_get_uint8(x_1, sizeof(void*)*1 + 2);
|
||||
x_5 = lean_ctor_get_uint8(x_1, sizeof(void*)*1 + 3);
|
||||
x_6 = lean_ctor_get(x_1, 0);
|
||||
lean_inc(x_6);
|
||||
lean_dec(x_1);
|
||||
x_7 = lean_alloc_ctor(1, 0, 1);
|
||||
lean_ctor_set_uint8(x_7, 0, x_2);
|
||||
x_8 = l___private_Lean_Data_Lsp_TextSync_0__Lean_Lsp_toJsonTextDocumentSyncOptions____x40_Lean_Data_Lsp_TextSync___hyg_607____closed__1;
|
||||
|
|
@ -2050,29 +2054,11 @@ return x_39;
|
|||
}
|
||||
}
|
||||
}
|
||||
lean_object* l_Lean_Json_opt___at___private_Lean_Data_Lsp_TextSync_0__Lean_Lsp_toJsonTextDocumentSyncOptions____x40_Lean_Data_Lsp_TextSync___hyg_607____spec__1___boxed(lean_object* x_1, lean_object* x_2) {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_3;
|
||||
x_3 = l_Lean_Json_opt___at___private_Lean_Data_Lsp_TextSync_0__Lean_Lsp_toJsonTextDocumentSyncOptions____x40_Lean_Data_Lsp_TextSync___hyg_607____spec__1(x_1, x_2);
|
||||
lean_dec(x_2);
|
||||
return x_3;
|
||||
}
|
||||
}
|
||||
lean_object* l___private_Lean_Data_Lsp_TextSync_0__Lean_Lsp_toJsonTextDocumentSyncOptions____x40_Lean_Data_Lsp_TextSync___hyg_607____boxed(lean_object* x_1) {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_2;
|
||||
x_2 = l___private_Lean_Data_Lsp_TextSync_0__Lean_Lsp_toJsonTextDocumentSyncOptions____x40_Lean_Data_Lsp_TextSync___hyg_607_(x_1);
|
||||
lean_dec(x_1);
|
||||
return x_2;
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l_Lean_Lsp_instToJsonTextDocumentSyncOptions___closed__1() {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_1;
|
||||
x_1 = lean_alloc_closure((void*)(l___private_Lean_Data_Lsp_TextSync_0__Lean_Lsp_toJsonTextDocumentSyncOptions____x40_Lean_Data_Lsp_TextSync___hyg_607____boxed), 1, 0);
|
||||
x_1 = lean_alloc_closure((void*)(l___private_Lean_Data_Lsp_TextSync_0__Lean_Lsp_toJsonTextDocumentSyncOptions____x40_Lean_Data_Lsp_TextSync___hyg_607_), 1, 0);
|
||||
return x_1;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
3022
stage0/stdlib/Lean/Data/Parsec.c
generated
Normal file
3022
stage0/stdlib/Lean/Data/Parsec.c
generated
Normal file
File diff suppressed because it is too large
Load diff
37
stage0/stdlib/Lean/Data/Xml.c
generated
Normal file
37
stage0/stdlib/Lean/Data/Xml.c
generated
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
// Lean compiler output
|
||||
// Module: Lean.Data.Xml
|
||||
// Imports: Init Lean.Data.Xml.Basic Lean.Data.Xml.Parser
|
||||
#include <lean/lean.h>
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic ignored "-Wunused-parameter"
|
||||
#pragma clang diagnostic ignored "-Wunused-label"
|
||||
#elif defined(__GNUC__) && !defined(__CLANG__)
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
#pragma GCC diagnostic ignored "-Wunused-label"
|
||||
#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
|
||||
#endif
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
lean_object* initialize_Init(lean_object*);
|
||||
lean_object* initialize_Lean_Data_Xml_Basic(lean_object*);
|
||||
lean_object* initialize_Lean_Data_Xml_Parser(lean_object*);
|
||||
static bool _G_initialized = false;
|
||||
lean_object* initialize_Lean_Data_Xml(lean_object* w) {
|
||||
lean_object * res;
|
||||
if (_G_initialized) return lean_io_result_mk_ok(lean_box(0));
|
||||
_G_initialized = true;
|
||||
res = initialize_Init(lean_io_mk_world());
|
||||
if (lean_io_result_is_error(res)) return res;
|
||||
lean_dec_ref(res);
|
||||
res = initialize_Lean_Data_Xml_Basic(lean_io_mk_world());
|
||||
if (lean_io_result_is_error(res)) return res;
|
||||
lean_dec_ref(res);
|
||||
res = initialize_Lean_Data_Xml_Parser(lean_io_mk_world());
|
||||
if (lean_io_result_is_error(res)) return res;
|
||||
lean_dec_ref(res);
|
||||
return lean_io_result_mk_ok(lean_box(0));
|
||||
}
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
547
stage0/stdlib/Lean/Data/Xml/Basic.c
generated
Normal file
547
stage0/stdlib/Lean/Data/Xml/Basic.c
generated
Normal file
|
|
@ -0,0 +1,547 @@
|
|||
// Lean compiler output
|
||||
// Module: Lean.Data.Xml.Basic
|
||||
// Imports: Init Std.Data.RBMap
|
||||
#include <lean/lean.h>
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic ignored "-Wunused-parameter"
|
||||
#pragma clang diagnostic ignored "-Wunused-label"
|
||||
#elif defined(__GNUC__) && !defined(__CLANG__)
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
#pragma GCC diagnostic ignored "-Wunused-label"
|
||||
#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
|
||||
#endif
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
size_t l_USize_add(size_t, size_t);
|
||||
uint8_t l_USize_decEq(size_t, size_t);
|
||||
lean_object* lean_array_uget(lean_object*, size_t);
|
||||
lean_object* l_Lean_Xml_instToStringAttributes(lean_object*);
|
||||
lean_object* lean_array_uset(lean_object*, size_t, lean_object*);
|
||||
static lean_object* l___private_Lean_Data_Xml_Basic_0__Lean_Xml_eToString___closed__3;
|
||||
lean_object* l_Lean_Xml_instToStringContent;
|
||||
lean_object* lean_array_get_size(lean_object*);
|
||||
lean_object* lean_string_append(lean_object*, lean_object*);
|
||||
static lean_object* l_Std_RBNode_fold___at_Lean_Xml_instToStringAttributes___spec__1___closed__1;
|
||||
static lean_object* l_Lean_Xml_instInhabitedContent___closed__1;
|
||||
uint8_t l_USize_decLt(size_t, size_t);
|
||||
static lean_object* l_Std_RBNode_fold___at_Lean_Xml_instToStringAttributes___spec__1___closed__3;
|
||||
static lean_object* l_Lean_Xml_instToStringElement___closed__1;
|
||||
lean_object* l_Std_RBNode_fold___at_Lean_Xml_instToStringAttributes___spec__1(lean_object*, lean_object*);
|
||||
lean_object* l___private_Lean_Data_Xml_Basic_0__Lean_Xml_cToString(lean_object*);
|
||||
lean_object* l___private_Lean_Data_Xml_Basic_0__Lean_Xml_cToString_match__1(lean_object*);
|
||||
lean_object* l_Array_foldlMUnsafe_fold___at___private_Lean_Data_Xml_Basic_0__Lean_Xml_eToString___spec__2___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l___private_Lean_Data_Xml_Basic_0__Lean_Xml_cToString_match__1___rarg(lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
static lean_object* l___private_Lean_Data_Xml_Basic_0__Lean_Xml_eToString___closed__2;
|
||||
lean_object* l___private_Lean_Data_Xml_Basic_0__Lean_Xml_eToString(lean_object*);
|
||||
static lean_object* l___private_Lean_Data_Xml_Basic_0__Lean_Xml_eToString___closed__1;
|
||||
size_t lean_usize_of_nat(lean_object*);
|
||||
lean_object* l___private_Lean_Data_Xml_Basic_0__Lean_Xml_eToString_match__1___rarg(lean_object*, lean_object*);
|
||||
uint8_t lean_nat_dec_le(lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Xml_instInhabitedContent;
|
||||
static lean_object* l___private_Lean_Data_Xml_Basic_0__Lean_Xml_cToString___closed__1;
|
||||
static lean_object* l_Lean_Xml_instToStringAttributes___closed__1;
|
||||
lean_object* l_Lean_Xml_instToStringAttributes___boxed(lean_object*);
|
||||
lean_object* l_Array_foldlMUnsafe_fold___at___private_Lean_Data_Xml_Basic_0__Lean_Xml_eToString___spec__2(lean_object*, size_t, size_t, lean_object*);
|
||||
static lean_object* l___private_Lean_Data_Xml_Basic_0__Lean_Xml_cToString___closed__2;
|
||||
lean_object* l_Array_mapMUnsafe_map___at___private_Lean_Data_Xml_Basic_0__Lean_Xml_eToString___spec__1___boxed(lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Array_mapMUnsafe_map___at___private_Lean_Data_Xml_Basic_0__Lean_Xml_eToString___spec__1(size_t, size_t, lean_object*);
|
||||
static lean_object* l_Lean_Xml_instToStringContent___closed__1;
|
||||
lean_object* l___private_Lean_Data_Xml_Basic_0__Lean_Xml_eToString_match__1(lean_object*);
|
||||
lean_object* l_Lean_Xml_instToStringElement;
|
||||
lean_object* l_unsafeCast(lean_object*, lean_object*, lean_object*);
|
||||
static lean_object* l_Std_RBNode_fold___at_Lean_Xml_instToStringAttributes___spec__1___closed__2;
|
||||
lean_object* l_Std_RBNode_fold___at_Lean_Xml_instToStringAttributes___spec__1___boxed(lean_object*, lean_object*);
|
||||
uint8_t lean_nat_dec_lt(lean_object*, lean_object*);
|
||||
static lean_object* _init_l_Std_RBNode_fold___at_Lean_Xml_instToStringAttributes___spec__1___closed__1() {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_1;
|
||||
x_1 = lean_mk_string(" ");
|
||||
return x_1;
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l_Std_RBNode_fold___at_Lean_Xml_instToStringAttributes___spec__1___closed__2() {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_1;
|
||||
x_1 = lean_mk_string("=\"");
|
||||
return x_1;
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l_Std_RBNode_fold___at_Lean_Xml_instToStringAttributes___spec__1___closed__3() {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_1;
|
||||
x_1 = lean_mk_string("\"");
|
||||
return x_1;
|
||||
}
|
||||
}
|
||||
lean_object* l_Std_RBNode_fold___at_Lean_Xml_instToStringAttributes___spec__1(lean_object* x_1, lean_object* x_2) {
|
||||
_start:
|
||||
{
|
||||
if (lean_obj_tag(x_2) == 0)
|
||||
{
|
||||
return x_1;
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6; lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14; lean_object* x_15;
|
||||
x_3 = lean_ctor_get(x_2, 0);
|
||||
x_4 = lean_ctor_get(x_2, 1);
|
||||
x_5 = lean_ctor_get(x_2, 2);
|
||||
x_6 = lean_ctor_get(x_2, 3);
|
||||
x_7 = l_Std_RBNode_fold___at_Lean_Xml_instToStringAttributes___spec__1(x_1, x_3);
|
||||
x_8 = l_Std_RBNode_fold___at_Lean_Xml_instToStringAttributes___spec__1___closed__1;
|
||||
x_9 = lean_string_append(x_8, x_4);
|
||||
x_10 = l_Std_RBNode_fold___at_Lean_Xml_instToStringAttributes___spec__1___closed__2;
|
||||
x_11 = lean_string_append(x_9, x_10);
|
||||
x_12 = lean_string_append(x_11, x_5);
|
||||
x_13 = l_Std_RBNode_fold___at_Lean_Xml_instToStringAttributes___spec__1___closed__3;
|
||||
x_14 = lean_string_append(x_12, x_13);
|
||||
x_15 = lean_string_append(x_7, x_14);
|
||||
lean_dec(x_14);
|
||||
x_1 = x_15;
|
||||
x_2 = x_6;
|
||||
goto _start;
|
||||
}
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l_Lean_Xml_instToStringAttributes___closed__1() {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_1;
|
||||
x_1 = lean_mk_string("");
|
||||
return x_1;
|
||||
}
|
||||
}
|
||||
lean_object* l_Lean_Xml_instToStringAttributes(lean_object* x_1) {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_2; lean_object* x_3;
|
||||
x_2 = l_Lean_Xml_instToStringAttributes___closed__1;
|
||||
x_3 = l_Std_RBNode_fold___at_Lean_Xml_instToStringAttributes___spec__1(x_2, x_1);
|
||||
return x_3;
|
||||
}
|
||||
}
|
||||
lean_object* l_Std_RBNode_fold___at_Lean_Xml_instToStringAttributes___spec__1___boxed(lean_object* x_1, lean_object* x_2) {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_3;
|
||||
x_3 = l_Std_RBNode_fold___at_Lean_Xml_instToStringAttributes___spec__1(x_1, x_2);
|
||||
lean_dec(x_2);
|
||||
return x_3;
|
||||
}
|
||||
}
|
||||
lean_object* l_Lean_Xml_instToStringAttributes___boxed(lean_object* x_1) {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_2;
|
||||
x_2 = l_Lean_Xml_instToStringAttributes(x_1);
|
||||
lean_dec(x_1);
|
||||
return x_2;
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l_Lean_Xml_instInhabitedContent___closed__1() {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_1; lean_object* x_2;
|
||||
x_1 = l_Lean_Xml_instToStringAttributes___closed__1;
|
||||
x_2 = lean_alloc_ctor(1, 1, 0);
|
||||
lean_ctor_set(x_2, 0, x_1);
|
||||
return x_2;
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l_Lean_Xml_instInhabitedContent() {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_1;
|
||||
x_1 = l_Lean_Xml_instInhabitedContent___closed__1;
|
||||
return x_1;
|
||||
}
|
||||
}
|
||||
lean_object* l___private_Lean_Data_Xml_Basic_0__Lean_Xml_eToString_match__1___rarg(lean_object* x_1, lean_object* x_2) {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6;
|
||||
x_3 = lean_ctor_get(x_1, 0);
|
||||
lean_inc(x_3);
|
||||
x_4 = lean_ctor_get(x_1, 1);
|
||||
lean_inc(x_4);
|
||||
x_5 = lean_ctor_get(x_1, 2);
|
||||
lean_inc(x_5);
|
||||
lean_dec(x_1);
|
||||
x_6 = lean_apply_3(x_2, x_3, x_4, x_5);
|
||||
return x_6;
|
||||
}
|
||||
}
|
||||
lean_object* l___private_Lean_Data_Xml_Basic_0__Lean_Xml_eToString_match__1(lean_object* x_1) {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_2;
|
||||
x_2 = lean_alloc_closure((void*)(l___private_Lean_Data_Xml_Basic_0__Lean_Xml_eToString_match__1___rarg), 2, 0);
|
||||
return x_2;
|
||||
}
|
||||
}
|
||||
lean_object* l___private_Lean_Data_Xml_Basic_0__Lean_Xml_cToString_match__1___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) {
|
||||
_start:
|
||||
{
|
||||
switch (lean_obj_tag(x_1)) {
|
||||
case 0:
|
||||
{
|
||||
lean_object* x_5; lean_object* x_6;
|
||||
lean_dec(x_4);
|
||||
lean_dec(x_3);
|
||||
x_5 = lean_ctor_get(x_1, 0);
|
||||
lean_inc(x_5);
|
||||
lean_dec(x_1);
|
||||
x_6 = lean_apply_1(x_2, x_5);
|
||||
return x_6;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
lean_object* x_7; lean_object* x_8;
|
||||
lean_dec(x_4);
|
||||
lean_dec(x_2);
|
||||
x_7 = lean_ctor_get(x_1, 0);
|
||||
lean_inc(x_7);
|
||||
lean_dec(x_1);
|
||||
x_8 = lean_apply_1(x_3, x_7);
|
||||
return x_8;
|
||||
}
|
||||
default:
|
||||
{
|
||||
lean_object* x_9; lean_object* x_10;
|
||||
lean_dec(x_3);
|
||||
lean_dec(x_2);
|
||||
x_9 = lean_ctor_get(x_1, 0);
|
||||
lean_inc(x_9);
|
||||
lean_dec(x_1);
|
||||
x_10 = lean_apply_1(x_4, x_9);
|
||||
return x_10;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
lean_object* l___private_Lean_Data_Xml_Basic_0__Lean_Xml_cToString_match__1(lean_object* x_1) {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_2;
|
||||
x_2 = lean_alloc_closure((void*)(l___private_Lean_Data_Xml_Basic_0__Lean_Xml_cToString_match__1___rarg), 4, 0);
|
||||
return x_2;
|
||||
}
|
||||
}
|
||||
lean_object* l_Array_mapMUnsafe_map___at___private_Lean_Data_Xml_Basic_0__Lean_Xml_eToString___spec__1(size_t x_1, size_t x_2, lean_object* x_3) {
|
||||
_start:
|
||||
{
|
||||
uint8_t x_4;
|
||||
x_4 = x_2 < x_1;
|
||||
if (x_4 == 0)
|
||||
{
|
||||
lean_object* x_5;
|
||||
x_5 = x_3;
|
||||
return x_5;
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_6; lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; size_t x_11; size_t x_12; lean_object* x_13; lean_object* x_14;
|
||||
x_6 = lean_array_uget(x_3, x_2);
|
||||
x_7 = lean_unsigned_to_nat(0u);
|
||||
x_8 = lean_array_uset(x_3, x_2, x_7);
|
||||
x_9 = x_6;
|
||||
x_10 = l___private_Lean_Data_Xml_Basic_0__Lean_Xml_cToString(x_9);
|
||||
x_11 = 1;
|
||||
x_12 = x_2 + x_11;
|
||||
x_13 = x_10;
|
||||
x_14 = lean_array_uset(x_8, x_2, x_13);
|
||||
x_2 = x_12;
|
||||
x_3 = x_14;
|
||||
goto _start;
|
||||
}
|
||||
}
|
||||
}
|
||||
lean_object* l_Array_foldlMUnsafe_fold___at___private_Lean_Data_Xml_Basic_0__Lean_Xml_eToString___spec__2(lean_object* x_1, size_t x_2, size_t x_3, lean_object* x_4) {
|
||||
_start:
|
||||
{
|
||||
uint8_t x_5;
|
||||
x_5 = x_2 == x_3;
|
||||
if (x_5 == 0)
|
||||
{
|
||||
lean_object* x_6; lean_object* x_7; size_t x_8; size_t x_9;
|
||||
x_6 = lean_array_uget(x_1, x_2);
|
||||
x_7 = lean_string_append(x_4, x_6);
|
||||
lean_dec(x_6);
|
||||
x_8 = 1;
|
||||
x_9 = x_2 + x_8;
|
||||
x_2 = x_9;
|
||||
x_4 = x_7;
|
||||
goto _start;
|
||||
}
|
||||
else
|
||||
{
|
||||
return x_4;
|
||||
}
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l___private_Lean_Data_Xml_Basic_0__Lean_Xml_eToString___closed__1() {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_1;
|
||||
x_1 = lean_mk_string("<");
|
||||
return x_1;
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l___private_Lean_Data_Xml_Basic_0__Lean_Xml_eToString___closed__2() {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_1;
|
||||
x_1 = lean_mk_string(">");
|
||||
return x_1;
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l___private_Lean_Data_Xml_Basic_0__Lean_Xml_eToString___closed__3() {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_1;
|
||||
x_1 = lean_mk_string("</");
|
||||
return x_1;
|
||||
}
|
||||
}
|
||||
lean_object* l___private_Lean_Data_Xml_Basic_0__Lean_Xml_eToString(lean_object* x_1) {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6; lean_object* x_7; lean_object* x_8; lean_object* x_9; size_t x_10; size_t x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14; lean_object* x_15; lean_object* x_16; uint8_t x_17; lean_object* x_18; lean_object* x_19; lean_object* x_20; lean_object* x_21;
|
||||
x_2 = lean_ctor_get(x_1, 0);
|
||||
lean_inc(x_2);
|
||||
x_3 = lean_ctor_get(x_1, 1);
|
||||
lean_inc(x_3);
|
||||
x_4 = lean_ctor_get(x_1, 2);
|
||||
lean_inc(x_4);
|
||||
lean_dec(x_1);
|
||||
x_5 = l___private_Lean_Data_Xml_Basic_0__Lean_Xml_eToString___closed__1;
|
||||
x_6 = lean_string_append(x_5, x_2);
|
||||
x_7 = l_Lean_Xml_instToStringAttributes___closed__1;
|
||||
x_8 = lean_string_append(x_6, x_7);
|
||||
x_9 = lean_array_get_size(x_4);
|
||||
x_10 = lean_usize_of_nat(x_9);
|
||||
lean_dec(x_9);
|
||||
x_11 = 0;
|
||||
x_12 = x_4;
|
||||
x_13 = l_Array_mapMUnsafe_map___at___private_Lean_Data_Xml_Basic_0__Lean_Xml_eToString___spec__1(x_10, x_11, x_12);
|
||||
x_14 = x_13;
|
||||
x_15 = lean_array_get_size(x_14);
|
||||
x_16 = lean_unsigned_to_nat(0u);
|
||||
x_17 = lean_nat_dec_lt(x_16, x_15);
|
||||
x_18 = l_Std_RBNode_fold___at_Lean_Xml_instToStringAttributes___spec__1(x_7, x_3);
|
||||
lean_dec(x_3);
|
||||
x_19 = lean_string_append(x_8, x_18);
|
||||
lean_dec(x_18);
|
||||
x_20 = l___private_Lean_Data_Xml_Basic_0__Lean_Xml_eToString___closed__2;
|
||||
x_21 = lean_string_append(x_19, x_20);
|
||||
if (x_17 == 0)
|
||||
{
|
||||
lean_object* x_22; lean_object* x_23; lean_object* x_24; lean_object* x_25; lean_object* x_26;
|
||||
lean_dec(x_15);
|
||||
lean_dec(x_14);
|
||||
x_22 = lean_string_append(x_21, x_7);
|
||||
x_23 = l___private_Lean_Data_Xml_Basic_0__Lean_Xml_eToString___closed__3;
|
||||
x_24 = lean_string_append(x_22, x_23);
|
||||
x_25 = lean_string_append(x_24, x_2);
|
||||
lean_dec(x_2);
|
||||
x_26 = lean_string_append(x_25, x_20);
|
||||
return x_26;
|
||||
}
|
||||
else
|
||||
{
|
||||
uint8_t x_27;
|
||||
x_27 = lean_nat_dec_le(x_15, x_15);
|
||||
if (x_27 == 0)
|
||||
{
|
||||
lean_object* x_28; lean_object* x_29; lean_object* x_30; lean_object* x_31; lean_object* x_32;
|
||||
lean_dec(x_15);
|
||||
lean_dec(x_14);
|
||||
x_28 = lean_string_append(x_21, x_7);
|
||||
x_29 = l___private_Lean_Data_Xml_Basic_0__Lean_Xml_eToString___closed__3;
|
||||
x_30 = lean_string_append(x_28, x_29);
|
||||
x_31 = lean_string_append(x_30, x_2);
|
||||
lean_dec(x_2);
|
||||
x_32 = lean_string_append(x_31, x_20);
|
||||
return x_32;
|
||||
}
|
||||
else
|
||||
{
|
||||
size_t x_33; lean_object* x_34; lean_object* x_35; lean_object* x_36; lean_object* x_37; lean_object* x_38; lean_object* x_39;
|
||||
x_33 = lean_usize_of_nat(x_15);
|
||||
lean_dec(x_15);
|
||||
x_34 = l_Array_foldlMUnsafe_fold___at___private_Lean_Data_Xml_Basic_0__Lean_Xml_eToString___spec__2(x_14, x_11, x_33, x_7);
|
||||
lean_dec(x_14);
|
||||
x_35 = lean_string_append(x_21, x_34);
|
||||
lean_dec(x_34);
|
||||
x_36 = l___private_Lean_Data_Xml_Basic_0__Lean_Xml_eToString___closed__3;
|
||||
x_37 = lean_string_append(x_35, x_36);
|
||||
x_38 = lean_string_append(x_37, x_2);
|
||||
lean_dec(x_2);
|
||||
x_39 = lean_string_append(x_38, x_20);
|
||||
return x_39;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l___private_Lean_Data_Xml_Basic_0__Lean_Xml_cToString___closed__1() {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_1;
|
||||
x_1 = lean_mk_string("<!--");
|
||||
return x_1;
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l___private_Lean_Data_Xml_Basic_0__Lean_Xml_cToString___closed__2() {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_1;
|
||||
x_1 = lean_mk_string("-->");
|
||||
return x_1;
|
||||
}
|
||||
}
|
||||
lean_object* l___private_Lean_Data_Xml_Basic_0__Lean_Xml_cToString(lean_object* x_1) {
|
||||
_start:
|
||||
{
|
||||
switch (lean_obj_tag(x_1)) {
|
||||
case 0:
|
||||
{
|
||||
lean_object* x_2; lean_object* x_3;
|
||||
x_2 = lean_ctor_get(x_1, 0);
|
||||
lean_inc(x_2);
|
||||
lean_dec(x_1);
|
||||
x_3 = l___private_Lean_Data_Xml_Basic_0__Lean_Xml_eToString(x_2);
|
||||
return x_3;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
lean_object* x_4; lean_object* x_5; lean_object* x_6; lean_object* x_7; lean_object* x_8;
|
||||
x_4 = lean_ctor_get(x_1, 0);
|
||||
lean_inc(x_4);
|
||||
lean_dec(x_1);
|
||||
x_5 = l___private_Lean_Data_Xml_Basic_0__Lean_Xml_cToString___closed__1;
|
||||
x_6 = lean_string_append(x_5, x_4);
|
||||
lean_dec(x_4);
|
||||
x_7 = l___private_Lean_Data_Xml_Basic_0__Lean_Xml_cToString___closed__2;
|
||||
x_8 = lean_string_append(x_6, x_7);
|
||||
return x_8;
|
||||
}
|
||||
default:
|
||||
{
|
||||
lean_object* x_9;
|
||||
x_9 = lean_ctor_get(x_1, 0);
|
||||
lean_inc(x_9);
|
||||
lean_dec(x_1);
|
||||
return x_9;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
lean_object* l_Array_mapMUnsafe_map___at___private_Lean_Data_Xml_Basic_0__Lean_Xml_eToString___spec__1___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) {
|
||||
_start:
|
||||
{
|
||||
size_t x_4; size_t x_5; lean_object* x_6;
|
||||
x_4 = lean_unbox_usize(x_1);
|
||||
lean_dec(x_1);
|
||||
x_5 = lean_unbox_usize(x_2);
|
||||
lean_dec(x_2);
|
||||
x_6 = l_Array_mapMUnsafe_map___at___private_Lean_Data_Xml_Basic_0__Lean_Xml_eToString___spec__1(x_4, x_5, x_3);
|
||||
return x_6;
|
||||
}
|
||||
}
|
||||
lean_object* l_Array_foldlMUnsafe_fold___at___private_Lean_Data_Xml_Basic_0__Lean_Xml_eToString___spec__2___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4) {
|
||||
_start:
|
||||
{
|
||||
size_t x_5; size_t x_6; lean_object* x_7;
|
||||
x_5 = lean_unbox_usize(x_2);
|
||||
lean_dec(x_2);
|
||||
x_6 = lean_unbox_usize(x_3);
|
||||
lean_dec(x_3);
|
||||
x_7 = l_Array_foldlMUnsafe_fold___at___private_Lean_Data_Xml_Basic_0__Lean_Xml_eToString___spec__2(x_1, x_5, x_6, x_4);
|
||||
lean_dec(x_1);
|
||||
return x_7;
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l_Lean_Xml_instToStringElement___closed__1() {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_1;
|
||||
x_1 = lean_alloc_closure((void*)(l___private_Lean_Data_Xml_Basic_0__Lean_Xml_eToString), 1, 0);
|
||||
return x_1;
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l_Lean_Xml_instToStringElement() {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_1;
|
||||
x_1 = l_Lean_Xml_instToStringElement___closed__1;
|
||||
return x_1;
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l_Lean_Xml_instToStringContent___closed__1() {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_1;
|
||||
x_1 = lean_alloc_closure((void*)(l___private_Lean_Data_Xml_Basic_0__Lean_Xml_cToString), 1, 0);
|
||||
return x_1;
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l_Lean_Xml_instToStringContent() {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_1;
|
||||
x_1 = l_Lean_Xml_instToStringContent___closed__1;
|
||||
return x_1;
|
||||
}
|
||||
}
|
||||
lean_object* initialize_Init(lean_object*);
|
||||
lean_object* initialize_Std_Data_RBMap(lean_object*);
|
||||
static bool _G_initialized = false;
|
||||
lean_object* initialize_Lean_Data_Xml_Basic(lean_object* w) {
|
||||
lean_object * res;
|
||||
if (_G_initialized) return lean_io_result_mk_ok(lean_box(0));
|
||||
_G_initialized = true;
|
||||
res = initialize_Init(lean_io_mk_world());
|
||||
if (lean_io_result_is_error(res)) return res;
|
||||
lean_dec_ref(res);
|
||||
res = initialize_Std_Data_RBMap(lean_io_mk_world());
|
||||
if (lean_io_result_is_error(res)) return res;
|
||||
lean_dec_ref(res);
|
||||
l_Std_RBNode_fold___at_Lean_Xml_instToStringAttributes___spec__1___closed__1 = _init_l_Std_RBNode_fold___at_Lean_Xml_instToStringAttributes___spec__1___closed__1();
|
||||
lean_mark_persistent(l_Std_RBNode_fold___at_Lean_Xml_instToStringAttributes___spec__1___closed__1);
|
||||
l_Std_RBNode_fold___at_Lean_Xml_instToStringAttributes___spec__1___closed__2 = _init_l_Std_RBNode_fold___at_Lean_Xml_instToStringAttributes___spec__1___closed__2();
|
||||
lean_mark_persistent(l_Std_RBNode_fold___at_Lean_Xml_instToStringAttributes___spec__1___closed__2);
|
||||
l_Std_RBNode_fold___at_Lean_Xml_instToStringAttributes___spec__1___closed__3 = _init_l_Std_RBNode_fold___at_Lean_Xml_instToStringAttributes___spec__1___closed__3();
|
||||
lean_mark_persistent(l_Std_RBNode_fold___at_Lean_Xml_instToStringAttributes___spec__1___closed__3);
|
||||
l_Lean_Xml_instToStringAttributes___closed__1 = _init_l_Lean_Xml_instToStringAttributes___closed__1();
|
||||
lean_mark_persistent(l_Lean_Xml_instToStringAttributes___closed__1);
|
||||
l_Lean_Xml_instInhabitedContent___closed__1 = _init_l_Lean_Xml_instInhabitedContent___closed__1();
|
||||
lean_mark_persistent(l_Lean_Xml_instInhabitedContent___closed__1);
|
||||
l_Lean_Xml_instInhabitedContent = _init_l_Lean_Xml_instInhabitedContent();
|
||||
lean_mark_persistent(l_Lean_Xml_instInhabitedContent);
|
||||
l___private_Lean_Data_Xml_Basic_0__Lean_Xml_eToString___closed__1 = _init_l___private_Lean_Data_Xml_Basic_0__Lean_Xml_eToString___closed__1();
|
||||
lean_mark_persistent(l___private_Lean_Data_Xml_Basic_0__Lean_Xml_eToString___closed__1);
|
||||
l___private_Lean_Data_Xml_Basic_0__Lean_Xml_eToString___closed__2 = _init_l___private_Lean_Data_Xml_Basic_0__Lean_Xml_eToString___closed__2();
|
||||
lean_mark_persistent(l___private_Lean_Data_Xml_Basic_0__Lean_Xml_eToString___closed__2);
|
||||
l___private_Lean_Data_Xml_Basic_0__Lean_Xml_eToString___closed__3 = _init_l___private_Lean_Data_Xml_Basic_0__Lean_Xml_eToString___closed__3();
|
||||
lean_mark_persistent(l___private_Lean_Data_Xml_Basic_0__Lean_Xml_eToString___closed__3);
|
||||
l___private_Lean_Data_Xml_Basic_0__Lean_Xml_cToString___closed__1 = _init_l___private_Lean_Data_Xml_Basic_0__Lean_Xml_cToString___closed__1();
|
||||
lean_mark_persistent(l___private_Lean_Data_Xml_Basic_0__Lean_Xml_cToString___closed__1);
|
||||
l___private_Lean_Data_Xml_Basic_0__Lean_Xml_cToString___closed__2 = _init_l___private_Lean_Data_Xml_Basic_0__Lean_Xml_cToString___closed__2();
|
||||
lean_mark_persistent(l___private_Lean_Data_Xml_Basic_0__Lean_Xml_cToString___closed__2);
|
||||
l_Lean_Xml_instToStringElement___closed__1 = _init_l_Lean_Xml_instToStringElement___closed__1();
|
||||
lean_mark_persistent(l_Lean_Xml_instToStringElement___closed__1);
|
||||
l_Lean_Xml_instToStringElement = _init_l_Lean_Xml_instToStringElement();
|
||||
lean_mark_persistent(l_Lean_Xml_instToStringElement);
|
||||
l_Lean_Xml_instToStringContent___closed__1 = _init_l_Lean_Xml_instToStringContent___closed__1();
|
||||
lean_mark_persistent(l_Lean_Xml_instToStringContent___closed__1);
|
||||
l_Lean_Xml_instToStringContent = _init_l_Lean_Xml_instToStringContent();
|
||||
lean_mark_persistent(l_Lean_Xml_instToStringContent);
|
||||
return lean_io_result_mk_ok(lean_box(0));
|
||||
}
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
30131
stage0/stdlib/Lean/Data/Xml/Parser.c
generated
Normal file
30131
stage0/stdlib/Lean/Data/Xml/Parser.c
generated
Normal file
File diff suppressed because it is too large
Load diff
2551
stage0/stdlib/Lean/Elab/App.c
generated
2551
stage0/stdlib/Lean/Elab/App.c
generated
File diff suppressed because it is too large
Load diff
4
stage0/stdlib/Lean/Elab/AutoBound.c
generated
4
stage0/stdlib/Lean/Elab/AutoBound.c
generated
|
|
@ -22,7 +22,6 @@ lean_object* l_Lean_Elab_autoBoundImplicitLocal;
|
|||
uint8_t l_Char_isDigit(uint32_t);
|
||||
lean_object* lean_string_utf8_byte_size(lean_object*);
|
||||
lean_object* l_Lean_Elab_isValidAutoBoundImplicitName_match__1___rarg(lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l___private_Init_Data_String_Basic_0__Substring_nextn(lean_object*, lean_object*, lean_object*);
|
||||
lean_object* lean_nat_add(lean_object*, lean_object*);
|
||||
static lean_object* l_Lean_Elab_initFn____x40_Lean_Elab_AutoBound___hyg_4____closed__3;
|
||||
lean_object* l_Lean_Option_register___at_Lean_Elab_initFn____x40_Lean_Elab_AutoBound___hyg_4____spec__1___boxed(lean_object*, lean_object*, lean_object*);
|
||||
|
|
@ -32,6 +31,7 @@ static lean_object* l_Lean_Elab_initFn____x40_Lean_Elab_AutoBound___hyg_4____clo
|
|||
static lean_object* l_Lean_Elab_autoBoundImplicitLocal___closed__1;
|
||||
uint32_t lean_string_utf8_get(lean_object*, lean_object*);
|
||||
static lean_object* l_Lean_Elab_initFn____x40_Lean_Elab_AutoBound___hyg_4____closed__2;
|
||||
lean_object* l_Substring_nextn(lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l___private_Lean_Elab_AutoBound_0__Lean_Elab_isValidAutoBoundSuffix___lambda__1___boxed(lean_object*);
|
||||
lean_object* l_Lean_Elab_isValidAutoBoundImplicitName_match__1(lean_object*);
|
||||
static lean_object* l_Lean_Elab_initFn____x40_Lean_Elab_AutoBound___hyg_4____closed__4;
|
||||
|
|
@ -279,7 +279,7 @@ lean_ctor_set(x_4, 0, x_1);
|
|||
lean_ctor_set(x_4, 1, x_3);
|
||||
lean_ctor_set(x_4, 2, x_2);
|
||||
x_5 = lean_unsigned_to_nat(1u);
|
||||
x_6 = l___private_Init_Data_String_Basic_0__Substring_nextn(x_4, x_5, x_3);
|
||||
x_6 = l_Substring_nextn(x_4, x_5, x_3);
|
||||
lean_dec(x_4);
|
||||
x_7 = lean_nat_add(x_3, x_6);
|
||||
lean_dec(x_6);
|
||||
|
|
|
|||
1000
stage0/stdlib/Lean/Elab/Binders.c
generated
1000
stage0/stdlib/Lean/Elab/Binders.c
generated
File diff suppressed because it is too large
Load diff
94
stage0/stdlib/Lean/Elab/BuiltinTerm.c
generated
94
stage0/stdlib/Lean/Elab/BuiltinTerm.c
generated
|
|
@ -4935,7 +4935,7 @@ lean_inc(x_12);
|
|||
x_25 = l_Lean_mkConstWithLevelParams___at_Lean_Elab_Term_elabDoubleQuotedName___spec__5(x_12, x_4, x_5, x_6, x_7, x_8, x_9, x_24);
|
||||
if (lean_obj_tag(x_25) == 0)
|
||||
{
|
||||
lean_object* x_26; lean_object* x_27; lean_object* x_28; lean_object* x_29; lean_object* x_30; lean_object* x_31; lean_object* x_32; lean_object* x_33; uint8_t x_34;
|
||||
lean_object* x_26; lean_object* x_27; lean_object* x_28; lean_object* x_29; lean_object* x_30; uint8_t x_31; lean_object* x_32; lean_object* x_33; lean_object* x_34; uint8_t x_35;
|
||||
x_26 = lean_ctor_get(x_25, 0);
|
||||
lean_inc(x_26);
|
||||
x_27 = lean_ctor_get(x_25, 1);
|
||||
|
|
@ -4946,90 +4946,92 @@ x_29 = lean_alloc_ctor(0, 2, 0);
|
|||
lean_ctor_set(x_29, 0, x_28);
|
||||
lean_ctor_set(x_29, 1, x_1);
|
||||
x_30 = l_Lean_LocalContext_empty;
|
||||
x_31 = lean_alloc_ctor(0, 4, 0);
|
||||
lean_ctor_set(x_31, 0, x_29);
|
||||
lean_ctor_set(x_31, 1, x_30);
|
||||
lean_ctor_set(x_31, 2, x_3);
|
||||
lean_ctor_set(x_31, 3, x_26);
|
||||
x_32 = lean_alloc_ctor(1, 1, 0);
|
||||
lean_ctor_set(x_32, 0, x_31);
|
||||
x_33 = l_Lean_Elab_pushInfoLeaf___at_Lean_Elab_Term_addDotCompletionInfo___spec__2(x_32, x_4, x_5, x_6, x_7, x_8, x_9, x_27);
|
||||
x_31 = 0;
|
||||
x_32 = lean_alloc_ctor(0, 4, 1);
|
||||
lean_ctor_set(x_32, 0, x_29);
|
||||
lean_ctor_set(x_32, 1, x_30);
|
||||
lean_ctor_set(x_32, 2, x_3);
|
||||
lean_ctor_set(x_32, 3, x_26);
|
||||
lean_ctor_set_uint8(x_32, sizeof(void*)*4, x_31);
|
||||
x_33 = lean_alloc_ctor(1, 1, 0);
|
||||
lean_ctor_set(x_33, 0, x_32);
|
||||
x_34 = l_Lean_Elab_pushInfoLeaf___at_Lean_Elab_Term_addDotCompletionInfo___spec__2(x_33, x_4, x_5, x_6, x_7, x_8, x_9, x_27);
|
||||
lean_dec(x_8);
|
||||
lean_dec(x_4);
|
||||
x_34 = !lean_is_exclusive(x_33);
|
||||
if (x_34 == 0)
|
||||
x_35 = !lean_is_exclusive(x_34);
|
||||
if (x_35 == 0)
|
||||
{
|
||||
lean_object* x_35;
|
||||
x_35 = lean_ctor_get(x_33, 0);
|
||||
lean_dec(x_35);
|
||||
lean_ctor_set(x_33, 0, x_12);
|
||||
return x_33;
|
||||
lean_object* x_36;
|
||||
x_36 = lean_ctor_get(x_34, 0);
|
||||
lean_dec(x_36);
|
||||
lean_ctor_set(x_34, 0, x_12);
|
||||
return x_34;
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_36; lean_object* x_37;
|
||||
x_36 = lean_ctor_get(x_33, 1);
|
||||
lean_inc(x_36);
|
||||
lean_dec(x_33);
|
||||
x_37 = lean_alloc_ctor(0, 2, 0);
|
||||
lean_ctor_set(x_37, 0, x_12);
|
||||
lean_ctor_set(x_37, 1, x_36);
|
||||
return x_37;
|
||||
lean_object* x_37; lean_object* x_38;
|
||||
x_37 = lean_ctor_get(x_34, 1);
|
||||
lean_inc(x_37);
|
||||
lean_dec(x_34);
|
||||
x_38 = lean_alloc_ctor(0, 2, 0);
|
||||
lean_ctor_set(x_38, 0, x_12);
|
||||
lean_ctor_set(x_38, 1, x_37);
|
||||
return x_38;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
uint8_t x_38;
|
||||
uint8_t x_39;
|
||||
lean_dec(x_12);
|
||||
lean_dec(x_8);
|
||||
lean_dec(x_4);
|
||||
lean_dec(x_3);
|
||||
lean_dec(x_1);
|
||||
x_38 = !lean_is_exclusive(x_25);
|
||||
if (x_38 == 0)
|
||||
x_39 = !lean_is_exclusive(x_25);
|
||||
if (x_39 == 0)
|
||||
{
|
||||
return x_25;
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_39; lean_object* x_40; lean_object* x_41;
|
||||
x_39 = lean_ctor_get(x_25, 0);
|
||||
x_40 = lean_ctor_get(x_25, 1);
|
||||
lean_object* x_40; lean_object* x_41; lean_object* x_42;
|
||||
x_40 = lean_ctor_get(x_25, 0);
|
||||
x_41 = lean_ctor_get(x_25, 1);
|
||||
lean_inc(x_41);
|
||||
lean_inc(x_40);
|
||||
lean_inc(x_39);
|
||||
lean_dec(x_25);
|
||||
x_41 = lean_alloc_ctor(1, 2, 0);
|
||||
lean_ctor_set(x_41, 0, x_39);
|
||||
lean_ctor_set(x_41, 1, x_40);
|
||||
return x_41;
|
||||
x_42 = lean_alloc_ctor(1, 2, 0);
|
||||
lean_ctor_set(x_42, 0, x_40);
|
||||
lean_ctor_set(x_42, 1, x_41);
|
||||
return x_42;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
uint8_t x_42;
|
||||
uint8_t x_43;
|
||||
lean_dec(x_8);
|
||||
lean_dec(x_4);
|
||||
lean_dec(x_3);
|
||||
lean_dec(x_1);
|
||||
x_42 = !lean_is_exclusive(x_11);
|
||||
if (x_42 == 0)
|
||||
x_43 = !lean_is_exclusive(x_11);
|
||||
if (x_43 == 0)
|
||||
{
|
||||
return x_11;
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_43; lean_object* x_44; lean_object* x_45;
|
||||
x_43 = lean_ctor_get(x_11, 0);
|
||||
x_44 = lean_ctor_get(x_11, 1);
|
||||
lean_object* x_44; lean_object* x_45; lean_object* x_46;
|
||||
x_44 = lean_ctor_get(x_11, 0);
|
||||
x_45 = lean_ctor_get(x_11, 1);
|
||||
lean_inc(x_45);
|
||||
lean_inc(x_44);
|
||||
lean_inc(x_43);
|
||||
lean_dec(x_11);
|
||||
x_45 = lean_alloc_ctor(1, 2, 0);
|
||||
lean_ctor_set(x_45, 0, x_43);
|
||||
lean_ctor_set(x_45, 1, x_44);
|
||||
return x_45;
|
||||
x_46 = lean_alloc_ctor(1, 2, 0);
|
||||
lean_ctor_set(x_46, 0, x_44);
|
||||
lean_ctor_set(x_46, 1, x_45);
|
||||
return x_46;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
94
stage0/stdlib/Lean/Elab/Declaration.c
generated
94
stage0/stdlib/Lean/Elab/Declaration.c
generated
|
|
@ -7847,7 +7847,7 @@ lean_inc(x_12);
|
|||
x_25 = l_Lean_mkConstWithLevelParams___at_Lean_Elab_Command_elabAttr___spec__6(x_12, x_4, x_5, x_6, x_7, x_8, x_9, x_24);
|
||||
if (lean_obj_tag(x_25) == 0)
|
||||
{
|
||||
lean_object* x_26; lean_object* x_27; lean_object* x_28; lean_object* x_29; lean_object* x_30; lean_object* x_31; lean_object* x_32; lean_object* x_33; uint8_t x_34;
|
||||
lean_object* x_26; lean_object* x_27; lean_object* x_28; lean_object* x_29; lean_object* x_30; uint8_t x_31; lean_object* x_32; lean_object* x_33; lean_object* x_34; uint8_t x_35;
|
||||
x_26 = lean_ctor_get(x_25, 0);
|
||||
lean_inc(x_26);
|
||||
x_27 = lean_ctor_get(x_25, 1);
|
||||
|
|
@ -7858,90 +7858,92 @@ x_29 = lean_alloc_ctor(0, 2, 0);
|
|||
lean_ctor_set(x_29, 0, x_28);
|
||||
lean_ctor_set(x_29, 1, x_1);
|
||||
x_30 = l_Lean_LocalContext_empty;
|
||||
x_31 = lean_alloc_ctor(0, 4, 0);
|
||||
lean_ctor_set(x_31, 0, x_29);
|
||||
lean_ctor_set(x_31, 1, x_30);
|
||||
lean_ctor_set(x_31, 2, x_3);
|
||||
lean_ctor_set(x_31, 3, x_26);
|
||||
x_32 = lean_alloc_ctor(1, 1, 0);
|
||||
lean_ctor_set(x_32, 0, x_31);
|
||||
x_33 = l_Lean_Elab_pushInfoLeaf___at_Lean_Elab_Term_addDotCompletionInfo___spec__2(x_32, x_4, x_5, x_6, x_7, x_8, x_9, x_27);
|
||||
x_31 = 0;
|
||||
x_32 = lean_alloc_ctor(0, 4, 1);
|
||||
lean_ctor_set(x_32, 0, x_29);
|
||||
lean_ctor_set(x_32, 1, x_30);
|
||||
lean_ctor_set(x_32, 2, x_3);
|
||||
lean_ctor_set(x_32, 3, x_26);
|
||||
lean_ctor_set_uint8(x_32, sizeof(void*)*4, x_31);
|
||||
x_33 = lean_alloc_ctor(1, 1, 0);
|
||||
lean_ctor_set(x_33, 0, x_32);
|
||||
x_34 = l_Lean_Elab_pushInfoLeaf___at_Lean_Elab_Term_addDotCompletionInfo___spec__2(x_33, x_4, x_5, x_6, x_7, x_8, x_9, x_27);
|
||||
lean_dec(x_8);
|
||||
lean_dec(x_4);
|
||||
x_34 = !lean_is_exclusive(x_33);
|
||||
if (x_34 == 0)
|
||||
x_35 = !lean_is_exclusive(x_34);
|
||||
if (x_35 == 0)
|
||||
{
|
||||
lean_object* x_35;
|
||||
x_35 = lean_ctor_get(x_33, 0);
|
||||
lean_dec(x_35);
|
||||
lean_ctor_set(x_33, 0, x_12);
|
||||
return x_33;
|
||||
lean_object* x_36;
|
||||
x_36 = lean_ctor_get(x_34, 0);
|
||||
lean_dec(x_36);
|
||||
lean_ctor_set(x_34, 0, x_12);
|
||||
return x_34;
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_36; lean_object* x_37;
|
||||
x_36 = lean_ctor_get(x_33, 1);
|
||||
lean_inc(x_36);
|
||||
lean_dec(x_33);
|
||||
x_37 = lean_alloc_ctor(0, 2, 0);
|
||||
lean_ctor_set(x_37, 0, x_12);
|
||||
lean_ctor_set(x_37, 1, x_36);
|
||||
return x_37;
|
||||
lean_object* x_37; lean_object* x_38;
|
||||
x_37 = lean_ctor_get(x_34, 1);
|
||||
lean_inc(x_37);
|
||||
lean_dec(x_34);
|
||||
x_38 = lean_alloc_ctor(0, 2, 0);
|
||||
lean_ctor_set(x_38, 0, x_12);
|
||||
lean_ctor_set(x_38, 1, x_37);
|
||||
return x_38;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
uint8_t x_38;
|
||||
uint8_t x_39;
|
||||
lean_dec(x_12);
|
||||
lean_dec(x_8);
|
||||
lean_dec(x_4);
|
||||
lean_dec(x_3);
|
||||
lean_dec(x_1);
|
||||
x_38 = !lean_is_exclusive(x_25);
|
||||
if (x_38 == 0)
|
||||
x_39 = !lean_is_exclusive(x_25);
|
||||
if (x_39 == 0)
|
||||
{
|
||||
return x_25;
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_39; lean_object* x_40; lean_object* x_41;
|
||||
x_39 = lean_ctor_get(x_25, 0);
|
||||
x_40 = lean_ctor_get(x_25, 1);
|
||||
lean_object* x_40; lean_object* x_41; lean_object* x_42;
|
||||
x_40 = lean_ctor_get(x_25, 0);
|
||||
x_41 = lean_ctor_get(x_25, 1);
|
||||
lean_inc(x_41);
|
||||
lean_inc(x_40);
|
||||
lean_inc(x_39);
|
||||
lean_dec(x_25);
|
||||
x_41 = lean_alloc_ctor(1, 2, 0);
|
||||
lean_ctor_set(x_41, 0, x_39);
|
||||
lean_ctor_set(x_41, 1, x_40);
|
||||
return x_41;
|
||||
x_42 = lean_alloc_ctor(1, 2, 0);
|
||||
lean_ctor_set(x_42, 0, x_40);
|
||||
lean_ctor_set(x_42, 1, x_41);
|
||||
return x_42;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
uint8_t x_42;
|
||||
uint8_t x_43;
|
||||
lean_dec(x_8);
|
||||
lean_dec(x_4);
|
||||
lean_dec(x_3);
|
||||
lean_dec(x_1);
|
||||
x_42 = !lean_is_exclusive(x_11);
|
||||
if (x_42 == 0)
|
||||
x_43 = !lean_is_exclusive(x_11);
|
||||
if (x_43 == 0)
|
||||
{
|
||||
return x_11;
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_43; lean_object* x_44; lean_object* x_45;
|
||||
x_43 = lean_ctor_get(x_11, 0);
|
||||
x_44 = lean_ctor_get(x_11, 1);
|
||||
lean_object* x_44; lean_object* x_45; lean_object* x_46;
|
||||
x_44 = lean_ctor_get(x_11, 0);
|
||||
x_45 = lean_ctor_get(x_11, 1);
|
||||
lean_inc(x_45);
|
||||
lean_inc(x_44);
|
||||
lean_inc(x_43);
|
||||
lean_dec(x_11);
|
||||
x_45 = lean_alloc_ctor(1, 2, 0);
|
||||
lean_ctor_set(x_45, 0, x_43);
|
||||
lean_ctor_set(x_45, 1, x_44);
|
||||
return x_45;
|
||||
x_46 = lean_alloc_ctor(1, 2, 0);
|
||||
lean_ctor_set(x_46, 0, x_44);
|
||||
lean_ctor_set(x_46, 1, x_45);
|
||||
return x_46;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
94
stage0/stdlib/Lean/Elab/Deriving/Basic.c
generated
94
stage0/stdlib/Lean/Elab/Deriving/Basic.c
generated
|
|
@ -1749,7 +1749,7 @@ lean_inc(x_8);
|
|||
x_19 = l_Lean_mkConstWithLevelParams___at_Lean_Elab_elabDeriving___spec__8(x_8, x_4, x_5, x_18);
|
||||
if (lean_obj_tag(x_19) == 0)
|
||||
{
|
||||
lean_object* x_20; lean_object* x_21; lean_object* x_22; lean_object* x_23; lean_object* x_24; lean_object* x_25; lean_object* x_26; lean_object* x_27; uint8_t x_28;
|
||||
lean_object* x_20; lean_object* x_21; lean_object* x_22; lean_object* x_23; lean_object* x_24; uint8_t x_25; lean_object* x_26; lean_object* x_27; lean_object* x_28; uint8_t x_29;
|
||||
x_20 = lean_ctor_get(x_19, 0);
|
||||
lean_inc(x_20);
|
||||
x_21 = lean_ctor_get(x_19, 1);
|
||||
|
|
@ -1760,87 +1760,89 @@ x_23 = lean_alloc_ctor(0, 2, 0);
|
|||
lean_ctor_set(x_23, 0, x_22);
|
||||
lean_ctor_set(x_23, 1, x_1);
|
||||
x_24 = l_Lean_LocalContext_empty;
|
||||
x_25 = lean_alloc_ctor(0, 4, 0);
|
||||
lean_ctor_set(x_25, 0, x_23);
|
||||
lean_ctor_set(x_25, 1, x_24);
|
||||
lean_ctor_set(x_25, 2, x_3);
|
||||
lean_ctor_set(x_25, 3, x_20);
|
||||
x_26 = lean_alloc_ctor(1, 1, 0);
|
||||
lean_ctor_set(x_26, 0, x_25);
|
||||
x_27 = l_Lean_Elab_pushInfoLeaf___at_Lean_Elab_elabDeriving___spec__11(x_26, x_4, x_5, x_21);
|
||||
x_25 = 0;
|
||||
x_26 = lean_alloc_ctor(0, 4, 1);
|
||||
lean_ctor_set(x_26, 0, x_23);
|
||||
lean_ctor_set(x_26, 1, x_24);
|
||||
lean_ctor_set(x_26, 2, x_3);
|
||||
lean_ctor_set(x_26, 3, x_20);
|
||||
lean_ctor_set_uint8(x_26, sizeof(void*)*4, x_25);
|
||||
x_27 = lean_alloc_ctor(1, 1, 0);
|
||||
lean_ctor_set(x_27, 0, x_26);
|
||||
x_28 = l_Lean_Elab_pushInfoLeaf___at_Lean_Elab_elabDeriving___spec__11(x_27, x_4, x_5, x_21);
|
||||
lean_dec(x_4);
|
||||
x_28 = !lean_is_exclusive(x_27);
|
||||
if (x_28 == 0)
|
||||
x_29 = !lean_is_exclusive(x_28);
|
||||
if (x_29 == 0)
|
||||
{
|
||||
lean_object* x_29;
|
||||
x_29 = lean_ctor_get(x_27, 0);
|
||||
lean_dec(x_29);
|
||||
lean_ctor_set(x_27, 0, x_8);
|
||||
return x_27;
|
||||
lean_object* x_30;
|
||||
x_30 = lean_ctor_get(x_28, 0);
|
||||
lean_dec(x_30);
|
||||
lean_ctor_set(x_28, 0, x_8);
|
||||
return x_28;
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_30; lean_object* x_31;
|
||||
x_30 = lean_ctor_get(x_27, 1);
|
||||
lean_inc(x_30);
|
||||
lean_dec(x_27);
|
||||
x_31 = lean_alloc_ctor(0, 2, 0);
|
||||
lean_ctor_set(x_31, 0, x_8);
|
||||
lean_ctor_set(x_31, 1, x_30);
|
||||
return x_31;
|
||||
lean_object* x_31; lean_object* x_32;
|
||||
x_31 = lean_ctor_get(x_28, 1);
|
||||
lean_inc(x_31);
|
||||
lean_dec(x_28);
|
||||
x_32 = lean_alloc_ctor(0, 2, 0);
|
||||
lean_ctor_set(x_32, 0, x_8);
|
||||
lean_ctor_set(x_32, 1, x_31);
|
||||
return x_32;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
uint8_t x_32;
|
||||
uint8_t x_33;
|
||||
lean_dec(x_8);
|
||||
lean_dec(x_4);
|
||||
lean_dec(x_3);
|
||||
lean_dec(x_1);
|
||||
x_32 = !lean_is_exclusive(x_19);
|
||||
if (x_32 == 0)
|
||||
x_33 = !lean_is_exclusive(x_19);
|
||||
if (x_33 == 0)
|
||||
{
|
||||
return x_19;
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_33; lean_object* x_34; lean_object* x_35;
|
||||
x_33 = lean_ctor_get(x_19, 0);
|
||||
x_34 = lean_ctor_get(x_19, 1);
|
||||
lean_object* x_34; lean_object* x_35; lean_object* x_36;
|
||||
x_34 = lean_ctor_get(x_19, 0);
|
||||
x_35 = lean_ctor_get(x_19, 1);
|
||||
lean_inc(x_35);
|
||||
lean_inc(x_34);
|
||||
lean_inc(x_33);
|
||||
lean_dec(x_19);
|
||||
x_35 = lean_alloc_ctor(1, 2, 0);
|
||||
lean_ctor_set(x_35, 0, x_33);
|
||||
lean_ctor_set(x_35, 1, x_34);
|
||||
return x_35;
|
||||
x_36 = lean_alloc_ctor(1, 2, 0);
|
||||
lean_ctor_set(x_36, 0, x_34);
|
||||
lean_ctor_set(x_36, 1, x_35);
|
||||
return x_36;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
uint8_t x_36;
|
||||
uint8_t x_37;
|
||||
lean_dec(x_4);
|
||||
lean_dec(x_3);
|
||||
lean_dec(x_1);
|
||||
x_36 = !lean_is_exclusive(x_7);
|
||||
if (x_36 == 0)
|
||||
x_37 = !lean_is_exclusive(x_7);
|
||||
if (x_37 == 0)
|
||||
{
|
||||
return x_7;
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_37; lean_object* x_38; lean_object* x_39;
|
||||
x_37 = lean_ctor_get(x_7, 0);
|
||||
x_38 = lean_ctor_get(x_7, 1);
|
||||
lean_object* x_38; lean_object* x_39; lean_object* x_40;
|
||||
x_38 = lean_ctor_get(x_7, 0);
|
||||
x_39 = lean_ctor_get(x_7, 1);
|
||||
lean_inc(x_39);
|
||||
lean_inc(x_38);
|
||||
lean_inc(x_37);
|
||||
lean_dec(x_7);
|
||||
x_39 = lean_alloc_ctor(1, 2, 0);
|
||||
lean_ctor_set(x_39, 0, x_37);
|
||||
lean_ctor_set(x_39, 1, x_38);
|
||||
return x_39;
|
||||
x_40 = lean_alloc_ctor(1, 2, 0);
|
||||
lean_ctor_set(x_40, 0, x_38);
|
||||
lean_ctor_set(x_40, 1, x_39);
|
||||
return x_40;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
451
stage0/stdlib/Lean/Elab/Deriving/FromToJson.c
generated
451
stage0/stdlib/Lean/Elab/Deriving/FromToJson.c
generated
|
|
@ -45,7 +45,7 @@ static lean_object* l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___
|
|||
static lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__10;
|
||||
static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__13;
|
||||
lean_object* lean_array_uset(lean_object*, size_t, lean_object*);
|
||||
lean_object* l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__1___lambda__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__1___lambda__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
static lean_object* l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__23;
|
||||
static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__9;
|
||||
static lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__2___closed__3;
|
||||
|
|
@ -147,7 +147,6 @@ static lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___la
|
|||
uint8_t lean_nat_dec_eq(lean_object*, lean_object*);
|
||||
lean_object* l_Lean_throwError___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__2(lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__2;
|
||||
static lean_object* l_Lean_Elab_Deriving_FromToJson_initFn____x40_Lean_Elab_Deriving_FromToJson___hyg_4153____closed__2;
|
||||
static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___spec__3___closed__2;
|
||||
lean_object* l___private_Init_Meta_0__Lean_getEscapedNameParts_x3f(lean_object*, lean_object*);
|
||||
static lean_object* l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__5;
|
||||
|
|
@ -163,7 +162,6 @@ static lean_object* l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___
|
|||
lean_object* lean_array_swap(lean_object*, lean_object*, lean_object*);
|
||||
static lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__2___closed__23;
|
||||
lean_object* l_Lean_getStructureFieldsFlattened(lean_object*, lean_object*, uint8_t);
|
||||
static lean_object* l_Lean_Elab_Deriving_FromToJson_initFn____x40_Lean_Elab_Deriving_FromToJson___hyg_4153____closed__1;
|
||||
static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__8;
|
||||
static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__1;
|
||||
static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__1;
|
||||
|
|
@ -206,7 +204,7 @@ static lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___la
|
|||
static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__17;
|
||||
static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__4;
|
||||
static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__4;
|
||||
lean_object* l_Lean_Elab_Deriving_FromToJson_initFn____x40_Lean_Elab_Deriving_FromToJson___hyg_4153_(lean_object*);
|
||||
lean_object* l_Lean_Elab_Deriving_FromToJson_initFn____x40_Lean_Elab_Deriving_FromToJson___hyg_4142_(lean_object*);
|
||||
static lean_object* l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__8;
|
||||
static lean_object* l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__7;
|
||||
lean_object* l_Lean_Elab_addMacroStack___at_Lean_Elab_Term_instAddErrorMessageContextTermElabM___spec__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
|
|
@ -237,6 +235,7 @@ uint8_t l_Lean_Elab_Deriving_FromToJson_mkJsonField___lambda__1(uint32_t);
|
|||
extern lean_object* l_Lean_instInhabitedExpr;
|
||||
static lean_object* l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__4___lambda__1___closed__2;
|
||||
static lean_object* l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__31;
|
||||
static lean_object* l_Lean_Elab_Deriving_FromToJson_initFn____x40_Lean_Elab_Deriving_FromToJson___hyg_4142____closed__2;
|
||||
static lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__1;
|
||||
static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__31;
|
||||
static lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__2___closed__9;
|
||||
|
|
@ -255,6 +254,7 @@ lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts_matc
|
|||
lean_object* l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Elab_Deriving_mkHeader___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
static lean_object* l_Lean_getConstInfoCtor___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__1___closed__1;
|
||||
static lean_object* l_Lean_Elab_Deriving_FromToJson_initFn____x40_Lean_Elab_Deriving_FromToJson___hyg_4142____closed__1;
|
||||
lean_object* l_Lean_Elab_Deriving_mkContext(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__5___lambda__2___closed__2;
|
||||
uint8_t l_Array_qsort_sort___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__6___lambda__1(lean_object*, lean_object*);
|
||||
|
|
@ -269,6 +269,7 @@ static lean_object* l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mk
|
|||
static lean_object* l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__2___closed__6;
|
||||
static lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__4;
|
||||
static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__18;
|
||||
static lean_object* l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__1___closed__1;
|
||||
static lean_object* l_Lean_getConstInfoCtor___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__1___closed__2;
|
||||
lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___spec__6___closed__6;
|
||||
|
|
@ -278,7 +279,7 @@ static lean_object* l_Lean_getConstInfoCtor___at_Lean_Elab_Deriving_FromToJson_m
|
|||
static lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__9;
|
||||
static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__24;
|
||||
static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__7;
|
||||
lean_object* l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__1___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__1___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
static lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__2___closed__19;
|
||||
static lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__2___closed__13;
|
||||
lean_object* l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___boxed__const__1;
|
||||
|
|
@ -340,7 +341,6 @@ lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJso
|
|||
static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__3___closed__1;
|
||||
lean_object* l_List_toArrayAux___rarg(lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Meta_inferType(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
static lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__5___lambda__1___closed__21;
|
||||
lean_object* l_Lean_Elab_registerBuiltinDerivingHandler(lean_object*, lean_object*, lean_object*);
|
||||
static lean_object* l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__2___closed__12;
|
||||
|
|
@ -6988,86 +6988,56 @@ x_2 = lean_alloc_closure((void*)(l_Lean_Elab_Deriving_FromToJson_mkFromJsonInsta
|
|||
return x_2;
|
||||
}
|
||||
}
|
||||
lean_object* l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__1___lambda__1(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10, lean_object* x_11) {
|
||||
lean_object* l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__1___lambda__1(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10) {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_12;
|
||||
lean_inc(x_10);
|
||||
lean_inc(x_9);
|
||||
x_12 = l_Lean_Meta_inferType(x_1, x_7, x_8, x_9, x_10, x_11);
|
||||
if (lean_obj_tag(x_12) == 0)
|
||||
{
|
||||
lean_object* x_13; lean_object* x_14; lean_object* x_15; uint8_t x_16;
|
||||
x_13 = lean_ctor_get(x_12, 1);
|
||||
lean_inc(x_13);
|
||||
lean_dec(x_12);
|
||||
x_14 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__4___lambda__1___closed__2;
|
||||
x_15 = l___private_Lean_CoreM_0__Lean_Core_mkFreshNameImp(x_14, x_9, x_10, x_13);
|
||||
lean_dec(x_10);
|
||||
lean_dec(x_9);
|
||||
x_16 = !lean_is_exclusive(x_15);
|
||||
if (x_16 == 0)
|
||||
{
|
||||
lean_object* x_17; lean_object* x_18; lean_object* x_19; lean_object* x_20; lean_object* x_21;
|
||||
x_17 = lean_ctor_get(x_15, 0);
|
||||
x_18 = lean_mk_syntax_ident(x_17);
|
||||
x_19 = lean_array_push(x_3, x_18);
|
||||
x_20 = lean_alloc_ctor(0, 2, 0);
|
||||
lean_ctor_set(x_20, 0, x_2);
|
||||
lean_ctor_set(x_20, 1, x_19);
|
||||
x_21 = lean_alloc_ctor(1, 1, 0);
|
||||
lean_ctor_set(x_21, 0, x_20);
|
||||
lean_ctor_set(x_15, 0, x_21);
|
||||
return x_15;
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_22; lean_object* x_23; lean_object* x_24; lean_object* x_25; lean_object* x_26; lean_object* x_27; lean_object* x_28;
|
||||
x_22 = lean_ctor_get(x_15, 0);
|
||||
x_23 = lean_ctor_get(x_15, 1);
|
||||
lean_inc(x_23);
|
||||
lean_inc(x_22);
|
||||
lean_dec(x_15);
|
||||
x_24 = lean_mk_syntax_ident(x_22);
|
||||
x_25 = lean_array_push(x_3, x_24);
|
||||
x_26 = lean_alloc_ctor(0, 2, 0);
|
||||
lean_ctor_set(x_26, 0, x_2);
|
||||
lean_ctor_set(x_26, 1, x_25);
|
||||
x_27 = lean_alloc_ctor(1, 1, 0);
|
||||
lean_ctor_set(x_27, 0, x_26);
|
||||
x_28 = lean_alloc_ctor(0, 2, 0);
|
||||
lean_ctor_set(x_28, 0, x_27);
|
||||
lean_ctor_set(x_28, 1, x_23);
|
||||
return x_28;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
uint8_t x_29;
|
||||
lean_dec(x_10);
|
||||
lean_dec(x_9);
|
||||
lean_dec(x_3);
|
||||
lean_dec(x_2);
|
||||
x_29 = !lean_is_exclusive(x_12);
|
||||
if (x_29 == 0)
|
||||
lean_object* x_11; lean_object* x_12; uint8_t x_13;
|
||||
x_11 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler_mkAlts___spec__4___lambda__1___closed__2;
|
||||
x_12 = l___private_Lean_CoreM_0__Lean_Core_mkFreshNameImp(x_11, x_8, x_9, x_10);
|
||||
x_13 = !lean_is_exclusive(x_12);
|
||||
if (x_13 == 0)
|
||||
{
|
||||
lean_object* x_14; lean_object* x_15; lean_object* x_16; lean_object* x_17; lean_object* x_18;
|
||||
x_14 = lean_ctor_get(x_12, 0);
|
||||
x_15 = lean_mk_syntax_ident(x_14);
|
||||
x_16 = lean_array_push(x_2, x_15);
|
||||
x_17 = lean_alloc_ctor(0, 2, 0);
|
||||
lean_ctor_set(x_17, 0, x_1);
|
||||
lean_ctor_set(x_17, 1, x_16);
|
||||
x_18 = lean_alloc_ctor(1, 1, 0);
|
||||
lean_ctor_set(x_18, 0, x_17);
|
||||
lean_ctor_set(x_12, 0, x_18);
|
||||
return x_12;
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_30; lean_object* x_31; lean_object* x_32;
|
||||
x_30 = lean_ctor_get(x_12, 0);
|
||||
x_31 = lean_ctor_get(x_12, 1);
|
||||
lean_inc(x_31);
|
||||
lean_inc(x_30);
|
||||
lean_object* x_19; lean_object* x_20; lean_object* x_21; lean_object* x_22; lean_object* x_23; lean_object* x_24; lean_object* x_25;
|
||||
x_19 = lean_ctor_get(x_12, 0);
|
||||
x_20 = lean_ctor_get(x_12, 1);
|
||||
lean_inc(x_20);
|
||||
lean_inc(x_19);
|
||||
lean_dec(x_12);
|
||||
x_32 = lean_alloc_ctor(1, 2, 0);
|
||||
lean_ctor_set(x_32, 0, x_30);
|
||||
lean_ctor_set(x_32, 1, x_31);
|
||||
return x_32;
|
||||
x_21 = lean_mk_syntax_ident(x_19);
|
||||
x_22 = lean_array_push(x_2, x_21);
|
||||
x_23 = lean_alloc_ctor(0, 2, 0);
|
||||
lean_ctor_set(x_23, 0, x_1);
|
||||
lean_ctor_set(x_23, 1, x_22);
|
||||
x_24 = lean_alloc_ctor(1, 1, 0);
|
||||
lean_ctor_set(x_24, 0, x_23);
|
||||
x_25 = lean_alloc_ctor(0, 2, 0);
|
||||
lean_ctor_set(x_25, 0, x_24);
|
||||
lean_ctor_set(x_25, 1, x_20);
|
||||
return x_25;
|
||||
}
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__1___closed__1() {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_1;
|
||||
x_1 = lean_alloc_closure((void*)(l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__1___lambda__1___boxed), 10, 0);
|
||||
return x_1;
|
||||
}
|
||||
}
|
||||
lean_object* l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__1(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10, lean_object* x_11, lean_object* x_12, lean_object* x_13) {
|
||||
_start:
|
||||
|
|
@ -7097,222 +7067,235 @@ x_24 = l_Lean_instInhabitedExpr;
|
|||
x_25 = lean_array_get(x_24, x_2, x_23);
|
||||
lean_dec(x_23);
|
||||
x_26 = l_Lean_Expr_fvarId_x21(x_25);
|
||||
lean_dec(x_25);
|
||||
lean_inc(x_9);
|
||||
x_27 = l_Lean_Meta_getLocalDecl(x_26, x_9, x_10, x_11, x_12, x_13);
|
||||
if (lean_obj_tag(x_27) == 0)
|
||||
{
|
||||
lean_object* x_28; lean_object* x_29; lean_object* x_30; uint8_t x_31;
|
||||
lean_object* x_28; lean_object* x_29; lean_object* x_30; lean_object* x_31; uint8_t x_32;
|
||||
x_28 = lean_ctor_get(x_27, 0);
|
||||
lean_inc(x_28);
|
||||
x_29 = lean_ctor_get(x_27, 1);
|
||||
lean_inc(x_29);
|
||||
lean_dec(x_27);
|
||||
x_30 = l_Lean_LocalDecl_userName(x_28);
|
||||
x_30 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__1___closed__1;
|
||||
x_31 = l_Lean_LocalDecl_userName(x_28);
|
||||
lean_dec(x_28);
|
||||
x_31 = l_Lean_Name_hasMacroScopes(x_30);
|
||||
if (x_31 == 0)
|
||||
x_32 = l_Lean_Name_hasMacroScopes(x_31);
|
||||
if (x_32 == 0)
|
||||
{
|
||||
lean_object* x_32; lean_object* x_33; lean_object* x_34;
|
||||
x_32 = lean_array_push(x_20, x_30);
|
||||
x_33 = lean_box(0);
|
||||
lean_object* x_33; lean_object* x_34; lean_object* x_35;
|
||||
x_33 = lean_array_push(x_20, x_31);
|
||||
x_34 = lean_box(0);
|
||||
lean_inc(x_12);
|
||||
lean_inc(x_11);
|
||||
lean_inc(x_10);
|
||||
lean_inc(x_9);
|
||||
x_34 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__1___lambda__1(x_25, x_32, x_21, x_33, x_7, x_8, x_9, x_10, x_11, x_12, x_29);
|
||||
if (lean_obj_tag(x_34) == 0)
|
||||
{
|
||||
lean_object* x_35;
|
||||
x_35 = lean_ctor_get(x_34, 0);
|
||||
lean_inc(x_35);
|
||||
lean_inc(x_8);
|
||||
lean_inc(x_7);
|
||||
x_35 = lean_apply_10(x_30, x_33, x_21, x_34, x_7, x_8, x_9, x_10, x_11, x_12, x_29);
|
||||
if (lean_obj_tag(x_35) == 0)
|
||||
{
|
||||
uint8_t x_36;
|
||||
lean_object* x_36;
|
||||
x_36 = lean_ctor_get(x_35, 0);
|
||||
lean_inc(x_36);
|
||||
if (lean_obj_tag(x_36) == 0)
|
||||
{
|
||||
uint8_t x_37;
|
||||
lean_dec(x_19);
|
||||
lean_dec(x_12);
|
||||
lean_dec(x_11);
|
||||
lean_dec(x_10);
|
||||
lean_dec(x_9);
|
||||
lean_dec(x_8);
|
||||
lean_dec(x_7);
|
||||
lean_dec(x_5);
|
||||
x_36 = !lean_is_exclusive(x_34);
|
||||
if (x_36 == 0)
|
||||
x_37 = !lean_is_exclusive(x_35);
|
||||
if (x_37 == 0)
|
||||
{
|
||||
lean_object* x_37; lean_object* x_38;
|
||||
x_37 = lean_ctor_get(x_34, 0);
|
||||
lean_dec(x_37);
|
||||
lean_object* x_38; lean_object* x_39;
|
||||
x_38 = lean_ctor_get(x_35, 0);
|
||||
lean_inc(x_38);
|
||||
lean_dec(x_35);
|
||||
lean_ctor_set(x_34, 0, x_38);
|
||||
return x_34;
|
||||
lean_dec(x_38);
|
||||
x_39 = lean_ctor_get(x_36, 0);
|
||||
lean_inc(x_39);
|
||||
lean_dec(x_36);
|
||||
lean_ctor_set(x_35, 0, x_39);
|
||||
return x_35;
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_39; lean_object* x_40; lean_object* x_41;
|
||||
x_39 = lean_ctor_get(x_34, 1);
|
||||
lean_inc(x_39);
|
||||
lean_dec(x_34);
|
||||
x_40 = lean_ctor_get(x_35, 0);
|
||||
lean_object* x_40; lean_object* x_41; lean_object* x_42;
|
||||
x_40 = lean_ctor_get(x_35, 1);
|
||||
lean_inc(x_40);
|
||||
lean_dec(x_35);
|
||||
x_41 = lean_alloc_ctor(0, 2, 0);
|
||||
lean_ctor_set(x_41, 0, x_40);
|
||||
lean_ctor_set(x_41, 1, x_39);
|
||||
return x_41;
|
||||
x_41 = lean_ctor_get(x_36, 0);
|
||||
lean_inc(x_41);
|
||||
lean_dec(x_36);
|
||||
x_42 = lean_alloc_ctor(0, 2, 0);
|
||||
lean_ctor_set(x_42, 0, x_41);
|
||||
lean_ctor_set(x_42, 1, x_40);
|
||||
return x_42;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_42; lean_object* x_43; lean_object* x_44; lean_object* x_45;
|
||||
x_42 = lean_ctor_get(x_34, 1);
|
||||
lean_inc(x_42);
|
||||
lean_dec(x_34);
|
||||
x_43 = lean_ctor_get(x_35, 0);
|
||||
lean_object* x_43; lean_object* x_44; lean_object* x_45; lean_object* x_46;
|
||||
x_43 = lean_ctor_get(x_35, 1);
|
||||
lean_inc(x_43);
|
||||
lean_dec(x_35);
|
||||
x_44 = lean_ctor_get(x_3, 2);
|
||||
x_45 = lean_nat_add(x_5, x_44);
|
||||
x_44 = lean_ctor_get(x_36, 0);
|
||||
lean_inc(x_44);
|
||||
lean_dec(x_36);
|
||||
x_45 = lean_ctor_get(x_3, 2);
|
||||
x_46 = lean_nat_add(x_5, x_45);
|
||||
lean_dec(x_5);
|
||||
x_4 = x_19;
|
||||
x_5 = x_45;
|
||||
x_6 = x_43;
|
||||
x_13 = x_42;
|
||||
x_5 = x_46;
|
||||
x_6 = x_44;
|
||||
x_13 = x_43;
|
||||
goto _start;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
uint8_t x_47;
|
||||
uint8_t x_48;
|
||||
lean_dec(x_19);
|
||||
lean_dec(x_12);
|
||||
lean_dec(x_11);
|
||||
lean_dec(x_10);
|
||||
lean_dec(x_9);
|
||||
lean_dec(x_8);
|
||||
lean_dec(x_7);
|
||||
lean_dec(x_5);
|
||||
x_47 = !lean_is_exclusive(x_34);
|
||||
if (x_47 == 0)
|
||||
x_48 = !lean_is_exclusive(x_35);
|
||||
if (x_48 == 0)
|
||||
{
|
||||
return x_34;
|
||||
return x_35;
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_48; lean_object* x_49; lean_object* x_50;
|
||||
x_48 = lean_ctor_get(x_34, 0);
|
||||
x_49 = lean_ctor_get(x_34, 1);
|
||||
lean_object* x_49; lean_object* x_50; lean_object* x_51;
|
||||
x_49 = lean_ctor_get(x_35, 0);
|
||||
x_50 = lean_ctor_get(x_35, 1);
|
||||
lean_inc(x_50);
|
||||
lean_inc(x_49);
|
||||
lean_inc(x_48);
|
||||
lean_dec(x_34);
|
||||
x_50 = lean_alloc_ctor(1, 2, 0);
|
||||
lean_ctor_set(x_50, 0, x_48);
|
||||
lean_ctor_set(x_50, 1, x_49);
|
||||
return x_50;
|
||||
lean_dec(x_35);
|
||||
x_51 = lean_alloc_ctor(1, 2, 0);
|
||||
lean_ctor_set(x_51, 0, x_49);
|
||||
lean_ctor_set(x_51, 1, x_50);
|
||||
return x_51;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_51; lean_object* x_52;
|
||||
lean_dec(x_30);
|
||||
x_51 = lean_box(0);
|
||||
lean_object* x_52; lean_object* x_53;
|
||||
lean_dec(x_31);
|
||||
x_52 = lean_box(0);
|
||||
lean_inc(x_12);
|
||||
lean_inc(x_11);
|
||||
lean_inc(x_10);
|
||||
lean_inc(x_9);
|
||||
x_52 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__1___lambda__1(x_25, x_20, x_21, x_51, x_7, x_8, x_9, x_10, x_11, x_12, x_29);
|
||||
if (lean_obj_tag(x_52) == 0)
|
||||
{
|
||||
lean_object* x_53;
|
||||
x_53 = lean_ctor_get(x_52, 0);
|
||||
lean_inc(x_53);
|
||||
lean_inc(x_8);
|
||||
lean_inc(x_7);
|
||||
x_53 = lean_apply_10(x_30, x_20, x_21, x_52, x_7, x_8, x_9, x_10, x_11, x_12, x_29);
|
||||
if (lean_obj_tag(x_53) == 0)
|
||||
{
|
||||
uint8_t x_54;
|
||||
lean_object* x_54;
|
||||
x_54 = lean_ctor_get(x_53, 0);
|
||||
lean_inc(x_54);
|
||||
if (lean_obj_tag(x_54) == 0)
|
||||
{
|
||||
uint8_t x_55;
|
||||
lean_dec(x_19);
|
||||
lean_dec(x_12);
|
||||
lean_dec(x_11);
|
||||
lean_dec(x_10);
|
||||
lean_dec(x_9);
|
||||
lean_dec(x_8);
|
||||
lean_dec(x_7);
|
||||
lean_dec(x_5);
|
||||
x_54 = !lean_is_exclusive(x_52);
|
||||
if (x_54 == 0)
|
||||
x_55 = !lean_is_exclusive(x_53);
|
||||
if (x_55 == 0)
|
||||
{
|
||||
lean_object* x_55; lean_object* x_56;
|
||||
x_55 = lean_ctor_get(x_52, 0);
|
||||
lean_dec(x_55);
|
||||
lean_object* x_56; lean_object* x_57;
|
||||
x_56 = lean_ctor_get(x_53, 0);
|
||||
lean_inc(x_56);
|
||||
lean_dec(x_53);
|
||||
lean_ctor_set(x_52, 0, x_56);
|
||||
return x_52;
|
||||
lean_dec(x_56);
|
||||
x_57 = lean_ctor_get(x_54, 0);
|
||||
lean_inc(x_57);
|
||||
lean_dec(x_54);
|
||||
lean_ctor_set(x_53, 0, x_57);
|
||||
return x_53;
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_57; lean_object* x_58; lean_object* x_59;
|
||||
x_57 = lean_ctor_get(x_52, 1);
|
||||
lean_inc(x_57);
|
||||
lean_dec(x_52);
|
||||
x_58 = lean_ctor_get(x_53, 0);
|
||||
lean_object* x_58; lean_object* x_59; lean_object* x_60;
|
||||
x_58 = lean_ctor_get(x_53, 1);
|
||||
lean_inc(x_58);
|
||||
lean_dec(x_53);
|
||||
x_59 = lean_alloc_ctor(0, 2, 0);
|
||||
lean_ctor_set(x_59, 0, x_58);
|
||||
lean_ctor_set(x_59, 1, x_57);
|
||||
return x_59;
|
||||
x_59 = lean_ctor_get(x_54, 0);
|
||||
lean_inc(x_59);
|
||||
lean_dec(x_54);
|
||||
x_60 = lean_alloc_ctor(0, 2, 0);
|
||||
lean_ctor_set(x_60, 0, x_59);
|
||||
lean_ctor_set(x_60, 1, x_58);
|
||||
return x_60;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_60; lean_object* x_61; lean_object* x_62; lean_object* x_63;
|
||||
x_60 = lean_ctor_get(x_52, 1);
|
||||
lean_inc(x_60);
|
||||
lean_dec(x_52);
|
||||
x_61 = lean_ctor_get(x_53, 0);
|
||||
lean_object* x_61; lean_object* x_62; lean_object* x_63; lean_object* x_64;
|
||||
x_61 = lean_ctor_get(x_53, 1);
|
||||
lean_inc(x_61);
|
||||
lean_dec(x_53);
|
||||
x_62 = lean_ctor_get(x_3, 2);
|
||||
x_63 = lean_nat_add(x_5, x_62);
|
||||
x_62 = lean_ctor_get(x_54, 0);
|
||||
lean_inc(x_62);
|
||||
lean_dec(x_54);
|
||||
x_63 = lean_ctor_get(x_3, 2);
|
||||
x_64 = lean_nat_add(x_5, x_63);
|
||||
lean_dec(x_5);
|
||||
x_4 = x_19;
|
||||
x_5 = x_63;
|
||||
x_6 = x_61;
|
||||
x_13 = x_60;
|
||||
x_5 = x_64;
|
||||
x_6 = x_62;
|
||||
x_13 = x_61;
|
||||
goto _start;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
uint8_t x_65;
|
||||
uint8_t x_66;
|
||||
lean_dec(x_19);
|
||||
lean_dec(x_12);
|
||||
lean_dec(x_11);
|
||||
lean_dec(x_10);
|
||||
lean_dec(x_9);
|
||||
lean_dec(x_8);
|
||||
lean_dec(x_7);
|
||||
lean_dec(x_5);
|
||||
x_65 = !lean_is_exclusive(x_52);
|
||||
if (x_65 == 0)
|
||||
x_66 = !lean_is_exclusive(x_53);
|
||||
if (x_66 == 0)
|
||||
{
|
||||
return x_52;
|
||||
return x_53;
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_66; lean_object* x_67; lean_object* x_68;
|
||||
x_66 = lean_ctor_get(x_52, 0);
|
||||
x_67 = lean_ctor_get(x_52, 1);
|
||||
lean_object* x_67; lean_object* x_68; lean_object* x_69;
|
||||
x_67 = lean_ctor_get(x_53, 0);
|
||||
x_68 = lean_ctor_get(x_53, 1);
|
||||
lean_inc(x_68);
|
||||
lean_inc(x_67);
|
||||
lean_inc(x_66);
|
||||
lean_dec(x_52);
|
||||
x_68 = lean_alloc_ctor(1, 2, 0);
|
||||
lean_ctor_set(x_68, 0, x_66);
|
||||
lean_ctor_set(x_68, 1, x_67);
|
||||
return x_68;
|
||||
lean_dec(x_53);
|
||||
x_69 = lean_alloc_ctor(1, 2, 0);
|
||||
lean_ctor_set(x_69, 0, x_67);
|
||||
lean_ctor_set(x_69, 1, x_68);
|
||||
return x_69;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
uint8_t x_69;
|
||||
lean_dec(x_25);
|
||||
uint8_t x_70;
|
||||
lean_dec(x_21);
|
||||
lean_dec(x_20);
|
||||
lean_dec(x_19);
|
||||
|
|
@ -7320,42 +7303,29 @@ lean_dec(x_12);
|
|||
lean_dec(x_11);
|
||||
lean_dec(x_10);
|
||||
lean_dec(x_9);
|
||||
lean_dec(x_8);
|
||||
lean_dec(x_7);
|
||||
lean_dec(x_5);
|
||||
x_69 = !lean_is_exclusive(x_27);
|
||||
if (x_69 == 0)
|
||||
x_70 = !lean_is_exclusive(x_27);
|
||||
if (x_70 == 0)
|
||||
{
|
||||
return x_27;
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_70; lean_object* x_71; lean_object* x_72;
|
||||
x_70 = lean_ctor_get(x_27, 0);
|
||||
x_71 = lean_ctor_get(x_27, 1);
|
||||
lean_object* x_71; lean_object* x_72; lean_object* x_73;
|
||||
x_71 = lean_ctor_get(x_27, 0);
|
||||
x_72 = lean_ctor_get(x_27, 1);
|
||||
lean_inc(x_72);
|
||||
lean_inc(x_71);
|
||||
lean_inc(x_70);
|
||||
lean_dec(x_27);
|
||||
x_72 = lean_alloc_ctor(1, 2, 0);
|
||||
lean_ctor_set(x_72, 0, x_70);
|
||||
lean_ctor_set(x_72, 1, x_71);
|
||||
return x_72;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_73;
|
||||
lean_dec(x_12);
|
||||
lean_dec(x_11);
|
||||
lean_dec(x_10);
|
||||
lean_dec(x_9);
|
||||
lean_dec(x_5);
|
||||
lean_dec(x_4);
|
||||
x_73 = lean_alloc_ctor(0, 2, 0);
|
||||
lean_ctor_set(x_73, 0, x_6);
|
||||
lean_ctor_set(x_73, 1, x_13);
|
||||
x_73 = lean_alloc_ctor(1, 2, 0);
|
||||
lean_ctor_set(x_73, 0, x_71);
|
||||
lean_ctor_set(x_73, 1, x_72);
|
||||
return x_73;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_74;
|
||||
|
|
@ -7363,6 +7333,8 @@ lean_dec(x_12);
|
|||
lean_dec(x_11);
|
||||
lean_dec(x_10);
|
||||
lean_dec(x_9);
|
||||
lean_dec(x_8);
|
||||
lean_dec(x_7);
|
||||
lean_dec(x_5);
|
||||
lean_dec(x_4);
|
||||
x_74 = lean_alloc_ctor(0, 2, 0);
|
||||
|
|
@ -7371,6 +7343,23 @@ lean_ctor_set(x_74, 1, x_13);
|
|||
return x_74;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_75;
|
||||
lean_dec(x_12);
|
||||
lean_dec(x_11);
|
||||
lean_dec(x_10);
|
||||
lean_dec(x_9);
|
||||
lean_dec(x_8);
|
||||
lean_dec(x_7);
|
||||
lean_dec(x_5);
|
||||
lean_dec(x_4);
|
||||
x_75 = lean_alloc_ctor(0, 2, 0);
|
||||
lean_ctor_set(x_75, 0, x_6);
|
||||
lean_ctor_set(x_75, 1, x_13);
|
||||
return x_75;
|
||||
}
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__2___closed__1() {
|
||||
_start:
|
||||
|
|
@ -8990,6 +8979,8 @@ lean_inc(x_11);
|
|||
lean_inc(x_10);
|
||||
lean_inc(x_9);
|
||||
lean_inc(x_8);
|
||||
lean_inc(x_7);
|
||||
lean_inc(x_6);
|
||||
lean_inc(x_13);
|
||||
x_18 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__1(x_2, x_4, x_16, x_13, x_14, x_17, x_6, x_7, x_8, x_9, x_10, x_11, x_12);
|
||||
lean_dec(x_16);
|
||||
|
|
@ -9056,6 +9047,8 @@ lean_dec(x_11);
|
|||
lean_dec(x_10);
|
||||
lean_dec(x_9);
|
||||
lean_dec(x_8);
|
||||
lean_dec(x_7);
|
||||
lean_dec(x_6);
|
||||
lean_dec(x_26);
|
||||
lean_dec(x_22);
|
||||
return x_45;
|
||||
|
|
@ -9149,6 +9142,8 @@ lean_dec(x_11);
|
|||
lean_dec(x_10);
|
||||
lean_dec(x_9);
|
||||
lean_dec(x_8);
|
||||
lean_dec(x_7);
|
||||
lean_dec(x_6);
|
||||
lean_dec(x_26);
|
||||
lean_dec(x_22);
|
||||
return x_96;
|
||||
|
|
@ -9162,6 +9157,8 @@ lean_dec(x_11);
|
|||
lean_dec(x_10);
|
||||
lean_dec(x_9);
|
||||
lean_dec(x_8);
|
||||
lean_dec(x_7);
|
||||
lean_dec(x_6);
|
||||
lean_dec(x_3);
|
||||
x_97 = !lean_is_exclusive(x_18);
|
||||
if (x_97 == 0)
|
||||
|
|
@ -9703,15 +9700,19 @@ return x_50;
|
|||
}
|
||||
}
|
||||
}
|
||||
lean_object* l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__1___lambda__1___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10, lean_object* x_11) {
|
||||
lean_object* l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__1___lambda__1___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10) {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_12;
|
||||
x_12 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__1___lambda__1(x_1, x_2, x_3, x_4, x_5, x_6, x_7, x_8, x_9, x_10, x_11);
|
||||
lean_object* x_11;
|
||||
x_11 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__1___lambda__1(x_1, x_2, x_3, x_4, x_5, x_6, x_7, x_8, x_9, x_10);
|
||||
lean_dec(x_9);
|
||||
lean_dec(x_8);
|
||||
lean_dec(x_7);
|
||||
lean_dec(x_6);
|
||||
lean_dec(x_5);
|
||||
lean_dec(x_4);
|
||||
return x_12;
|
||||
lean_dec(x_3);
|
||||
return x_11;
|
||||
}
|
||||
}
|
||||
lean_object* l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__1___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10, lean_object* x_11, lean_object* x_12, lean_object* x_13) {
|
||||
|
|
@ -9719,8 +9720,6 @@ _start:
|
|||
{
|
||||
lean_object* x_14;
|
||||
x_14 = l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__1(x_1, x_2, x_3, x_4, x_5, x_6, x_7, x_8, x_9, x_10, x_11, x_12, x_13);
|
||||
lean_dec(x_8);
|
||||
lean_dec(x_7);
|
||||
lean_dec(x_3);
|
||||
lean_dec(x_2);
|
||||
lean_dec(x_1);
|
||||
|
|
@ -9805,8 +9804,6 @@ _start:
|
|||
{
|
||||
lean_object* x_13;
|
||||
x_13 = l_Array_mapMUnsafe_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__5___lambda__2(x_1, x_2, x_3, x_4, x_5, x_6, x_7, x_8, x_9, x_10, x_11, x_12);
|
||||
lean_dec(x_7);
|
||||
lean_dec(x_6);
|
||||
lean_dec(x_5);
|
||||
lean_dec(x_4);
|
||||
lean_dec(x_2);
|
||||
|
|
@ -12530,7 +12527,7 @@ lean_dec(x_2);
|
|||
return x_10;
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_initFn____x40_Lean_Elab_Deriving_FromToJson___hyg_4153____closed__1() {
|
||||
static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_initFn____x40_Lean_Elab_Deriving_FromToJson___hyg_4142____closed__1() {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_1;
|
||||
|
|
@ -12538,7 +12535,7 @@ x_1 = lean_alloc_closure((void*)(l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanc
|
|||
return x_1;
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_initFn____x40_Lean_Elab_Deriving_FromToJson___hyg_4153____closed__2() {
|
||||
static lean_object* _init_l_Lean_Elab_Deriving_FromToJson_initFn____x40_Lean_Elab_Deriving_FromToJson___hyg_4142____closed__2() {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_1;
|
||||
|
|
@ -12546,12 +12543,12 @@ x_1 = lean_alloc_closure((void*)(l_Lean_Elab_Deriving_FromToJson_mkFromJsonInsta
|
|||
return x_1;
|
||||
}
|
||||
}
|
||||
lean_object* l_Lean_Elab_Deriving_FromToJson_initFn____x40_Lean_Elab_Deriving_FromToJson___hyg_4153_(lean_object* x_1) {
|
||||
lean_object* l_Lean_Elab_Deriving_FromToJson_initFn____x40_Lean_Elab_Deriving_FromToJson___hyg_4142_(lean_object* x_1) {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_2; lean_object* x_3; lean_object* x_4;
|
||||
x_2 = l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__2___closed__2;
|
||||
x_3 = l_Lean_Elab_Deriving_FromToJson_initFn____x40_Lean_Elab_Deriving_FromToJson___hyg_4153____closed__1;
|
||||
x_3 = l_Lean_Elab_Deriving_FromToJson_initFn____x40_Lean_Elab_Deriving_FromToJson___hyg_4142____closed__1;
|
||||
x_4 = l_Lean_Elab_registerBuiltinDerivingHandler(x_2, x_3, x_1);
|
||||
if (lean_obj_tag(x_4) == 0)
|
||||
{
|
||||
|
|
@ -12560,7 +12557,7 @@ x_5 = lean_ctor_get(x_4, 1);
|
|||
lean_inc(x_5);
|
||||
lean_dec(x_4);
|
||||
x_6 = l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__1___closed__2;
|
||||
x_7 = l_Lean_Elab_Deriving_FromToJson_initFn____x40_Lean_Elab_Deriving_FromToJson___hyg_4153____closed__2;
|
||||
x_7 = l_Lean_Elab_Deriving_FromToJson_initFn____x40_Lean_Elab_Deriving_FromToJson___hyg_4142____closed__2;
|
||||
x_8 = l_Lean_Elab_registerBuiltinDerivingHandler(x_6, x_7, x_5);
|
||||
return x_8;
|
||||
}
|
||||
|
|
@ -12833,6 +12830,8 @@ l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__16
|
|||
lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___closed__16);
|
||||
l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___boxed__const__1 = _init_l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___boxed__const__1();
|
||||
lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkToJsonInstanceHandler___lambda__3___boxed__const__1);
|
||||
l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__1___closed__1 = _init_l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__1___closed__1();
|
||||
lean_mark_persistent(l_Std_Range_forIn_loop___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__1___closed__1);
|
||||
l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__2___closed__1 = _init_l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__2___closed__1();
|
||||
lean_mark_persistent(l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__2___closed__1);
|
||||
l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__2___closed__2 = _init_l_Array_mapIdxM_map___at_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler_mkAlts___spec__2___closed__2();
|
||||
|
|
@ -13103,11 +13102,11 @@ l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__
|
|||
lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__13);
|
||||
l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__14 = _init_l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__14();
|
||||
lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_mkFromJsonInstanceHandler___lambda__2___closed__14);
|
||||
l_Lean_Elab_Deriving_FromToJson_initFn____x40_Lean_Elab_Deriving_FromToJson___hyg_4153____closed__1 = _init_l_Lean_Elab_Deriving_FromToJson_initFn____x40_Lean_Elab_Deriving_FromToJson___hyg_4153____closed__1();
|
||||
lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_initFn____x40_Lean_Elab_Deriving_FromToJson___hyg_4153____closed__1);
|
||||
l_Lean_Elab_Deriving_FromToJson_initFn____x40_Lean_Elab_Deriving_FromToJson___hyg_4153____closed__2 = _init_l_Lean_Elab_Deriving_FromToJson_initFn____x40_Lean_Elab_Deriving_FromToJson___hyg_4153____closed__2();
|
||||
lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_initFn____x40_Lean_Elab_Deriving_FromToJson___hyg_4153____closed__2);
|
||||
res = l_Lean_Elab_Deriving_FromToJson_initFn____x40_Lean_Elab_Deriving_FromToJson___hyg_4153_(lean_io_mk_world());
|
||||
l_Lean_Elab_Deriving_FromToJson_initFn____x40_Lean_Elab_Deriving_FromToJson___hyg_4142____closed__1 = _init_l_Lean_Elab_Deriving_FromToJson_initFn____x40_Lean_Elab_Deriving_FromToJson___hyg_4142____closed__1();
|
||||
lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_initFn____x40_Lean_Elab_Deriving_FromToJson___hyg_4142____closed__1);
|
||||
l_Lean_Elab_Deriving_FromToJson_initFn____x40_Lean_Elab_Deriving_FromToJson___hyg_4142____closed__2 = _init_l_Lean_Elab_Deriving_FromToJson_initFn____x40_Lean_Elab_Deriving_FromToJson___hyg_4142____closed__2();
|
||||
lean_mark_persistent(l_Lean_Elab_Deriving_FromToJson_initFn____x40_Lean_Elab_Deriving_FromToJson___hyg_4142____closed__2);
|
||||
res = l_Lean_Elab_Deriving_FromToJson_initFn____x40_Lean_Elab_Deriving_FromToJson___hyg_4142_(lean_io_mk_world());
|
||||
if (lean_io_result_is_error(res)) return res;
|
||||
lean_dec_ref(res);
|
||||
return lean_io_result_mk_ok(lean_box(0));
|
||||
|
|
|
|||
2
stage0/stdlib/Lean/Elab/Do.c
generated
2
stage0/stdlib/Lean/Elab/Do.c
generated
|
|
@ -23200,7 +23200,7 @@ lean_object* x_43; lean_object* x_44; lean_object* x_45; lean_object* x_46; lean
|
|||
x_43 = lean_unsigned_to_nat(0u);
|
||||
x_44 = l_Lean_Syntax_getArg(x_37, x_43);
|
||||
x_45 = l_Lean_Syntax_getArg(x_37, x_17);
|
||||
x_46 = l_Lean_Elab_Term_expandOptType(x_37, x_45);
|
||||
x_46 = l_Lean_Elab_Term_expandOptType(x_44, x_45);
|
||||
lean_dec(x_45);
|
||||
x_47 = lean_unsigned_to_nat(3u);
|
||||
x_48 = l_Lean_Syntax_getArg(x_37, x_47);
|
||||
|
|
|
|||
86
stage0/stdlib/Lean/Elab/InfoTree.c
generated
86
stage0/stdlib/Lean/Elab/InfoTree.c
generated
|
|
@ -64,6 +64,7 @@ lean_object* l___private_Lean_Elab_InfoTree_0__Lean_Elab_formatStxRange_fmtPos(l
|
|||
size_t l_USize_sub(size_t, size_t);
|
||||
lean_object* l_Lean_Elab_InfoTree_format_match__1(lean_object*);
|
||||
lean_object* l_Lean_Elab_instInhabitedElabInfo;
|
||||
uint8_t l_Lean_Elab_TermInfo_isBinder___default;
|
||||
lean_object* l_Lean_Meta_ppExpr(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Elab_ContextInfo_runMetaM___rarg___boxed(lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Elab_InfoTree_findInfo_x3f_match__1(lean_object*);
|
||||
|
|
@ -685,6 +686,14 @@ x_1 = l_Lean_Elab_instInhabitedElabInfo___closed__1;
|
|||
return x_1;
|
||||
}
|
||||
}
|
||||
static uint8_t _init_l_Lean_Elab_TermInfo_isBinder___default() {
|
||||
_start:
|
||||
{
|
||||
uint8_t x_1;
|
||||
x_1 = 0;
|
||||
return x_1;
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l_Lean_Elab_instInhabitedTermInfo___closed__1() {
|
||||
_start:
|
||||
{
|
||||
|
|
@ -757,17 +766,19 @@ return x_3;
|
|||
static lean_object* _init_l_Lean_Elab_instInhabitedTermInfo___closed__7() {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5;
|
||||
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; uint8_t x_5; lean_object* x_6;
|
||||
x_1 = lean_box(0);
|
||||
x_2 = l_Lean_Elab_instInhabitedElabInfo___closed__1;
|
||||
x_3 = l_Lean_Elab_instInhabitedTermInfo___closed__4;
|
||||
x_4 = l_Lean_Elab_instInhabitedTermInfo___closed__6;
|
||||
x_5 = lean_alloc_ctor(0, 4, 0);
|
||||
lean_ctor_set(x_5, 0, x_2);
|
||||
lean_ctor_set(x_5, 1, x_3);
|
||||
lean_ctor_set(x_5, 2, x_1);
|
||||
lean_ctor_set(x_5, 3, x_4);
|
||||
return x_5;
|
||||
x_5 = 0;
|
||||
x_6 = lean_alloc_ctor(0, 4, 1);
|
||||
lean_ctor_set(x_6, 0, x_2);
|
||||
lean_ctor_set(x_6, 1, x_3);
|
||||
lean_ctor_set(x_6, 2, x_1);
|
||||
lean_ctor_set(x_6, 3, x_4);
|
||||
lean_ctor_set_uint8(x_6, sizeof(void*)*4, x_5);
|
||||
return x_6;
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l_Lean_Elab_instInhabitedTermInfo() {
|
||||
|
|
@ -1473,14 +1484,16 @@ x_5 = lean_ctor_get(x_2, 0);
|
|||
lean_inc(x_5);
|
||||
x_6 = lean_ctor_get(x_2, 1);
|
||||
lean_inc(x_6);
|
||||
lean_dec(x_2);
|
||||
lean_inc(x_1);
|
||||
lean_inc(x_5);
|
||||
x_7 = lean_apply_1(x_1, x_5);
|
||||
x_8 = lean_unbox(x_7);
|
||||
lean_dec(x_7);
|
||||
if (x_8 == 0)
|
||||
{
|
||||
lean_object* x_9;
|
||||
lean_dec(x_2);
|
||||
lean_dec(x_5);
|
||||
x_9 = l_Std_PersistentArray_findSomeM_x3f___at_Lean_Elab_InfoTree_findInfo_x3f___spec__1(x_1, x_6);
|
||||
lean_dec(x_6);
|
||||
return x_9;
|
||||
|
|
@ -1491,7 +1504,7 @@ lean_object* x_10;
|
|||
lean_dec(x_6);
|
||||
lean_dec(x_1);
|
||||
x_10 = lean_alloc_ctor(1, 1, 0);
|
||||
lean_ctor_set(x_10, 0, x_2);
|
||||
lean_ctor_set(x_10, 0, x_5);
|
||||
return x_10;
|
||||
}
|
||||
}
|
||||
|
|
@ -6453,22 +6466,24 @@ return x_2;
|
|||
lean_object* l_Lean_Elab_resolveGlobalConstNoOverloadWithInfo___rarg___lambda__1(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7) {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_8; lean_object* x_9; lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14;
|
||||
lean_object* x_8; lean_object* x_9; lean_object* x_10; uint8_t x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14; lean_object* x_15;
|
||||
x_8 = lean_box(0);
|
||||
x_9 = lean_alloc_ctor(0, 2, 0);
|
||||
lean_ctor_set(x_9, 0, x_8);
|
||||
lean_ctor_set(x_9, 1, x_1);
|
||||
x_10 = l_Lean_LocalContext_empty;
|
||||
x_11 = lean_alloc_ctor(0, 4, 0);
|
||||
lean_ctor_set(x_11, 0, x_9);
|
||||
lean_ctor_set(x_11, 1, x_10);
|
||||
lean_ctor_set(x_11, 2, x_2);
|
||||
lean_ctor_set(x_11, 3, x_7);
|
||||
x_12 = lean_alloc_ctor(1, 1, 0);
|
||||
lean_ctor_set(x_12, 0, x_11);
|
||||
x_13 = l_Lean_Elab_pushInfoLeaf___rarg(x_3, x_4, x_12);
|
||||
x_14 = lean_apply_4(x_6, lean_box(0), lean_box(0), x_13, x_5);
|
||||
return x_14;
|
||||
x_11 = 0;
|
||||
x_12 = lean_alloc_ctor(0, 4, 1);
|
||||
lean_ctor_set(x_12, 0, x_9);
|
||||
lean_ctor_set(x_12, 1, x_10);
|
||||
lean_ctor_set(x_12, 2, x_2);
|
||||
lean_ctor_set(x_12, 3, x_7);
|
||||
lean_ctor_set_uint8(x_12, sizeof(void*)*4, x_11);
|
||||
x_13 = lean_alloc_ctor(1, 1, 0);
|
||||
lean_ctor_set(x_13, 0, x_12);
|
||||
x_14 = l_Lean_Elab_pushInfoLeaf___rarg(x_3, x_4, x_13);
|
||||
x_15 = lean_apply_4(x_6, lean_box(0), lean_box(0), x_14, x_5);
|
||||
return x_15;
|
||||
}
|
||||
}
|
||||
lean_object* l_Lean_Elab_resolveGlobalConstNoOverloadWithInfo___rarg___lambda__2(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9) {
|
||||
|
|
@ -6607,25 +6622,27 @@ return x_6;
|
|||
lean_object* l_List_forIn_loop___at_Lean_Elab_resolveGlobalConstWithInfos___spec__1___rarg___lambda__2(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6) {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14;
|
||||
lean_object* x_7; lean_object* x_8; lean_object* x_9; uint8_t x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13; lean_object* x_14; lean_object* x_15;
|
||||
x_7 = lean_box(0);
|
||||
x_8 = lean_alloc_ctor(0, 2, 0);
|
||||
lean_ctor_set(x_8, 0, x_7);
|
||||
lean_ctor_set(x_8, 1, x_1);
|
||||
x_9 = l_Lean_LocalContext_empty;
|
||||
x_10 = lean_alloc_ctor(0, 4, 0);
|
||||
lean_ctor_set(x_10, 0, x_8);
|
||||
lean_ctor_set(x_10, 1, x_9);
|
||||
lean_ctor_set(x_10, 2, x_2);
|
||||
lean_ctor_set(x_10, 3, x_6);
|
||||
x_11 = lean_alloc_ctor(1, 1, 0);
|
||||
lean_ctor_set(x_11, 0, x_10);
|
||||
x_10 = 0;
|
||||
x_11 = lean_alloc_ctor(0, 4, 1);
|
||||
lean_ctor_set(x_11, 0, x_8);
|
||||
lean_ctor_set(x_11, 1, x_9);
|
||||
lean_ctor_set(x_11, 2, x_2);
|
||||
lean_ctor_set(x_11, 3, x_6);
|
||||
lean_ctor_set_uint8(x_11, sizeof(void*)*4, x_10);
|
||||
x_12 = lean_alloc_ctor(1, 1, 0);
|
||||
lean_ctor_set(x_12, 0, x_11);
|
||||
lean_inc(x_3);
|
||||
x_12 = l_Lean_Elab_pushInfoLeaf___rarg(x_3, x_4, x_11);
|
||||
x_13 = lean_alloc_closure((void*)(l_List_forIn_loop___at_Lean_Elab_resolveGlobalConstWithInfos___spec__1___rarg___lambda__1___boxed), 2, 1);
|
||||
lean_closure_set(x_13, 0, x_3);
|
||||
x_14 = lean_apply_4(x_5, lean_box(0), lean_box(0), x_12, x_13);
|
||||
return x_14;
|
||||
x_13 = l_Lean_Elab_pushInfoLeaf___rarg(x_3, x_4, x_12);
|
||||
x_14 = lean_alloc_closure((void*)(l_List_forIn_loop___at_Lean_Elab_resolveGlobalConstWithInfos___spec__1___rarg___lambda__1___boxed), 2, 1);
|
||||
lean_closure_set(x_14, 0, x_3);
|
||||
x_15 = lean_apply_4(x_5, lean_box(0), lean_box(0), x_13, x_14);
|
||||
return x_15;
|
||||
}
|
||||
}
|
||||
lean_object* l_List_forIn_loop___at_Lean_Elab_resolveGlobalConstWithInfos___spec__1___rarg___lambda__3(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9) {
|
||||
|
|
@ -9027,7 +9044,7 @@ _start:
|
|||
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6;
|
||||
x_1 = l_Lean_Elab_assignInfoHoleId___rarg___lambda__2___closed__4;
|
||||
x_2 = l_Lean_Elab_assignInfoHoleId___rarg___lambda__2___closed__5;
|
||||
x_3 = lean_unsigned_to_nat(339u);
|
||||
x_3 = lean_unsigned_to_nat(340u);
|
||||
x_4 = lean_unsigned_to_nat(2u);
|
||||
x_5 = l_Lean_Elab_assignInfoHoleId___rarg___lambda__2___closed__3;
|
||||
x_6 = l___private_Init_Util_0__mkPanicMessageWithDecl(x_1, x_2, x_3, x_4, x_5);
|
||||
|
|
@ -9693,6 +9710,7 @@ l_Lean_Elab_instInhabitedElabInfo___closed__1 = _init_l_Lean_Elab_instInhabitedE
|
|||
lean_mark_persistent(l_Lean_Elab_instInhabitedElabInfo___closed__1);
|
||||
l_Lean_Elab_instInhabitedElabInfo = _init_l_Lean_Elab_instInhabitedElabInfo();
|
||||
lean_mark_persistent(l_Lean_Elab_instInhabitedElabInfo);
|
||||
l_Lean_Elab_TermInfo_isBinder___default = _init_l_Lean_Elab_TermInfo_isBinder___default();
|
||||
l_Lean_Elab_instInhabitedTermInfo___closed__1 = _init_l_Lean_Elab_instInhabitedTermInfo___closed__1();
|
||||
lean_mark_persistent(l_Lean_Elab_instInhabitedTermInfo___closed__1);
|
||||
l_Lean_Elab_instInhabitedTermInfo___closed__2 = _init_l_Lean_Elab_instInhabitedTermInfo___closed__2();
|
||||
|
|
|
|||
601
stage0/stdlib/Lean/Elab/LetRec.c
generated
601
stage0/stdlib/Lean/Elab/LetRec.c
generated
|
|
@ -15,6 +15,7 @@ extern "C" {
|
|||
#endif
|
||||
lean_object* l_Lean_addDocString_x27___at___private_Lean_Elab_LetRec_0__Lean_Elab_Term_mkLetRecDeclView___spec__5(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_List_reverse___rarg(lean_object*);
|
||||
lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Term_elabLetRec___spec__2___boxed(lean_object*, lean_object*, lean_object*);
|
||||
static lean_object* l_Lean_Elab_checkNotAlreadyDeclared___at___private_Lean_Elab_LetRec_0__Lean_Elab_Term_mkLetRecDeclView___spec__4___lambda__2___closed__2;
|
||||
lean_object* l_Array_mapIdxM_map___at___private_Lean_Elab_LetRec_0__Lean_Elab_Term_registerLetRecsToLift___spec__3___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Elab_Term_elabLetRec(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
|
|
@ -26,6 +27,7 @@ lean_object* l_Lean_stringToMessageData(lean_object*);
|
|||
lean_object* l_Lean_addDeclarationRanges___at___private_Lean_Elab_LetRec_0__Lean_Elab_Term_mkLetRecDeclView___spec__9(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* lean_mk_empty_array_with_capacity(lean_object*);
|
||||
lean_object* l_Lean_Meta_mkForallFVars(lean_object*, lean_object*, uint8_t, uint8_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Array_forInUnsafe_loop___at_Lean_Elab_Term_elabLetRec___spec__1___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l___private_Lean_Elab_LetRec_0__Lean_Elab_Term_mkLetRecDeclView(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* lean_name_mk_string(lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Syntax_getOptional_x3f(lean_object*);
|
||||
|
|
@ -56,8 +58,10 @@ static lean_object* l_Lean_Elab_throwUnsupportedSyntax___at___private_Lean_Elab_
|
|||
lean_object* l_Array_forInUnsafe_loop___at___private_Lean_Elab_LetRec_0__Lean_Elab_Term_mkLetRecDeclView___spec__21___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
static lean_object* l_Array_mapMUnsafe_map___at___private_Lean_Elab_LetRec_0__Lean_Elab_Term_mkLetRecDeclView___spec__22___lambda__3___closed__1;
|
||||
static lean_object* l_Lean_Elab_elabAttr___at___private_Lean_Elab_LetRec_0__Lean_Elab_Term_mkLetRecDeclView___spec__15___lambda__2___closed__2;
|
||||
lean_object* l_Array_toSubarray___rarg(lean_object*, lean_object*, lean_object*);
|
||||
lean_object* lean_array_push(lean_object*, lean_object*);
|
||||
lean_object* lean_array_get_size(lean_object*);
|
||||
lean_object* l_Lean_Elab_Term_elabLetRec_match__1(lean_object*);
|
||||
static lean_object* l_Array_mapMUnsafe_map___at___private_Lean_Elab_LetRec_0__Lean_Elab_Term_mkLetRecDeclView___spec__22___lambda__3___closed__8;
|
||||
lean_object* l_Lean_Elab_checkNotAlreadyDeclared___at___private_Lean_Elab_LetRec_0__Lean_Elab_Term_mkLetRecDeclView___spec__4___lambda__2(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l___private_Lean_Elab_LetRec_0__Lean_Elab_Term_mkLetRecDeclView_match__1___rarg(lean_object*, lean_object*);
|
||||
|
|
@ -71,6 +75,7 @@ lean_object* l_Lean_Elab_elabAttrs___at___private_Lean_Elab_LetRec_0__Lean_Elab_
|
|||
static lean_object* l_Lean_Elab_elabAttr___at___private_Lean_Elab_LetRec_0__Lean_Elab_Term_mkLetRecDeclView___spec__15___closed__1;
|
||||
lean_object* lean_string_utf8_byte_size(lean_object*);
|
||||
lean_object* l_Lean_throwErrorAt___at___private_Lean_Elab_LetRec_0__Lean_Elab_Term_mkLetRecDeclView___spec__17___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Array_forInUnsafe_loop___at_Lean_Elab_Term_elabLetRec___spec__1(lean_object*, size_t, size_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_KeyedDeclsAttribute_addBuiltin___rarg(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
uint8_t l_USize_decLt(size_t, size_t);
|
||||
lean_object* l_Lean_Elab_throwUnsupportedSyntax___at___private_Lean_Elab_LetRec_0__Lean_Elab_Term_mkLetRecDeclView___spec__19___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
|
|
@ -99,7 +104,6 @@ lean_object* l_Lean_Elab_Term_elabTermEnsuringType(lean_object*, lean_object*, u
|
|||
lean_object* lean_array_fget(lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Elab_liftMacroM___at___private_Lean_Elab_LetRec_0__Lean_Elab_Term_mkLetRecDeclView___spec__16___lambda__3(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_MapDeclarationExtension_insert___rarg(lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Term_elabLetRec___spec__1___boxed(lean_object*, lean_object*, lean_object*);
|
||||
uint8_t lean_nat_dec_eq(lean_object*, lean_object*);
|
||||
static lean_object* l_Lean_Elab_checkNotAlreadyDeclared___at___private_Lean_Elab_LetRec_0__Lean_Elab_Term_mkLetRecDeclView___spec__4___closed__4;
|
||||
lean_object* l_Lean_Meta_withLocalDecl___at___private_Lean_Elab_Term_0__Lean_Elab_Term_elabImplicitLambda_loop___spec__1___rarg(lean_object*, uint8_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
|
|
@ -190,6 +194,7 @@ static lean_object* l_Lean_Elab_elabAttr___at___private_Lean_Elab_LetRec_0__Lean
|
|||
lean_object* l_Lean_Syntax_getArgs(lean_object*);
|
||||
lean_object* l_Lean_Name_append(lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Syntax_getKind(lean_object*);
|
||||
lean_object* l_Lean_Elab_Term_addTermInfo(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, uint8_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Array_mapMUnsafe_map___at___private_Lean_Elab_LetRec_0__Lean_Elab_Term_mkLetRecDeclView___spec__22(size_t, size_t, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
static lean_object* l___regBuiltin_Lean_Elab_Term_elabLetRec___closed__7;
|
||||
lean_object* l_Lean_Elab_checkNotAlreadyDeclared___at___private_Lean_Elab_LetRec_0__Lean_Elab_Term_mkLetRecDeclView___spec__4___lambda__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
|
|
@ -223,13 +228,13 @@ lean_object* l_Array_forInUnsafe_loop___at___private_Lean_Elab_LetRec_0__Lean_El
|
|||
extern lean_object* l_Lean_Elab_unsupportedSyntaxExceptionId;
|
||||
lean_object* l_Lean_Elab_toAttributeKind___boxed(lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Syntax_getArg(lean_object*, lean_object*);
|
||||
lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Term_elabLetRec___spec__2(size_t, size_t, lean_object*);
|
||||
lean_object* l_Array_mapMUnsafe_map___at___private_Lean_Elab_LetRec_0__Lean_Elab_Term_mkLetRecDeclView___spec__22___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
static lean_object* l_Lean_Elab_elabAttr___at___private_Lean_Elab_LetRec_0__Lean_Elab_Term_mkLetRecDeclView___spec__15___closed__3;
|
||||
lean_object* l_Lean_FileMap_leanPosToLspPos(lean_object*, lean_object*);
|
||||
lean_object* l_unsafeCast(lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Elab_liftMacroM___at_Lean_Elab_Term_elabLetDeclCore___spec__1(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_List_foldr___at___private_Lean_Elab_LetRec_0__Lean_Elab_Term_registerLetRecsToLift___spec__1___boxed(lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Term_elabLetRec___spec__1(size_t, size_t, lean_object*);
|
||||
lean_object* l_Lean_Elab_throwUnsupportedSyntax___at___private_Lean_Elab_LetRec_0__Lean_Elab_Term_mkLetRecDeclView___spec__19(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_throwError___at___private_Lean_Elab_LetRec_0__Lean_Elab_Term_mkLetRecDeclView___spec__3(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Array_mapMUnsafe_map___at___private_Lean_Elab_LetRec_0__Lean_Elab_Term_elabLetRecDeclValues___spec__1___lambda__2(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
|
|
@ -241,6 +246,7 @@ lean_object* l_Lean_Elab_elabAttr___at___private_Lean_Elab_LetRec_0__Lean_Elab_T
|
|||
lean_object* l___private_Lean_Elab_LetRec_0__Lean_Elab_Term_elabLetRecDeclValues(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_throwErrorAt___at___private_Lean_Elab_LetRec_0__Lean_Elab_Term_mkLetRecDeclView___spec__2(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Elab_throwUnsupportedSyntax___at___private_Lean_Elab_LetRec_0__Lean_Elab_Term_mkLetRecDeclView___spec__10(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Elab_Term_elabLetRec_match__1___rarg(lean_object*, lean_object*, lean_object*);
|
||||
static lean_object* l_Lean_Elab_checkNotAlreadyDeclared___at___private_Lean_Elab_LetRec_0__Lean_Elab_Term_mkLetRecDeclView___spec__4___lambda__2___closed__1;
|
||||
lean_object* l_Lean_Elab_throwUnsupportedSyntax___at___private_Lean_Elab_LetRec_0__Lean_Elab_Term_mkLetRecDeclView___spec__10___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
lean_object* l_Lean_Elab_liftMacroM___at___private_Lean_Elab_LetRec_0__Lean_Elab_Term_mkLetRecDeclView___spec__16___lambda__4___boxed(lean_object*, lean_object*, lean_object*, lean_object*, lean_object*, lean_object*);
|
||||
|
|
@ -2700,7 +2706,6 @@ lean_inc(x_33);
|
|||
lean_dec(x_32);
|
||||
lean_inc(x_26);
|
||||
x_34 = l_Lean_Elab_addAuxDeclarationRanges___at___private_Lean_Elab_LetRec_0__Lean_Elab_Term_mkLetRecDeclView___spec__7(x_26, x_14, x_20, x_4, x_5, x_6, x_7, x_8, x_9, x_33);
|
||||
lean_dec(x_20);
|
||||
x_35 = lean_ctor_get(x_34, 1);
|
||||
lean_inc(x_35);
|
||||
lean_dec(x_34);
|
||||
|
|
@ -2709,8 +2714,9 @@ x_37 = l_Lean_Syntax_getArg(x_14, x_36);
|
|||
x_38 = l_Lean_Syntax_getArgs(x_37);
|
||||
lean_dec(x_37);
|
||||
x_39 = l_Lean_Syntax_getArg(x_14, x_11);
|
||||
x_40 = l_Lean_Elab_Term_expandOptType(x_14, x_39);
|
||||
x_40 = l_Lean_Elab_Term_expandOptType(x_20, x_39);
|
||||
lean_dec(x_39);
|
||||
lean_dec(x_20);
|
||||
x_41 = lean_alloc_closure((void*)(l_Array_mapMUnsafe_map___at___private_Lean_Elab_LetRec_0__Lean_Elab_Term_mkLetRecDeclView___spec__22___lambda__1), 9, 1);
|
||||
lean_closure_set(x_41, 0, x_40);
|
||||
lean_inc(x_9);
|
||||
|
|
@ -4454,7 +4460,244 @@ lean_dec(x_1);
|
|||
return x_11;
|
||||
}
|
||||
}
|
||||
lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Term_elabLetRec___spec__1(size_t x_1, size_t x_2, lean_object* x_3) {
|
||||
lean_object* l_Lean_Elab_Term_elabLetRec_match__1___rarg(lean_object* x_1, lean_object* x_2, lean_object* x_3) {
|
||||
_start:
|
||||
{
|
||||
if (lean_obj_tag(x_1) == 0)
|
||||
{
|
||||
lean_object* x_4; lean_object* x_5;
|
||||
lean_dec(x_3);
|
||||
x_4 = lean_box(0);
|
||||
x_5 = lean_apply_1(x_2, x_4);
|
||||
return x_5;
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_6; lean_object* x_7; lean_object* x_8; lean_object* x_9;
|
||||
lean_dec(x_2);
|
||||
x_6 = lean_ctor_get(x_1, 0);
|
||||
lean_inc(x_6);
|
||||
lean_dec(x_1);
|
||||
x_7 = lean_ctor_get(x_6, 0);
|
||||
lean_inc(x_7);
|
||||
x_8 = lean_ctor_get(x_6, 1);
|
||||
lean_inc(x_8);
|
||||
lean_dec(x_6);
|
||||
x_9 = lean_apply_2(x_3, x_7, x_8);
|
||||
return x_9;
|
||||
}
|
||||
}
|
||||
}
|
||||
lean_object* l_Lean_Elab_Term_elabLetRec_match__1(lean_object* x_1) {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_2;
|
||||
x_2 = lean_alloc_closure((void*)(l_Lean_Elab_Term_elabLetRec_match__1___rarg), 3, 0);
|
||||
return x_2;
|
||||
}
|
||||
}
|
||||
lean_object* l_Array_forInUnsafe_loop___at_Lean_Elab_Term_elabLetRec___spec__1(lean_object* x_1, size_t x_2, size_t x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10, lean_object* x_11) {
|
||||
_start:
|
||||
{
|
||||
uint8_t x_12;
|
||||
x_12 = x_3 < x_2;
|
||||
if (x_12 == 0)
|
||||
{
|
||||
lean_object* x_13;
|
||||
lean_dec(x_10);
|
||||
lean_dec(x_9);
|
||||
lean_dec(x_8);
|
||||
lean_dec(x_7);
|
||||
lean_dec(x_6);
|
||||
lean_dec(x_5);
|
||||
x_13 = lean_alloc_ctor(0, 2, 0);
|
||||
lean_ctor_set(x_13, 0, x_4);
|
||||
lean_ctor_set(x_13, 1, x_11);
|
||||
return x_13;
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_14; lean_object* x_15; lean_object* x_16; lean_object* x_17; uint8_t x_18;
|
||||
x_14 = lean_array_uget(x_1, x_3);
|
||||
x_15 = lean_ctor_get(x_4, 0);
|
||||
lean_inc(x_15);
|
||||
x_16 = lean_ctor_get(x_4, 1);
|
||||
lean_inc(x_16);
|
||||
x_17 = lean_ctor_get(x_4, 2);
|
||||
lean_inc(x_17);
|
||||
x_18 = lean_nat_dec_lt(x_16, x_17);
|
||||
if (x_18 == 0)
|
||||
{
|
||||
lean_object* x_19;
|
||||
lean_dec(x_17);
|
||||
lean_dec(x_16);
|
||||
lean_dec(x_15);
|
||||
lean_dec(x_14);
|
||||
lean_dec(x_10);
|
||||
lean_dec(x_9);
|
||||
lean_dec(x_8);
|
||||
lean_dec(x_7);
|
||||
lean_dec(x_6);
|
||||
lean_dec(x_5);
|
||||
x_19 = lean_alloc_ctor(0, 2, 0);
|
||||
lean_ctor_set(x_19, 0, x_4);
|
||||
lean_ctor_set(x_19, 1, x_11);
|
||||
return x_19;
|
||||
}
|
||||
else
|
||||
{
|
||||
uint8_t x_20;
|
||||
x_20 = !lean_is_exclusive(x_4);
|
||||
if (x_20 == 0)
|
||||
{
|
||||
lean_object* x_21; lean_object* x_22; lean_object* x_23; lean_object* x_24; lean_object* x_25; lean_object* x_26; lean_object* x_27; lean_object* x_28; lean_object* x_29; lean_object* x_30; lean_object* x_31; uint8_t x_32; lean_object* x_33;
|
||||
x_21 = lean_ctor_get(x_4, 2);
|
||||
lean_dec(x_21);
|
||||
x_22 = lean_ctor_get(x_4, 1);
|
||||
lean_dec(x_22);
|
||||
x_23 = lean_ctor_get(x_4, 0);
|
||||
lean_dec(x_23);
|
||||
x_24 = lean_array_fget(x_15, x_16);
|
||||
x_25 = lean_unsigned_to_nat(1u);
|
||||
x_26 = lean_nat_add(x_16, x_25);
|
||||
lean_dec(x_16);
|
||||
lean_ctor_set(x_4, 1, x_26);
|
||||
x_27 = lean_ctor_get(x_14, 0);
|
||||
lean_inc(x_27);
|
||||
lean_dec(x_14);
|
||||
x_28 = lean_unsigned_to_nat(0u);
|
||||
x_29 = l_Lean_Syntax_getArg(x_27, x_28);
|
||||
lean_dec(x_27);
|
||||
x_30 = lean_box(0);
|
||||
x_31 = lean_box(0);
|
||||
x_32 = 1;
|
||||
lean_inc(x_10);
|
||||
lean_inc(x_9);
|
||||
lean_inc(x_8);
|
||||
lean_inc(x_7);
|
||||
lean_inc(x_6);
|
||||
lean_inc(x_5);
|
||||
x_33 = l_Lean_Elab_Term_addTermInfo(x_29, x_24, x_30, x_30, x_31, x_32, x_5, x_6, x_7, x_8, x_9, x_10, x_11);
|
||||
if (lean_obj_tag(x_33) == 0)
|
||||
{
|
||||
lean_object* x_34; size_t x_35; size_t x_36;
|
||||
x_34 = lean_ctor_get(x_33, 1);
|
||||
lean_inc(x_34);
|
||||
lean_dec(x_33);
|
||||
x_35 = 1;
|
||||
x_36 = x_3 + x_35;
|
||||
x_3 = x_36;
|
||||
x_11 = x_34;
|
||||
goto _start;
|
||||
}
|
||||
else
|
||||
{
|
||||
uint8_t x_38;
|
||||
lean_dec(x_4);
|
||||
lean_dec(x_10);
|
||||
lean_dec(x_9);
|
||||
lean_dec(x_8);
|
||||
lean_dec(x_7);
|
||||
lean_dec(x_6);
|
||||
lean_dec(x_5);
|
||||
x_38 = !lean_is_exclusive(x_33);
|
||||
if (x_38 == 0)
|
||||
{
|
||||
return x_33;
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_39; lean_object* x_40; lean_object* x_41;
|
||||
x_39 = lean_ctor_get(x_33, 0);
|
||||
x_40 = lean_ctor_get(x_33, 1);
|
||||
lean_inc(x_40);
|
||||
lean_inc(x_39);
|
||||
lean_dec(x_33);
|
||||
x_41 = lean_alloc_ctor(1, 2, 0);
|
||||
lean_ctor_set(x_41, 0, x_39);
|
||||
lean_ctor_set(x_41, 1, x_40);
|
||||
return x_41;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_42; lean_object* x_43; lean_object* x_44; lean_object* x_45; lean_object* x_46; lean_object* x_47; lean_object* x_48; lean_object* x_49; lean_object* x_50; uint8_t x_51; lean_object* x_52;
|
||||
lean_dec(x_4);
|
||||
x_42 = lean_array_fget(x_15, x_16);
|
||||
x_43 = lean_unsigned_to_nat(1u);
|
||||
x_44 = lean_nat_add(x_16, x_43);
|
||||
lean_dec(x_16);
|
||||
x_45 = lean_alloc_ctor(0, 3, 0);
|
||||
lean_ctor_set(x_45, 0, x_15);
|
||||
lean_ctor_set(x_45, 1, x_44);
|
||||
lean_ctor_set(x_45, 2, x_17);
|
||||
x_46 = lean_ctor_get(x_14, 0);
|
||||
lean_inc(x_46);
|
||||
lean_dec(x_14);
|
||||
x_47 = lean_unsigned_to_nat(0u);
|
||||
x_48 = l_Lean_Syntax_getArg(x_46, x_47);
|
||||
lean_dec(x_46);
|
||||
x_49 = lean_box(0);
|
||||
x_50 = lean_box(0);
|
||||
x_51 = 1;
|
||||
lean_inc(x_10);
|
||||
lean_inc(x_9);
|
||||
lean_inc(x_8);
|
||||
lean_inc(x_7);
|
||||
lean_inc(x_6);
|
||||
lean_inc(x_5);
|
||||
x_52 = l_Lean_Elab_Term_addTermInfo(x_48, x_42, x_49, x_49, x_50, x_51, x_5, x_6, x_7, x_8, x_9, x_10, x_11);
|
||||
if (lean_obj_tag(x_52) == 0)
|
||||
{
|
||||
lean_object* x_53; size_t x_54; size_t x_55;
|
||||
x_53 = lean_ctor_get(x_52, 1);
|
||||
lean_inc(x_53);
|
||||
lean_dec(x_52);
|
||||
x_54 = 1;
|
||||
x_55 = x_3 + x_54;
|
||||
x_3 = x_55;
|
||||
x_4 = x_45;
|
||||
x_11 = x_53;
|
||||
goto _start;
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_57; lean_object* x_58; lean_object* x_59; lean_object* x_60;
|
||||
lean_dec(x_45);
|
||||
lean_dec(x_10);
|
||||
lean_dec(x_9);
|
||||
lean_dec(x_8);
|
||||
lean_dec(x_7);
|
||||
lean_dec(x_6);
|
||||
lean_dec(x_5);
|
||||
x_57 = lean_ctor_get(x_52, 0);
|
||||
lean_inc(x_57);
|
||||
x_58 = lean_ctor_get(x_52, 1);
|
||||
lean_inc(x_58);
|
||||
if (lean_is_exclusive(x_52)) {
|
||||
lean_ctor_release(x_52, 0);
|
||||
lean_ctor_release(x_52, 1);
|
||||
x_59 = x_52;
|
||||
} else {
|
||||
lean_dec_ref(x_52);
|
||||
x_59 = lean_box(0);
|
||||
}
|
||||
if (lean_is_scalar(x_59)) {
|
||||
x_60 = lean_alloc_ctor(1, 2, 0);
|
||||
} else {
|
||||
x_60 = x_59;
|
||||
}
|
||||
lean_ctor_set(x_60, 0, x_57);
|
||||
lean_ctor_set(x_60, 1, x_58);
|
||||
return x_60;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Term_elabLetRec___spec__2(size_t x_1, size_t x_2, lean_object* x_3) {
|
||||
_start:
|
||||
{
|
||||
uint8_t x_4;
|
||||
|
|
@ -4488,153 +4731,173 @@ goto _start;
|
|||
lean_object* l_Lean_Elab_Term_elabLetRec___lambda__1(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10, lean_object* x_11) {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_12;
|
||||
lean_object* x_12; lean_object* x_13; lean_object* x_14; lean_object* x_15; size_t x_16; size_t x_17; lean_object* x_18;
|
||||
x_12 = lean_array_get_size(x_4);
|
||||
x_13 = lean_unsigned_to_nat(0u);
|
||||
lean_inc(x_4);
|
||||
x_14 = l_Array_toSubarray___rarg(x_4, x_13, x_12);
|
||||
x_15 = lean_array_get_size(x_1);
|
||||
x_16 = lean_usize_of_nat(x_15);
|
||||
lean_dec(x_15);
|
||||
x_17 = 0;
|
||||
lean_inc(x_10);
|
||||
lean_inc(x_9);
|
||||
lean_inc(x_8);
|
||||
lean_inc(x_7);
|
||||
lean_inc(x_6);
|
||||
lean_inc(x_5);
|
||||
lean_inc(x_1);
|
||||
x_12 = l___private_Lean_Elab_LetRec_0__Lean_Elab_Term_elabLetRecDeclValues(x_1, x_5, x_6, x_7, x_8, x_9, x_10, x_11);
|
||||
if (lean_obj_tag(x_12) == 0)
|
||||
{
|
||||
lean_object* x_13; lean_object* x_14; lean_object* x_15; lean_object* x_16; uint8_t x_17; lean_object* x_18;
|
||||
x_13 = lean_ctor_get(x_12, 0);
|
||||
lean_inc(x_13);
|
||||
x_14 = lean_ctor_get(x_12, 1);
|
||||
lean_inc(x_14);
|
||||
lean_dec(x_12);
|
||||
x_15 = lean_ctor_get(x_1, 1);
|
||||
lean_inc(x_15);
|
||||
lean_dec(x_1);
|
||||
x_16 = lean_box(0);
|
||||
x_17 = 1;
|
||||
lean_inc(x_10);
|
||||
lean_inc(x_9);
|
||||
lean_inc(x_8);
|
||||
lean_inc(x_7);
|
||||
lean_inc(x_6);
|
||||
lean_inc(x_5);
|
||||
x_18 = l_Lean_Elab_Term_elabTermEnsuringType(x_15, x_2, x_17, x_17, x_16, x_5, x_6, x_7, x_8, x_9, x_10, x_14);
|
||||
x_18 = l_Array_forInUnsafe_loop___at_Lean_Elab_Term_elabLetRec___spec__1(x_1, x_16, x_17, x_14, x_5, x_6, x_7, x_8, x_9, x_10, x_11);
|
||||
if (lean_obj_tag(x_18) == 0)
|
||||
{
|
||||
lean_object* x_19; lean_object* x_20; lean_object* x_21;
|
||||
x_19 = lean_ctor_get(x_18, 0);
|
||||
lean_object* x_19; lean_object* x_20;
|
||||
x_19 = lean_ctor_get(x_18, 1);
|
||||
lean_inc(x_19);
|
||||
x_20 = lean_ctor_get(x_18, 1);
|
||||
lean_inc(x_20);
|
||||
lean_dec(x_18);
|
||||
lean_inc(x_10);
|
||||
lean_inc(x_9);
|
||||
lean_inc(x_8);
|
||||
lean_inc(x_7);
|
||||
lean_inc(x_6);
|
||||
lean_inc(x_5);
|
||||
lean_inc(x_2);
|
||||
x_20 = l___private_Lean_Elab_LetRec_0__Lean_Elab_Term_elabLetRecDeclValues(x_2, x_5, x_6, x_7, x_8, x_9, x_10, x_19);
|
||||
if (lean_obj_tag(x_20) == 0)
|
||||
{
|
||||
lean_object* x_21; lean_object* x_22; lean_object* x_23; lean_object* x_24; uint8_t x_25; lean_object* x_26;
|
||||
x_21 = lean_ctor_get(x_20, 0);
|
||||
lean_inc(x_21);
|
||||
x_22 = lean_ctor_get(x_20, 1);
|
||||
lean_inc(x_22);
|
||||
lean_dec(x_20);
|
||||
x_23 = lean_ctor_get(x_2, 1);
|
||||
lean_inc(x_23);
|
||||
lean_dec(x_2);
|
||||
x_24 = lean_box(0);
|
||||
x_25 = 1;
|
||||
lean_inc(x_10);
|
||||
lean_inc(x_9);
|
||||
lean_inc(x_8);
|
||||
lean_inc(x_7);
|
||||
lean_inc(x_6);
|
||||
lean_inc(x_5);
|
||||
x_26 = l_Lean_Elab_Term_elabTermEnsuringType(x_23, x_3, x_25, x_25, x_24, x_5, x_6, x_7, x_8, x_9, x_10, x_22);
|
||||
if (lean_obj_tag(x_26) == 0)
|
||||
{
|
||||
lean_object* x_27; lean_object* x_28; lean_object* x_29;
|
||||
x_27 = lean_ctor_get(x_26, 0);
|
||||
lean_inc(x_27);
|
||||
x_28 = lean_ctor_get(x_26, 1);
|
||||
lean_inc(x_28);
|
||||
lean_dec(x_26);
|
||||
lean_inc(x_9);
|
||||
lean_inc(x_7);
|
||||
x_21 = l___private_Lean_Elab_LetRec_0__Lean_Elab_Term_registerLetRecsToLift(x_3, x_4, x_13, x_5, x_6, x_7, x_8, x_9, x_10, x_20);
|
||||
x_29 = l___private_Lean_Elab_LetRec_0__Lean_Elab_Term_registerLetRecsToLift(x_1, x_4, x_21, x_5, x_6, x_7, x_8, x_9, x_10, x_28);
|
||||
lean_dec(x_6);
|
||||
lean_dec(x_13);
|
||||
if (lean_obj_tag(x_21) == 0)
|
||||
{
|
||||
lean_object* x_22; lean_object* x_23; size_t x_24; size_t x_25; lean_object* x_26; lean_object* x_27; lean_object* x_28; uint8_t x_29; lean_object* x_30;
|
||||
x_22 = lean_ctor_get(x_21, 1);
|
||||
lean_inc(x_22);
|
||||
lean_dec(x_21);
|
||||
x_23 = lean_array_get_size(x_3);
|
||||
x_24 = lean_usize_of_nat(x_23);
|
||||
lean_dec(x_23);
|
||||
x_25 = 0;
|
||||
x_26 = x_3;
|
||||
x_27 = l_Array_mapMUnsafe_map___at_Lean_Elab_Term_elabLetRec___spec__1(x_24, x_25, x_26);
|
||||
x_28 = x_27;
|
||||
x_29 = 0;
|
||||
x_30 = l_Lean_Meta_mkLambdaFVars(x_4, x_19, x_29, x_17, x_7, x_8, x_9, x_10, x_22);
|
||||
if (lean_obj_tag(x_29) == 0)
|
||||
{
|
||||
lean_object* x_30; lean_object* x_31; size_t x_32; lean_object* x_33; lean_object* x_34; lean_object* x_35; uint8_t x_36; lean_object* x_37;
|
||||
x_30 = lean_ctor_get(x_29, 1);
|
||||
lean_inc(x_30);
|
||||
lean_dec(x_29);
|
||||
x_31 = lean_array_get_size(x_1);
|
||||
x_32 = lean_usize_of_nat(x_31);
|
||||
lean_dec(x_31);
|
||||
x_33 = x_1;
|
||||
x_34 = l_Array_mapMUnsafe_map___at_Lean_Elab_Term_elabLetRec___spec__2(x_32, x_17, x_33);
|
||||
x_35 = x_34;
|
||||
x_36 = 0;
|
||||
x_37 = l_Lean_Meta_mkLambdaFVars(x_4, x_27, x_36, x_25, x_7, x_8, x_9, x_10, x_30);
|
||||
lean_dec(x_10);
|
||||
lean_dec(x_9);
|
||||
lean_dec(x_8);
|
||||
if (lean_obj_tag(x_30) == 0)
|
||||
{
|
||||
uint8_t x_31;
|
||||
x_31 = !lean_is_exclusive(x_30);
|
||||
if (x_31 == 0)
|
||||
{
|
||||
lean_object* x_32; lean_object* x_33;
|
||||
x_32 = lean_ctor_get(x_30, 0);
|
||||
x_33 = l_Lean_mkAppN(x_32, x_28);
|
||||
lean_dec(x_28);
|
||||
lean_ctor_set(x_30, 0, x_33);
|
||||
return x_30;
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_34; lean_object* x_35; lean_object* x_36; lean_object* x_37;
|
||||
x_34 = lean_ctor_get(x_30, 0);
|
||||
x_35 = lean_ctor_get(x_30, 1);
|
||||
lean_inc(x_35);
|
||||
lean_inc(x_34);
|
||||
lean_dec(x_30);
|
||||
x_36 = l_Lean_mkAppN(x_34, x_28);
|
||||
lean_dec(x_28);
|
||||
x_37 = lean_alloc_ctor(0, 2, 0);
|
||||
lean_ctor_set(x_37, 0, x_36);
|
||||
lean_ctor_set(x_37, 1, x_35);
|
||||
return x_37;
|
||||
}
|
||||
}
|
||||
else
|
||||
if (lean_obj_tag(x_37) == 0)
|
||||
{
|
||||
uint8_t x_38;
|
||||
lean_dec(x_28);
|
||||
x_38 = !lean_is_exclusive(x_30);
|
||||
x_38 = !lean_is_exclusive(x_37);
|
||||
if (x_38 == 0)
|
||||
{
|
||||
return x_30;
|
||||
lean_object* x_39; lean_object* x_40;
|
||||
x_39 = lean_ctor_get(x_37, 0);
|
||||
x_40 = l_Lean_mkAppN(x_39, x_35);
|
||||
lean_dec(x_35);
|
||||
lean_ctor_set(x_37, 0, x_40);
|
||||
return x_37;
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_39; lean_object* x_40; lean_object* x_41;
|
||||
x_39 = lean_ctor_get(x_30, 0);
|
||||
x_40 = lean_ctor_get(x_30, 1);
|
||||
lean_inc(x_40);
|
||||
lean_inc(x_39);
|
||||
lean_dec(x_30);
|
||||
x_41 = lean_alloc_ctor(1, 2, 0);
|
||||
lean_ctor_set(x_41, 0, x_39);
|
||||
lean_ctor_set(x_41, 1, x_40);
|
||||
return x_41;
|
||||
lean_object* x_41; lean_object* x_42; lean_object* x_43; lean_object* x_44;
|
||||
x_41 = lean_ctor_get(x_37, 0);
|
||||
x_42 = lean_ctor_get(x_37, 1);
|
||||
lean_inc(x_42);
|
||||
lean_inc(x_41);
|
||||
lean_dec(x_37);
|
||||
x_43 = l_Lean_mkAppN(x_41, x_35);
|
||||
lean_dec(x_35);
|
||||
x_44 = lean_alloc_ctor(0, 2, 0);
|
||||
lean_ctor_set(x_44, 0, x_43);
|
||||
lean_ctor_set(x_44, 1, x_42);
|
||||
return x_44;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
uint8_t x_45;
|
||||
lean_dec(x_35);
|
||||
x_45 = !lean_is_exclusive(x_37);
|
||||
if (x_45 == 0)
|
||||
{
|
||||
return x_37;
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_46; lean_object* x_47; lean_object* x_48;
|
||||
x_46 = lean_ctor_get(x_37, 0);
|
||||
x_47 = lean_ctor_get(x_37, 1);
|
||||
lean_inc(x_47);
|
||||
lean_inc(x_46);
|
||||
lean_dec(x_37);
|
||||
x_48 = lean_alloc_ctor(1, 2, 0);
|
||||
lean_ctor_set(x_48, 0, x_46);
|
||||
lean_ctor_set(x_48, 1, x_47);
|
||||
return x_48;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
uint8_t x_42;
|
||||
lean_dec(x_19);
|
||||
uint8_t x_49;
|
||||
lean_dec(x_27);
|
||||
lean_dec(x_10);
|
||||
lean_dec(x_9);
|
||||
lean_dec(x_8);
|
||||
lean_dec(x_7);
|
||||
lean_dec(x_4);
|
||||
lean_dec(x_3);
|
||||
x_42 = !lean_is_exclusive(x_21);
|
||||
if (x_42 == 0)
|
||||
lean_dec(x_1);
|
||||
x_49 = !lean_is_exclusive(x_29);
|
||||
if (x_49 == 0)
|
||||
{
|
||||
return x_21;
|
||||
return x_29;
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_43; lean_object* x_44; lean_object* x_45;
|
||||
x_43 = lean_ctor_get(x_21, 0);
|
||||
x_44 = lean_ctor_get(x_21, 1);
|
||||
lean_inc(x_44);
|
||||
lean_inc(x_43);
|
||||
lean_object* x_50; lean_object* x_51; lean_object* x_52;
|
||||
x_50 = lean_ctor_get(x_29, 0);
|
||||
x_51 = lean_ctor_get(x_29, 1);
|
||||
lean_inc(x_51);
|
||||
lean_inc(x_50);
|
||||
lean_dec(x_29);
|
||||
x_52 = lean_alloc_ctor(1, 2, 0);
|
||||
lean_ctor_set(x_52, 0, x_50);
|
||||
lean_ctor_set(x_52, 1, x_51);
|
||||
return x_52;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
uint8_t x_53;
|
||||
lean_dec(x_21);
|
||||
x_45 = lean_alloc_ctor(1, 2, 0);
|
||||
lean_ctor_set(x_45, 0, x_43);
|
||||
lean_ctor_set(x_45, 1, x_44);
|
||||
return x_45;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
uint8_t x_46;
|
||||
lean_dec(x_13);
|
||||
lean_dec(x_10);
|
||||
lean_dec(x_9);
|
||||
lean_dec(x_8);
|
||||
|
|
@ -4642,30 +4905,30 @@ lean_dec(x_7);
|
|||
lean_dec(x_6);
|
||||
lean_dec(x_5);
|
||||
lean_dec(x_4);
|
||||
lean_dec(x_3);
|
||||
x_46 = !lean_is_exclusive(x_18);
|
||||
if (x_46 == 0)
|
||||
lean_dec(x_1);
|
||||
x_53 = !lean_is_exclusive(x_26);
|
||||
if (x_53 == 0)
|
||||
{
|
||||
return x_18;
|
||||
return x_26;
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_47; lean_object* x_48; lean_object* x_49;
|
||||
x_47 = lean_ctor_get(x_18, 0);
|
||||
x_48 = lean_ctor_get(x_18, 1);
|
||||
lean_inc(x_48);
|
||||
lean_inc(x_47);
|
||||
lean_dec(x_18);
|
||||
x_49 = lean_alloc_ctor(1, 2, 0);
|
||||
lean_ctor_set(x_49, 0, x_47);
|
||||
lean_ctor_set(x_49, 1, x_48);
|
||||
return x_49;
|
||||
lean_object* x_54; lean_object* x_55; lean_object* x_56;
|
||||
x_54 = lean_ctor_get(x_26, 0);
|
||||
x_55 = lean_ctor_get(x_26, 1);
|
||||
lean_inc(x_55);
|
||||
lean_inc(x_54);
|
||||
lean_dec(x_26);
|
||||
x_56 = lean_alloc_ctor(1, 2, 0);
|
||||
lean_ctor_set(x_56, 0, x_54);
|
||||
lean_ctor_set(x_56, 1, x_55);
|
||||
return x_56;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
uint8_t x_50;
|
||||
uint8_t x_57;
|
||||
lean_dec(x_10);
|
||||
lean_dec(x_9);
|
||||
lean_dec(x_8);
|
||||
|
|
@ -4676,23 +4939,56 @@ lean_dec(x_4);
|
|||
lean_dec(x_3);
|
||||
lean_dec(x_2);
|
||||
lean_dec(x_1);
|
||||
x_50 = !lean_is_exclusive(x_12);
|
||||
if (x_50 == 0)
|
||||
x_57 = !lean_is_exclusive(x_20);
|
||||
if (x_57 == 0)
|
||||
{
|
||||
return x_12;
|
||||
return x_20;
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_51; lean_object* x_52; lean_object* x_53;
|
||||
x_51 = lean_ctor_get(x_12, 0);
|
||||
x_52 = lean_ctor_get(x_12, 1);
|
||||
lean_inc(x_52);
|
||||
lean_inc(x_51);
|
||||
lean_dec(x_12);
|
||||
x_53 = lean_alloc_ctor(1, 2, 0);
|
||||
lean_ctor_set(x_53, 0, x_51);
|
||||
lean_ctor_set(x_53, 1, x_52);
|
||||
return x_53;
|
||||
lean_object* x_58; lean_object* x_59; lean_object* x_60;
|
||||
x_58 = lean_ctor_get(x_20, 0);
|
||||
x_59 = lean_ctor_get(x_20, 1);
|
||||
lean_inc(x_59);
|
||||
lean_inc(x_58);
|
||||
lean_dec(x_20);
|
||||
x_60 = lean_alloc_ctor(1, 2, 0);
|
||||
lean_ctor_set(x_60, 0, x_58);
|
||||
lean_ctor_set(x_60, 1, x_59);
|
||||
return x_60;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
uint8_t x_61;
|
||||
lean_dec(x_10);
|
||||
lean_dec(x_9);
|
||||
lean_dec(x_8);
|
||||
lean_dec(x_7);
|
||||
lean_dec(x_6);
|
||||
lean_dec(x_5);
|
||||
lean_dec(x_4);
|
||||
lean_dec(x_3);
|
||||
lean_dec(x_2);
|
||||
lean_dec(x_1);
|
||||
x_61 = !lean_is_exclusive(x_18);
|
||||
if (x_61 == 0)
|
||||
{
|
||||
return x_18;
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_62; lean_object* x_63; lean_object* x_64;
|
||||
x_62 = lean_ctor_get(x_18, 0);
|
||||
x_63 = lean_ctor_get(x_18, 1);
|
||||
lean_inc(x_63);
|
||||
lean_inc(x_62);
|
||||
lean_dec(x_18);
|
||||
x_64 = lean_alloc_ctor(1, 2, 0);
|
||||
lean_ctor_set(x_64, 0, x_62);
|
||||
lean_ctor_set(x_64, 1, x_63);
|
||||
return x_64;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -4720,9 +5016,9 @@ x_13 = lean_ctor_get(x_11, 0);
|
|||
lean_inc(x_13);
|
||||
lean_inc(x_13);
|
||||
x_14 = lean_alloc_closure((void*)(l_Lean_Elab_Term_elabLetRec___lambda__1), 11, 3);
|
||||
lean_closure_set(x_14, 0, x_11);
|
||||
lean_closure_set(x_14, 1, x_2);
|
||||
lean_closure_set(x_14, 2, x_13);
|
||||
lean_closure_set(x_14, 0, x_13);
|
||||
lean_closure_set(x_14, 1, x_11);
|
||||
lean_closure_set(x_14, 2, x_2);
|
||||
x_15 = l___private_Lean_Elab_LetRec_0__Lean_Elab_Term_withAuxLocalDecls___rarg(x_13, x_14, x_3, x_4, x_5, x_6, x_7, x_8, x_12);
|
||||
return x_15;
|
||||
}
|
||||
|
|
@ -4757,7 +5053,20 @@ return x_19;
|
|||
}
|
||||
}
|
||||
}
|
||||
lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Term_elabLetRec___spec__1___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) {
|
||||
lean_object* l_Array_forInUnsafe_loop___at_Lean_Elab_Term_elabLetRec___spec__1___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3, lean_object* x_4, lean_object* x_5, lean_object* x_6, lean_object* x_7, lean_object* x_8, lean_object* x_9, lean_object* x_10, lean_object* x_11) {
|
||||
_start:
|
||||
{
|
||||
size_t x_12; size_t x_13; lean_object* x_14;
|
||||
x_12 = lean_unbox_usize(x_2);
|
||||
lean_dec(x_2);
|
||||
x_13 = lean_unbox_usize(x_3);
|
||||
lean_dec(x_3);
|
||||
x_14 = l_Array_forInUnsafe_loop___at_Lean_Elab_Term_elabLetRec___spec__1(x_1, x_12, x_13, x_4, x_5, x_6, x_7, x_8, x_9, x_10, x_11);
|
||||
lean_dec(x_1);
|
||||
return x_14;
|
||||
}
|
||||
}
|
||||
lean_object* l_Array_mapMUnsafe_map___at_Lean_Elab_Term_elabLetRec___spec__2___boxed(lean_object* x_1, lean_object* x_2, lean_object* x_3) {
|
||||
_start:
|
||||
{
|
||||
size_t x_4; size_t x_5; lean_object* x_6;
|
||||
|
|
@ -4765,7 +5074,7 @@ x_4 = lean_unbox_usize(x_1);
|
|||
lean_dec(x_1);
|
||||
x_5 = lean_unbox_usize(x_2);
|
||||
lean_dec(x_2);
|
||||
x_6 = l_Array_mapMUnsafe_map___at_Lean_Elab_Term_elabLetRec___spec__1(x_4, x_5, x_3);
|
||||
x_6 = l_Array_mapMUnsafe_map___at_Lean_Elab_Term_elabLetRec___spec__2(x_4, x_5, x_3);
|
||||
return x_6;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
3990
stage0/stdlib/Lean/Elab/Mixfix.c
generated
3990
stage0/stdlib/Lean/Elab/Mixfix.c
generated
File diff suppressed because it is too large
Load diff
94
stage0/stdlib/Lean/Elab/PatternVar.c
generated
94
stage0/stdlib/Lean/Elab/PatternVar.c
generated
|
|
@ -3753,7 +3753,7 @@ lean_inc(x_12);
|
|||
x_25 = l_Lean_mkConstWithLevelParams___at___private_Lean_Elab_PatternVar_0__Lean_Elab_Term_CollectPatternVars_doubleQuotedNameToPattern___spec__5(x_12, x_4, x_5, x_6, x_7, x_8, x_9, x_24);
|
||||
if (lean_obj_tag(x_25) == 0)
|
||||
{
|
||||
lean_object* x_26; lean_object* x_27; lean_object* x_28; lean_object* x_29; lean_object* x_30; lean_object* x_31; lean_object* x_32; lean_object* x_33; uint8_t x_34;
|
||||
lean_object* x_26; lean_object* x_27; lean_object* x_28; lean_object* x_29; lean_object* x_30; uint8_t x_31; lean_object* x_32; lean_object* x_33; lean_object* x_34; uint8_t x_35;
|
||||
x_26 = lean_ctor_get(x_25, 0);
|
||||
lean_inc(x_26);
|
||||
x_27 = lean_ctor_get(x_25, 1);
|
||||
|
|
@ -3764,90 +3764,92 @@ x_29 = lean_alloc_ctor(0, 2, 0);
|
|||
lean_ctor_set(x_29, 0, x_28);
|
||||
lean_ctor_set(x_29, 1, x_1);
|
||||
x_30 = l_Lean_LocalContext_empty;
|
||||
x_31 = lean_alloc_ctor(0, 4, 0);
|
||||
lean_ctor_set(x_31, 0, x_29);
|
||||
lean_ctor_set(x_31, 1, x_30);
|
||||
lean_ctor_set(x_31, 2, x_3);
|
||||
lean_ctor_set(x_31, 3, x_26);
|
||||
x_32 = lean_alloc_ctor(1, 1, 0);
|
||||
lean_ctor_set(x_32, 0, x_31);
|
||||
x_33 = l_Lean_Elab_pushInfoLeaf___at_Lean_Elab_Term_addDotCompletionInfo___spec__2(x_32, x_4, x_5, x_6, x_7, x_8, x_9, x_27);
|
||||
x_31 = 0;
|
||||
x_32 = lean_alloc_ctor(0, 4, 1);
|
||||
lean_ctor_set(x_32, 0, x_29);
|
||||
lean_ctor_set(x_32, 1, x_30);
|
||||
lean_ctor_set(x_32, 2, x_3);
|
||||
lean_ctor_set(x_32, 3, x_26);
|
||||
lean_ctor_set_uint8(x_32, sizeof(void*)*4, x_31);
|
||||
x_33 = lean_alloc_ctor(1, 1, 0);
|
||||
lean_ctor_set(x_33, 0, x_32);
|
||||
x_34 = l_Lean_Elab_pushInfoLeaf___at_Lean_Elab_Term_addDotCompletionInfo___spec__2(x_33, x_4, x_5, x_6, x_7, x_8, x_9, x_27);
|
||||
lean_dec(x_8);
|
||||
lean_dec(x_4);
|
||||
x_34 = !lean_is_exclusive(x_33);
|
||||
if (x_34 == 0)
|
||||
x_35 = !lean_is_exclusive(x_34);
|
||||
if (x_35 == 0)
|
||||
{
|
||||
lean_object* x_35;
|
||||
x_35 = lean_ctor_get(x_33, 0);
|
||||
lean_dec(x_35);
|
||||
lean_ctor_set(x_33, 0, x_12);
|
||||
return x_33;
|
||||
lean_object* x_36;
|
||||
x_36 = lean_ctor_get(x_34, 0);
|
||||
lean_dec(x_36);
|
||||
lean_ctor_set(x_34, 0, x_12);
|
||||
return x_34;
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_36; lean_object* x_37;
|
||||
x_36 = lean_ctor_get(x_33, 1);
|
||||
lean_inc(x_36);
|
||||
lean_dec(x_33);
|
||||
x_37 = lean_alloc_ctor(0, 2, 0);
|
||||
lean_ctor_set(x_37, 0, x_12);
|
||||
lean_ctor_set(x_37, 1, x_36);
|
||||
return x_37;
|
||||
lean_object* x_37; lean_object* x_38;
|
||||
x_37 = lean_ctor_get(x_34, 1);
|
||||
lean_inc(x_37);
|
||||
lean_dec(x_34);
|
||||
x_38 = lean_alloc_ctor(0, 2, 0);
|
||||
lean_ctor_set(x_38, 0, x_12);
|
||||
lean_ctor_set(x_38, 1, x_37);
|
||||
return x_38;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
uint8_t x_38;
|
||||
uint8_t x_39;
|
||||
lean_dec(x_12);
|
||||
lean_dec(x_8);
|
||||
lean_dec(x_4);
|
||||
lean_dec(x_3);
|
||||
lean_dec(x_1);
|
||||
x_38 = !lean_is_exclusive(x_25);
|
||||
if (x_38 == 0)
|
||||
x_39 = !lean_is_exclusive(x_25);
|
||||
if (x_39 == 0)
|
||||
{
|
||||
return x_25;
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_39; lean_object* x_40; lean_object* x_41;
|
||||
x_39 = lean_ctor_get(x_25, 0);
|
||||
x_40 = lean_ctor_get(x_25, 1);
|
||||
lean_object* x_40; lean_object* x_41; lean_object* x_42;
|
||||
x_40 = lean_ctor_get(x_25, 0);
|
||||
x_41 = lean_ctor_get(x_25, 1);
|
||||
lean_inc(x_41);
|
||||
lean_inc(x_40);
|
||||
lean_inc(x_39);
|
||||
lean_dec(x_25);
|
||||
x_41 = lean_alloc_ctor(1, 2, 0);
|
||||
lean_ctor_set(x_41, 0, x_39);
|
||||
lean_ctor_set(x_41, 1, x_40);
|
||||
return x_41;
|
||||
x_42 = lean_alloc_ctor(1, 2, 0);
|
||||
lean_ctor_set(x_42, 0, x_40);
|
||||
lean_ctor_set(x_42, 1, x_41);
|
||||
return x_42;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
uint8_t x_42;
|
||||
uint8_t x_43;
|
||||
lean_dec(x_8);
|
||||
lean_dec(x_4);
|
||||
lean_dec(x_3);
|
||||
lean_dec(x_1);
|
||||
x_42 = !lean_is_exclusive(x_11);
|
||||
if (x_42 == 0)
|
||||
x_43 = !lean_is_exclusive(x_11);
|
||||
if (x_43 == 0)
|
||||
{
|
||||
return x_11;
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_43; lean_object* x_44; lean_object* x_45;
|
||||
x_43 = lean_ctor_get(x_11, 0);
|
||||
x_44 = lean_ctor_get(x_11, 1);
|
||||
lean_object* x_44; lean_object* x_45; lean_object* x_46;
|
||||
x_44 = lean_ctor_get(x_11, 0);
|
||||
x_45 = lean_ctor_get(x_11, 1);
|
||||
lean_inc(x_45);
|
||||
lean_inc(x_44);
|
||||
lean_inc(x_43);
|
||||
lean_dec(x_11);
|
||||
x_45 = lean_alloc_ctor(1, 2, 0);
|
||||
lean_ctor_set(x_45, 0, x_43);
|
||||
lean_ctor_set(x_45, 1, x_44);
|
||||
return x_45;
|
||||
x_46 = lean_alloc_ctor(1, 2, 0);
|
||||
lean_ctor_set(x_46, 0, x_44);
|
||||
lean_ctor_set(x_46, 1, x_45);
|
||||
return x_46;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
54
stage0/stdlib/Lean/Elab/Print.c
generated
54
stage0/stdlib/Lean/Elab/Print.c
generated
|
|
@ -2888,7 +2888,7 @@ lean_inc(x_5);
|
|||
x_11 = l_Lean_mkConstWithLevelParams___at___private_Lean_Elab_Print_0__Lean_Elab_Command_printId___spec__5(x_9, x_5, x_6, x_7);
|
||||
if (lean_obj_tag(x_11) == 0)
|
||||
{
|
||||
lean_object* x_12; lean_object* x_13; lean_object* x_14; lean_object* x_15; lean_object* x_16; lean_object* x_17; lean_object* x_18; lean_object* x_19; lean_object* x_20; lean_object* x_21;
|
||||
lean_object* x_12; lean_object* x_13; lean_object* x_14; lean_object* x_15; lean_object* x_16; uint8_t x_17; lean_object* x_18; lean_object* x_19; lean_object* x_20; lean_object* x_21; lean_object* x_22;
|
||||
x_12 = lean_ctor_get(x_11, 0);
|
||||
lean_inc(x_12);
|
||||
x_13 = lean_ctor_get(x_11, 1);
|
||||
|
|
@ -2900,48 +2900,50 @@ x_15 = lean_alloc_ctor(0, 2, 0);
|
|||
lean_ctor_set(x_15, 0, x_14);
|
||||
lean_ctor_set(x_15, 1, x_1);
|
||||
x_16 = l_Lean_LocalContext_empty;
|
||||
x_17 = 0;
|
||||
lean_inc(x_2);
|
||||
x_17 = lean_alloc_ctor(0, 4, 0);
|
||||
lean_ctor_set(x_17, 0, x_15);
|
||||
lean_ctor_set(x_17, 1, x_16);
|
||||
lean_ctor_set(x_17, 2, x_2);
|
||||
lean_ctor_set(x_17, 3, x_12);
|
||||
x_18 = lean_alloc_ctor(1, 1, 0);
|
||||
lean_ctor_set(x_18, 0, x_17);
|
||||
x_19 = l_Lean_Elab_pushInfoLeaf___at___private_Lean_Elab_Print_0__Lean_Elab_Command_printId___spec__6(x_18, x_5, x_6, x_13);
|
||||
x_20 = lean_ctor_get(x_19, 1);
|
||||
lean_inc(x_20);
|
||||
lean_dec(x_19);
|
||||
x_21 = lean_box(0);
|
||||
x_18 = lean_alloc_ctor(0, 4, 1);
|
||||
lean_ctor_set(x_18, 0, x_15);
|
||||
lean_ctor_set(x_18, 1, x_16);
|
||||
lean_ctor_set(x_18, 2, x_2);
|
||||
lean_ctor_set(x_18, 3, x_12);
|
||||
lean_ctor_set_uint8(x_18, sizeof(void*)*4, x_17);
|
||||
x_19 = lean_alloc_ctor(1, 1, 0);
|
||||
lean_ctor_set(x_19, 0, x_18);
|
||||
x_20 = l_Lean_Elab_pushInfoLeaf___at___private_Lean_Elab_Print_0__Lean_Elab_Command_printId___spec__6(x_19, x_5, x_6, x_13);
|
||||
x_21 = lean_ctor_get(x_20, 1);
|
||||
lean_inc(x_21);
|
||||
lean_dec(x_20);
|
||||
x_22 = lean_box(0);
|
||||
x_3 = x_10;
|
||||
x_4 = x_21;
|
||||
x_7 = x_20;
|
||||
x_4 = x_22;
|
||||
x_7 = x_21;
|
||||
goto _start;
|
||||
}
|
||||
else
|
||||
{
|
||||
uint8_t x_23;
|
||||
uint8_t x_24;
|
||||
lean_dec(x_10);
|
||||
lean_dec(x_5);
|
||||
lean_dec(x_2);
|
||||
lean_dec(x_1);
|
||||
x_23 = !lean_is_exclusive(x_11);
|
||||
if (x_23 == 0)
|
||||
x_24 = !lean_is_exclusive(x_11);
|
||||
if (x_24 == 0)
|
||||
{
|
||||
return x_11;
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_24; lean_object* x_25; lean_object* x_26;
|
||||
x_24 = lean_ctor_get(x_11, 0);
|
||||
x_25 = lean_ctor_get(x_11, 1);
|
||||
lean_object* x_25; lean_object* x_26; lean_object* x_27;
|
||||
x_25 = lean_ctor_get(x_11, 0);
|
||||
x_26 = lean_ctor_get(x_11, 1);
|
||||
lean_inc(x_26);
|
||||
lean_inc(x_25);
|
||||
lean_inc(x_24);
|
||||
lean_dec(x_11);
|
||||
x_26 = lean_alloc_ctor(1, 2, 0);
|
||||
lean_ctor_set(x_26, 0, x_24);
|
||||
lean_ctor_set(x_26, 1, x_25);
|
||||
return x_26;
|
||||
x_27 = lean_alloc_ctor(1, 2, 0);
|
||||
lean_ctor_set(x_27, 0, x_25);
|
||||
lean_ctor_set(x_27, 1, x_26);
|
||||
return x_27;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
1693
stage0/stdlib/Lean/Elab/Quotation.c
generated
1693
stage0/stdlib/Lean/Elab/Quotation.c
generated
File diff suppressed because it is too large
Load diff
54
stage0/stdlib/Lean/Elab/Syntax.c
generated
54
stage0/stdlib/Lean/Elab/Syntax.c
generated
|
|
@ -6203,7 +6203,7 @@ lean_dec(x_3);
|
|||
x_17 = l_Lean_mkConstWithLevelParams___at_Lean_Elab_Term_toParserDescr_resolveParserName___spec__5(x_15, x_5, x_6, x_7, x_8, x_9, x_10, x_11, x_12, x_13);
|
||||
if (lean_obj_tag(x_17) == 0)
|
||||
{
|
||||
lean_object* x_18; lean_object* x_19; lean_object* x_20; lean_object* x_21; lean_object* x_22; lean_object* x_23; lean_object* x_24; lean_object* x_25; lean_object* x_26; lean_object* x_27;
|
||||
lean_object* x_18; lean_object* x_19; lean_object* x_20; lean_object* x_21; lean_object* x_22; uint8_t x_23; lean_object* x_24; lean_object* x_25; lean_object* x_26; lean_object* x_27; lean_object* x_28;
|
||||
x_18 = lean_ctor_get(x_17, 0);
|
||||
lean_inc(x_18);
|
||||
x_19 = lean_ctor_get(x_17, 1);
|
||||
|
|
@ -6215,47 +6215,49 @@ x_21 = lean_alloc_ctor(0, 2, 0);
|
|||
lean_ctor_set(x_21, 0, x_20);
|
||||
lean_ctor_set(x_21, 1, x_1);
|
||||
x_22 = l_Lean_LocalContext_empty;
|
||||
x_23 = 0;
|
||||
lean_inc(x_2);
|
||||
x_23 = lean_alloc_ctor(0, 4, 0);
|
||||
lean_ctor_set(x_23, 0, x_21);
|
||||
lean_ctor_set(x_23, 1, x_22);
|
||||
lean_ctor_set(x_23, 2, x_2);
|
||||
lean_ctor_set(x_23, 3, x_18);
|
||||
x_24 = lean_alloc_ctor(1, 1, 0);
|
||||
lean_ctor_set(x_24, 0, x_23);
|
||||
x_25 = l_Lean_Elab_pushInfoLeaf___at_Lean_Elab_Term_toParserDescr_resolveParserName___spec__8(x_24, x_5, x_6, x_7, x_8, x_9, x_10, x_11, x_12, x_19);
|
||||
x_26 = lean_ctor_get(x_25, 1);
|
||||
lean_inc(x_26);
|
||||
lean_dec(x_25);
|
||||
x_27 = lean_box(0);
|
||||
x_24 = lean_alloc_ctor(0, 4, 1);
|
||||
lean_ctor_set(x_24, 0, x_21);
|
||||
lean_ctor_set(x_24, 1, x_22);
|
||||
lean_ctor_set(x_24, 2, x_2);
|
||||
lean_ctor_set(x_24, 3, x_18);
|
||||
lean_ctor_set_uint8(x_24, sizeof(void*)*4, x_23);
|
||||
x_25 = lean_alloc_ctor(1, 1, 0);
|
||||
lean_ctor_set(x_25, 0, x_24);
|
||||
x_26 = l_Lean_Elab_pushInfoLeaf___at_Lean_Elab_Term_toParserDescr_resolveParserName___spec__8(x_25, x_5, x_6, x_7, x_8, x_9, x_10, x_11, x_12, x_19);
|
||||
x_27 = lean_ctor_get(x_26, 1);
|
||||
lean_inc(x_27);
|
||||
lean_dec(x_26);
|
||||
x_28 = lean_box(0);
|
||||
x_3 = x_16;
|
||||
x_4 = x_27;
|
||||
x_13 = x_26;
|
||||
x_4 = x_28;
|
||||
x_13 = x_27;
|
||||
goto _start;
|
||||
}
|
||||
else
|
||||
{
|
||||
uint8_t x_29;
|
||||
uint8_t x_30;
|
||||
lean_dec(x_16);
|
||||
lean_dec(x_2);
|
||||
lean_dec(x_1);
|
||||
x_29 = !lean_is_exclusive(x_17);
|
||||
if (x_29 == 0)
|
||||
x_30 = !lean_is_exclusive(x_17);
|
||||
if (x_30 == 0)
|
||||
{
|
||||
return x_17;
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_30; lean_object* x_31; lean_object* x_32;
|
||||
x_30 = lean_ctor_get(x_17, 0);
|
||||
x_31 = lean_ctor_get(x_17, 1);
|
||||
lean_object* x_31; lean_object* x_32; lean_object* x_33;
|
||||
x_31 = lean_ctor_get(x_17, 0);
|
||||
x_32 = lean_ctor_get(x_17, 1);
|
||||
lean_inc(x_32);
|
||||
lean_inc(x_31);
|
||||
lean_inc(x_30);
|
||||
lean_dec(x_17);
|
||||
x_32 = lean_alloc_ctor(1, 2, 0);
|
||||
lean_ctor_set(x_32, 0, x_30);
|
||||
lean_ctor_set(x_32, 1, x_31);
|
||||
return x_32;
|
||||
x_33 = lean_alloc_ctor(1, 2, 0);
|
||||
lean_ctor_set(x_33, 0, x_31);
|
||||
lean_ctor_set(x_33, 1, x_32);
|
||||
return x_33;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
94
stage0/stdlib/Lean/Elab/Tactic/Induction.c
generated
94
stage0/stdlib/Lean/Elab/Tactic/Induction.c
generated
|
|
@ -11680,7 +11680,7 @@ lean_inc(x_14);
|
|||
x_27 = l_Lean_mkConstWithLevelParams___at___private_Lean_Elab_Tactic_Induction_0__Lean_Elab_Tactic_getElimNameInfo___spec__7(x_14, x_4, x_5, x_6, x_7, x_8, x_9, x_10, x_11, x_26);
|
||||
if (lean_obj_tag(x_27) == 0)
|
||||
{
|
||||
lean_object* x_28; lean_object* x_29; lean_object* x_30; lean_object* x_31; lean_object* x_32; lean_object* x_33; lean_object* x_34; lean_object* x_35; uint8_t x_36;
|
||||
lean_object* x_28; lean_object* x_29; lean_object* x_30; lean_object* x_31; lean_object* x_32; uint8_t x_33; lean_object* x_34; lean_object* x_35; lean_object* x_36; uint8_t x_37;
|
||||
x_28 = lean_ctor_get(x_27, 0);
|
||||
lean_inc(x_28);
|
||||
x_29 = lean_ctor_get(x_27, 1);
|
||||
|
|
@ -11691,87 +11691,89 @@ x_31 = lean_alloc_ctor(0, 2, 0);
|
|||
lean_ctor_set(x_31, 0, x_30);
|
||||
lean_ctor_set(x_31, 1, x_1);
|
||||
x_32 = l_Lean_LocalContext_empty;
|
||||
x_33 = lean_alloc_ctor(0, 4, 0);
|
||||
lean_ctor_set(x_33, 0, x_31);
|
||||
lean_ctor_set(x_33, 1, x_32);
|
||||
lean_ctor_set(x_33, 2, x_3);
|
||||
lean_ctor_set(x_33, 3, x_28);
|
||||
x_34 = lean_alloc_ctor(1, 1, 0);
|
||||
lean_ctor_set(x_34, 0, x_33);
|
||||
x_35 = l_Lean_Elab_pushInfoLeaf___at___private_Lean_Elab_Tactic_Induction_0__Lean_Elab_Tactic_getElimNameInfo___spec__10(x_34, x_4, x_5, x_6, x_7, x_8, x_9, x_10, x_11, x_29);
|
||||
x_33 = 0;
|
||||
x_34 = lean_alloc_ctor(0, 4, 1);
|
||||
lean_ctor_set(x_34, 0, x_31);
|
||||
lean_ctor_set(x_34, 1, x_32);
|
||||
lean_ctor_set(x_34, 2, x_3);
|
||||
lean_ctor_set(x_34, 3, x_28);
|
||||
lean_ctor_set_uint8(x_34, sizeof(void*)*4, x_33);
|
||||
x_35 = lean_alloc_ctor(1, 1, 0);
|
||||
lean_ctor_set(x_35, 0, x_34);
|
||||
x_36 = l_Lean_Elab_pushInfoLeaf___at___private_Lean_Elab_Tactic_Induction_0__Lean_Elab_Tactic_getElimNameInfo___spec__10(x_35, x_4, x_5, x_6, x_7, x_8, x_9, x_10, x_11, x_29);
|
||||
lean_dec(x_10);
|
||||
x_36 = !lean_is_exclusive(x_35);
|
||||
if (x_36 == 0)
|
||||
x_37 = !lean_is_exclusive(x_36);
|
||||
if (x_37 == 0)
|
||||
{
|
||||
lean_object* x_37;
|
||||
x_37 = lean_ctor_get(x_35, 0);
|
||||
lean_dec(x_37);
|
||||
lean_ctor_set(x_35, 0, x_14);
|
||||
return x_35;
|
||||
lean_object* x_38;
|
||||
x_38 = lean_ctor_get(x_36, 0);
|
||||
lean_dec(x_38);
|
||||
lean_ctor_set(x_36, 0, x_14);
|
||||
return x_36;
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_38; lean_object* x_39;
|
||||
x_38 = lean_ctor_get(x_35, 1);
|
||||
lean_inc(x_38);
|
||||
lean_dec(x_35);
|
||||
x_39 = lean_alloc_ctor(0, 2, 0);
|
||||
lean_ctor_set(x_39, 0, x_14);
|
||||
lean_ctor_set(x_39, 1, x_38);
|
||||
return x_39;
|
||||
lean_object* x_39; lean_object* x_40;
|
||||
x_39 = lean_ctor_get(x_36, 1);
|
||||
lean_inc(x_39);
|
||||
lean_dec(x_36);
|
||||
x_40 = lean_alloc_ctor(0, 2, 0);
|
||||
lean_ctor_set(x_40, 0, x_14);
|
||||
lean_ctor_set(x_40, 1, x_39);
|
||||
return x_40;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
uint8_t x_40;
|
||||
uint8_t x_41;
|
||||
lean_dec(x_14);
|
||||
lean_dec(x_10);
|
||||
lean_dec(x_3);
|
||||
lean_dec(x_1);
|
||||
x_40 = !lean_is_exclusive(x_27);
|
||||
if (x_40 == 0)
|
||||
x_41 = !lean_is_exclusive(x_27);
|
||||
if (x_41 == 0)
|
||||
{
|
||||
return x_27;
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_41; lean_object* x_42; lean_object* x_43;
|
||||
x_41 = lean_ctor_get(x_27, 0);
|
||||
x_42 = lean_ctor_get(x_27, 1);
|
||||
lean_object* x_42; lean_object* x_43; lean_object* x_44;
|
||||
x_42 = lean_ctor_get(x_27, 0);
|
||||
x_43 = lean_ctor_get(x_27, 1);
|
||||
lean_inc(x_43);
|
||||
lean_inc(x_42);
|
||||
lean_inc(x_41);
|
||||
lean_dec(x_27);
|
||||
x_43 = lean_alloc_ctor(1, 2, 0);
|
||||
lean_ctor_set(x_43, 0, x_41);
|
||||
lean_ctor_set(x_43, 1, x_42);
|
||||
return x_43;
|
||||
x_44 = lean_alloc_ctor(1, 2, 0);
|
||||
lean_ctor_set(x_44, 0, x_42);
|
||||
lean_ctor_set(x_44, 1, x_43);
|
||||
return x_44;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
uint8_t x_44;
|
||||
uint8_t x_45;
|
||||
lean_dec(x_10);
|
||||
lean_dec(x_3);
|
||||
lean_dec(x_1);
|
||||
x_44 = !lean_is_exclusive(x_13);
|
||||
if (x_44 == 0)
|
||||
x_45 = !lean_is_exclusive(x_13);
|
||||
if (x_45 == 0)
|
||||
{
|
||||
return x_13;
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_45; lean_object* x_46; lean_object* x_47;
|
||||
x_45 = lean_ctor_get(x_13, 0);
|
||||
x_46 = lean_ctor_get(x_13, 1);
|
||||
lean_object* x_46; lean_object* x_47; lean_object* x_48;
|
||||
x_46 = lean_ctor_get(x_13, 0);
|
||||
x_47 = lean_ctor_get(x_13, 1);
|
||||
lean_inc(x_47);
|
||||
lean_inc(x_46);
|
||||
lean_inc(x_45);
|
||||
lean_dec(x_13);
|
||||
x_47 = lean_alloc_ctor(1, 2, 0);
|
||||
lean_ctor_set(x_47, 0, x_45);
|
||||
lean_ctor_set(x_47, 1, x_46);
|
||||
return x_47;
|
||||
x_48 = lean_alloc_ctor(1, 2, 0);
|
||||
lean_ctor_set(x_48, 0, x_46);
|
||||
lean_ctor_set(x_48, 1, x_47);
|
||||
return x_48;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
94
stage0/stdlib/Lean/Elab/Tactic/Simp.c
generated
94
stage0/stdlib/Lean/Elab/Tactic/Simp.c
generated
|
|
@ -2810,7 +2810,7 @@ lean_inc(x_14);
|
|||
x_27 = l_Lean_mkConstWithLevelParams___at___private_Lean_Elab_Tactic_Simp_0__Lean_Elab_Tactic_elabSimpLemmas___spec__7(x_14, x_4, x_5, x_6, x_7, x_8, x_9, x_10, x_11, x_26);
|
||||
if (lean_obj_tag(x_27) == 0)
|
||||
{
|
||||
lean_object* x_28; lean_object* x_29; lean_object* x_30; lean_object* x_31; lean_object* x_32; lean_object* x_33; lean_object* x_34; lean_object* x_35; uint8_t x_36;
|
||||
lean_object* x_28; lean_object* x_29; lean_object* x_30; lean_object* x_31; lean_object* x_32; uint8_t x_33; lean_object* x_34; lean_object* x_35; lean_object* x_36; uint8_t x_37;
|
||||
x_28 = lean_ctor_get(x_27, 0);
|
||||
lean_inc(x_28);
|
||||
x_29 = lean_ctor_get(x_27, 1);
|
||||
|
|
@ -2821,87 +2821,89 @@ x_31 = lean_alloc_ctor(0, 2, 0);
|
|||
lean_ctor_set(x_31, 0, x_30);
|
||||
lean_ctor_set(x_31, 1, x_1);
|
||||
x_32 = l_Lean_LocalContext_empty;
|
||||
x_33 = lean_alloc_ctor(0, 4, 0);
|
||||
lean_ctor_set(x_33, 0, x_31);
|
||||
lean_ctor_set(x_33, 1, x_32);
|
||||
lean_ctor_set(x_33, 2, x_3);
|
||||
lean_ctor_set(x_33, 3, x_28);
|
||||
x_34 = lean_alloc_ctor(1, 1, 0);
|
||||
lean_ctor_set(x_34, 0, x_33);
|
||||
x_35 = l_Lean_Elab_pushInfoLeaf___at___private_Lean_Elab_Tactic_Simp_0__Lean_Elab_Tactic_elabSimpLemmas___spec__10(x_34, x_4, x_5, x_6, x_7, x_8, x_9, x_10, x_11, x_29);
|
||||
x_33 = 0;
|
||||
x_34 = lean_alloc_ctor(0, 4, 1);
|
||||
lean_ctor_set(x_34, 0, x_31);
|
||||
lean_ctor_set(x_34, 1, x_32);
|
||||
lean_ctor_set(x_34, 2, x_3);
|
||||
lean_ctor_set(x_34, 3, x_28);
|
||||
lean_ctor_set_uint8(x_34, sizeof(void*)*4, x_33);
|
||||
x_35 = lean_alloc_ctor(1, 1, 0);
|
||||
lean_ctor_set(x_35, 0, x_34);
|
||||
x_36 = l_Lean_Elab_pushInfoLeaf___at___private_Lean_Elab_Tactic_Simp_0__Lean_Elab_Tactic_elabSimpLemmas___spec__10(x_35, x_4, x_5, x_6, x_7, x_8, x_9, x_10, x_11, x_29);
|
||||
lean_dec(x_10);
|
||||
x_36 = !lean_is_exclusive(x_35);
|
||||
if (x_36 == 0)
|
||||
x_37 = !lean_is_exclusive(x_36);
|
||||
if (x_37 == 0)
|
||||
{
|
||||
lean_object* x_37;
|
||||
x_37 = lean_ctor_get(x_35, 0);
|
||||
lean_dec(x_37);
|
||||
lean_ctor_set(x_35, 0, x_14);
|
||||
return x_35;
|
||||
lean_object* x_38;
|
||||
x_38 = lean_ctor_get(x_36, 0);
|
||||
lean_dec(x_38);
|
||||
lean_ctor_set(x_36, 0, x_14);
|
||||
return x_36;
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_38; lean_object* x_39;
|
||||
x_38 = lean_ctor_get(x_35, 1);
|
||||
lean_inc(x_38);
|
||||
lean_dec(x_35);
|
||||
x_39 = lean_alloc_ctor(0, 2, 0);
|
||||
lean_ctor_set(x_39, 0, x_14);
|
||||
lean_ctor_set(x_39, 1, x_38);
|
||||
return x_39;
|
||||
lean_object* x_39; lean_object* x_40;
|
||||
x_39 = lean_ctor_get(x_36, 1);
|
||||
lean_inc(x_39);
|
||||
lean_dec(x_36);
|
||||
x_40 = lean_alloc_ctor(0, 2, 0);
|
||||
lean_ctor_set(x_40, 0, x_14);
|
||||
lean_ctor_set(x_40, 1, x_39);
|
||||
return x_40;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
uint8_t x_40;
|
||||
uint8_t x_41;
|
||||
lean_dec(x_14);
|
||||
lean_dec(x_10);
|
||||
lean_dec(x_3);
|
||||
lean_dec(x_1);
|
||||
x_40 = !lean_is_exclusive(x_27);
|
||||
if (x_40 == 0)
|
||||
x_41 = !lean_is_exclusive(x_27);
|
||||
if (x_41 == 0)
|
||||
{
|
||||
return x_27;
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_41; lean_object* x_42; lean_object* x_43;
|
||||
x_41 = lean_ctor_get(x_27, 0);
|
||||
x_42 = lean_ctor_get(x_27, 1);
|
||||
lean_object* x_42; lean_object* x_43; lean_object* x_44;
|
||||
x_42 = lean_ctor_get(x_27, 0);
|
||||
x_43 = lean_ctor_get(x_27, 1);
|
||||
lean_inc(x_43);
|
||||
lean_inc(x_42);
|
||||
lean_inc(x_41);
|
||||
lean_dec(x_27);
|
||||
x_43 = lean_alloc_ctor(1, 2, 0);
|
||||
lean_ctor_set(x_43, 0, x_41);
|
||||
lean_ctor_set(x_43, 1, x_42);
|
||||
return x_43;
|
||||
x_44 = lean_alloc_ctor(1, 2, 0);
|
||||
lean_ctor_set(x_44, 0, x_42);
|
||||
lean_ctor_set(x_44, 1, x_43);
|
||||
return x_44;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
uint8_t x_44;
|
||||
uint8_t x_45;
|
||||
lean_dec(x_10);
|
||||
lean_dec(x_3);
|
||||
lean_dec(x_1);
|
||||
x_44 = !lean_is_exclusive(x_13);
|
||||
if (x_44 == 0)
|
||||
x_45 = !lean_is_exclusive(x_13);
|
||||
if (x_45 == 0)
|
||||
{
|
||||
return x_13;
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_45; lean_object* x_46; lean_object* x_47;
|
||||
x_45 = lean_ctor_get(x_13, 0);
|
||||
x_46 = lean_ctor_get(x_13, 1);
|
||||
lean_object* x_46; lean_object* x_47; lean_object* x_48;
|
||||
x_46 = lean_ctor_get(x_13, 0);
|
||||
x_47 = lean_ctor_get(x_13, 1);
|
||||
lean_inc(x_47);
|
||||
lean_inc(x_46);
|
||||
lean_inc(x_45);
|
||||
lean_dec(x_13);
|
||||
x_47 = lean_alloc_ctor(1, 2, 0);
|
||||
lean_ctor_set(x_47, 0, x_45);
|
||||
lean_ctor_set(x_47, 1, x_46);
|
||||
return x_47;
|
||||
x_48 = lean_alloc_ctor(1, 2, 0);
|
||||
lean_ctor_set(x_48, 0, x_46);
|
||||
lean_ctor_set(x_48, 1, x_47);
|
||||
return x_48;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
2302
stage0/stdlib/Lean/Elab/Term.c
generated
2302
stage0/stdlib/Lean/Elab/Term.c
generated
File diff suppressed because it is too large
Load diff
6654
stage0/stdlib/Lean/Meta/Closure.c
generated
6654
stage0/stdlib/Lean/Meta/Closure.c
generated
File diff suppressed because it is too large
Load diff
269
stage0/stdlib/Lean/Parser/Syntax.c
generated
269
stage0/stdlib/Lean/Parser/Syntax.c
generated
|
|
@ -13946,15 +13946,13 @@ return x_4;
|
|||
static lean_object* _init_l_Lean_Parser_Command_mixfix___elambda__1___closed__13() {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4;
|
||||
x_1 = l_Lean_Parser_optPrecedence;
|
||||
x_2 = lean_ctor_get(x_1, 1);
|
||||
lean_inc(x_2);
|
||||
x_3 = l_Lean_Parser_Command_mixfix___elambda__1___closed__12;
|
||||
x_4 = lean_alloc_closure((void*)(l_Lean_Parser_andthenFn), 4, 2);
|
||||
lean_closure_set(x_4, 0, x_2);
|
||||
lean_closure_set(x_4, 1, x_3);
|
||||
return x_4;
|
||||
lean_object* x_1; lean_object* x_2; lean_object* x_3;
|
||||
x_1 = l_Lean_Parser_precedence___closed__8;
|
||||
x_2 = l_Lean_Parser_Command_mixfix___elambda__1___closed__12;
|
||||
x_3 = lean_alloc_closure((void*)(l_Lean_Parser_andthenFn), 4, 2);
|
||||
lean_closure_set(x_3, 0, x_1);
|
||||
lean_closure_set(x_3, 1, x_2);
|
||||
return x_3;
|
||||
}
|
||||
}
|
||||
static lean_object* _init_l_Lean_Parser_Command_mixfix___elambda__1___closed__14() {
|
||||
|
|
@ -14028,161 +14026,155 @@ return x_3;
|
|||
lean_object* l_Lean_Parser_Command_mixfix___elambda__1(lean_object* x_1, lean_object* x_2) {
|
||||
_start:
|
||||
{
|
||||
lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6; lean_object* x_7; lean_object* x_8; lean_object* x_9; lean_object* x_10; uint8_t x_11;
|
||||
lean_object* x_3; lean_object* x_4; lean_object* x_5; lean_object* x_6; lean_object* x_7; lean_object* x_8; uint8_t x_9;
|
||||
x_3 = l_Lean_Parser_Command_optNamedPrio;
|
||||
x_4 = lean_ctor_get(x_3, 1);
|
||||
lean_inc(x_4);
|
||||
x_5 = l_Lean_Parser_Command_optNamedName;
|
||||
x_6 = lean_ctor_get(x_5, 1);
|
||||
lean_inc(x_6);
|
||||
x_7 = l_Lean_Parser_optPrecedence;
|
||||
x_7 = l_Lean_Parser_Command_mixfix___elambda__1___closed__4;
|
||||
x_8 = lean_ctor_get(x_7, 1);
|
||||
lean_inc(x_8);
|
||||
x_9 = l_Lean_Parser_Command_mixfix___elambda__1___closed__4;
|
||||
x_10 = lean_ctor_get(x_9, 1);
|
||||
lean_inc(x_10);
|
||||
lean_inc(x_2);
|
||||
lean_inc(x_1);
|
||||
x_11 = l_Lean_Parser_tryAnti(x_1, x_2);
|
||||
if (x_11 == 0)
|
||||
{
|
||||
lean_object* x_12; lean_object* x_13; lean_object* x_14; lean_object* x_15; uint8_t x_16;
|
||||
lean_dec(x_10);
|
||||
x_12 = lean_unsigned_to_nat(1024u);
|
||||
x_13 = l_Lean_Parser_checkPrecFn(x_12, x_1, x_2);
|
||||
x_14 = lean_ctor_get(x_13, 4);
|
||||
lean_inc(x_14);
|
||||
x_15 = lean_box(0);
|
||||
x_16 = l___private_Init_Data_Option_Basic_0__beqOption____x40_Init_Data_Option_Basic___hyg_631____at_Lean_Parser_ParserState_hasError___spec__1(x_14, x_15);
|
||||
lean_dec(x_14);
|
||||
if (x_16 == 0)
|
||||
x_9 = l_Lean_Parser_tryAnti(x_1, x_2);
|
||||
if (x_9 == 0)
|
||||
{
|
||||
lean_object* x_10; lean_object* x_11; lean_object* x_12; lean_object* x_13; uint8_t x_14;
|
||||
lean_dec(x_8);
|
||||
x_10 = lean_unsigned_to_nat(1024u);
|
||||
x_11 = l_Lean_Parser_checkPrecFn(x_10, x_1, x_2);
|
||||
x_12 = lean_ctor_get(x_11, 4);
|
||||
lean_inc(x_12);
|
||||
x_13 = lean_box(0);
|
||||
x_14 = l___private_Init_Data_Option_Basic_0__beqOption____x40_Init_Data_Option_Basic___hyg_631____at_Lean_Parser_ParserState_hasError___spec__1(x_12, x_13);
|
||||
lean_dec(x_12);
|
||||
if (x_14 == 0)
|
||||
{
|
||||
lean_dec(x_6);
|
||||
lean_dec(x_4);
|
||||
lean_dec(x_1);
|
||||
return x_13;
|
||||
return x_11;
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_17; lean_object* x_18; lean_object* x_19; lean_object* x_20; uint8_t x_21; lean_object* x_22;
|
||||
x_17 = lean_ctor_get(x_13, 0);
|
||||
lean_inc(x_17);
|
||||
x_18 = lean_array_get_size(x_17);
|
||||
lean_dec(x_17);
|
||||
lean_object* x_15; lean_object* x_16; lean_object* x_17; lean_object* x_18; uint8_t x_19; lean_object* x_20;
|
||||
x_15 = lean_ctor_get(x_11, 0);
|
||||
lean_inc(x_15);
|
||||
x_16 = lean_array_get_size(x_15);
|
||||
lean_dec(x_15);
|
||||
lean_inc(x_1);
|
||||
x_19 = l_Lean_Parser_Term_attrKind___elambda__1(x_1, x_13);
|
||||
x_20 = lean_ctor_get(x_19, 4);
|
||||
lean_inc(x_20);
|
||||
x_21 = l___private_Init_Data_Option_Basic_0__beqOption____x40_Init_Data_Option_Basic___hyg_631____at_Lean_Parser_ParserState_hasError___spec__1(x_20, x_15);
|
||||
lean_dec(x_20);
|
||||
if (x_21 == 0)
|
||||
{
|
||||
lean_dec(x_8);
|
||||
lean_dec(x_6);
|
||||
lean_dec(x_4);
|
||||
x_22 = x_19;
|
||||
goto block_28;
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_29; lean_object* x_30; uint8_t x_31;
|
||||
lean_inc(x_1);
|
||||
x_29 = l_Lean_Parser_Command_mixfixKind___elambda__1(x_1, x_19);
|
||||
x_30 = lean_ctor_get(x_29, 4);
|
||||
lean_inc(x_30);
|
||||
x_31 = l___private_Init_Data_Option_Basic_0__beqOption____x40_Init_Data_Option_Basic___hyg_631____at_Lean_Parser_ParserState_hasError___spec__1(x_30, x_15);
|
||||
lean_dec(x_30);
|
||||
if (x_31 == 0)
|
||||
{
|
||||
lean_dec(x_8);
|
||||
lean_dec(x_6);
|
||||
lean_dec(x_4);
|
||||
x_22 = x_29;
|
||||
goto block_28;
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_32; lean_object* x_33; uint8_t x_34;
|
||||
lean_inc(x_1);
|
||||
x_32 = lean_apply_2(x_8, x_1, x_29);
|
||||
x_33 = lean_ctor_get(x_32, 4);
|
||||
lean_inc(x_33);
|
||||
x_34 = l___private_Init_Data_Option_Basic_0__beqOption____x40_Init_Data_Option_Basic___hyg_631____at_Lean_Parser_ParserState_hasError___spec__1(x_33, x_15);
|
||||
lean_dec(x_33);
|
||||
if (x_34 == 0)
|
||||
x_17 = l_Lean_Parser_Term_attrKind___elambda__1(x_1, x_11);
|
||||
x_18 = lean_ctor_get(x_17, 4);
|
||||
lean_inc(x_18);
|
||||
x_19 = l___private_Init_Data_Option_Basic_0__beqOption____x40_Init_Data_Option_Basic___hyg_631____at_Lean_Parser_ParserState_hasError___spec__1(x_18, x_13);
|
||||
lean_dec(x_18);
|
||||
if (x_19 == 0)
|
||||
{
|
||||
lean_dec(x_6);
|
||||
lean_dec(x_4);
|
||||
x_22 = x_32;
|
||||
goto block_28;
|
||||
x_20 = x_17;
|
||||
goto block_26;
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_35; lean_object* x_36; uint8_t x_37;
|
||||
lean_object* x_27; lean_object* x_28; uint8_t x_29;
|
||||
lean_inc(x_1);
|
||||
x_35 = lean_apply_2(x_6, x_1, x_32);
|
||||
x_36 = lean_ctor_get(x_35, 4);
|
||||
lean_inc(x_36);
|
||||
x_37 = l___private_Init_Data_Option_Basic_0__beqOption____x40_Init_Data_Option_Basic___hyg_631____at_Lean_Parser_ParserState_hasError___spec__1(x_36, x_15);
|
||||
lean_dec(x_36);
|
||||
if (x_37 == 0)
|
||||
x_27 = l_Lean_Parser_Command_mixfixKind___elambda__1(x_1, x_17);
|
||||
x_28 = lean_ctor_get(x_27, 4);
|
||||
lean_inc(x_28);
|
||||
x_29 = l___private_Init_Data_Option_Basic_0__beqOption____x40_Init_Data_Option_Basic___hyg_631____at_Lean_Parser_ParserState_hasError___spec__1(x_28, x_13);
|
||||
lean_dec(x_28);
|
||||
if (x_29 == 0)
|
||||
{
|
||||
lean_dec(x_6);
|
||||
lean_dec(x_4);
|
||||
x_20 = x_27;
|
||||
goto block_26;
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_30; lean_object* x_31; uint8_t x_32;
|
||||
lean_inc(x_1);
|
||||
x_30 = l_Lean_Parser_precedence___elambda__1(x_1, x_27);
|
||||
x_31 = lean_ctor_get(x_30, 4);
|
||||
lean_inc(x_31);
|
||||
x_32 = l___private_Init_Data_Option_Basic_0__beqOption____x40_Init_Data_Option_Basic___hyg_631____at_Lean_Parser_ParserState_hasError___spec__1(x_31, x_13);
|
||||
lean_dec(x_31);
|
||||
if (x_32 == 0)
|
||||
{
|
||||
lean_dec(x_6);
|
||||
lean_dec(x_4);
|
||||
x_20 = x_30;
|
||||
goto block_26;
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_33; lean_object* x_34; uint8_t x_35;
|
||||
lean_inc(x_1);
|
||||
x_33 = lean_apply_2(x_6, x_1, x_30);
|
||||
x_34 = lean_ctor_get(x_33, 4);
|
||||
lean_inc(x_34);
|
||||
x_35 = l___private_Init_Data_Option_Basic_0__beqOption____x40_Init_Data_Option_Basic___hyg_631____at_Lean_Parser_ParserState_hasError___spec__1(x_34, x_13);
|
||||
lean_dec(x_34);
|
||||
if (x_35 == 0)
|
||||
{
|
||||
lean_dec(x_4);
|
||||
x_22 = x_35;
|
||||
goto block_28;
|
||||
x_20 = x_33;
|
||||
goto block_26;
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_38; lean_object* x_39; uint8_t x_40;
|
||||
lean_object* x_36; lean_object* x_37; uint8_t x_38;
|
||||
lean_inc(x_1);
|
||||
x_38 = lean_apply_2(x_4, x_1, x_35);
|
||||
x_39 = lean_ctor_get(x_38, 4);
|
||||
lean_inc(x_39);
|
||||
x_40 = l___private_Init_Data_Option_Basic_0__beqOption____x40_Init_Data_Option_Basic___hyg_631____at_Lean_Parser_ParserState_hasError___spec__1(x_39, x_15);
|
||||
lean_dec(x_39);
|
||||
if (x_40 == 0)
|
||||
x_36 = lean_apply_2(x_4, x_1, x_33);
|
||||
x_37 = lean_ctor_get(x_36, 4);
|
||||
lean_inc(x_37);
|
||||
x_38 = l___private_Init_Data_Option_Basic_0__beqOption____x40_Init_Data_Option_Basic___hyg_631____at_Lean_Parser_ParserState_hasError___spec__1(x_37, x_13);
|
||||
lean_dec(x_37);
|
||||
if (x_38 == 0)
|
||||
{
|
||||
x_22 = x_38;
|
||||
goto block_28;
|
||||
x_20 = x_36;
|
||||
goto block_26;
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_41; lean_object* x_42; uint8_t x_43;
|
||||
lean_object* x_39; lean_object* x_40; uint8_t x_41;
|
||||
lean_inc(x_1);
|
||||
x_41 = l_Lean_Parser_strLit___elambda__1(x_1, x_38);
|
||||
x_42 = lean_ctor_get(x_41, 4);
|
||||
lean_inc(x_42);
|
||||
x_43 = l___private_Init_Data_Option_Basic_0__beqOption____x40_Init_Data_Option_Basic___hyg_631____at_Lean_Parser_ParserState_hasError___spec__1(x_42, x_15);
|
||||
lean_dec(x_42);
|
||||
if (x_43 == 0)
|
||||
x_39 = l_Lean_Parser_strLit___elambda__1(x_1, x_36);
|
||||
x_40 = lean_ctor_get(x_39, 4);
|
||||
lean_inc(x_40);
|
||||
x_41 = l___private_Init_Data_Option_Basic_0__beqOption____x40_Init_Data_Option_Basic___hyg_631____at_Lean_Parser_ParserState_hasError___spec__1(x_40, x_13);
|
||||
lean_dec(x_40);
|
||||
if (x_41 == 0)
|
||||
{
|
||||
x_22 = x_41;
|
||||
goto block_28;
|
||||
x_20 = x_39;
|
||||
goto block_26;
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_44; lean_object* x_45; uint8_t x_46;
|
||||
lean_object* x_42; lean_object* x_43; uint8_t x_44;
|
||||
lean_inc(x_1);
|
||||
x_44 = l_Lean_Parser_darrow___elambda__1(x_1, x_41);
|
||||
x_45 = lean_ctor_get(x_44, 4);
|
||||
lean_inc(x_45);
|
||||
x_46 = l___private_Init_Data_Option_Basic_0__beqOption____x40_Init_Data_Option_Basic___hyg_631____at_Lean_Parser_ParserState_hasError___spec__1(x_45, x_15);
|
||||
lean_dec(x_45);
|
||||
if (x_46 == 0)
|
||||
x_42 = l_Lean_Parser_darrow___elambda__1(x_1, x_39);
|
||||
x_43 = lean_ctor_get(x_42, 4);
|
||||
lean_inc(x_43);
|
||||
x_44 = l___private_Init_Data_Option_Basic_0__beqOption____x40_Init_Data_Option_Basic___hyg_631____at_Lean_Parser_ParserState_hasError___spec__1(x_43, x_13);
|
||||
lean_dec(x_43);
|
||||
if (x_44 == 0)
|
||||
{
|
||||
x_22 = x_44;
|
||||
goto block_28;
|
||||
x_20 = x_42;
|
||||
goto block_26;
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_47; lean_object* x_48; lean_object* x_49;
|
||||
x_47 = l___regBuiltinParser_Lean_Parser_Term_stx_quot___closed__2;
|
||||
x_48 = lean_unsigned_to_nat(0u);
|
||||
lean_object* x_45; lean_object* x_46; lean_object* x_47;
|
||||
x_45 = l___regBuiltinParser_Lean_Parser_Term_stx_quot___closed__2;
|
||||
x_46 = lean_unsigned_to_nat(0u);
|
||||
lean_inc(x_1);
|
||||
x_49 = l_Lean_Parser_categoryParser___elambda__1(x_47, x_48, x_1, x_44);
|
||||
x_22 = x_49;
|
||||
goto block_28;
|
||||
x_47 = l_Lean_Parser_categoryParser___elambda__1(x_45, x_46, x_1, x_42);
|
||||
x_20 = x_47;
|
||||
goto block_26;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -14190,40 +14182,39 @@ goto block_28;
|
|||
}
|
||||
}
|
||||
}
|
||||
block_28:
|
||||
block_26:
|
||||
{
|
||||
lean_object* x_23; lean_object* x_24; lean_object* x_25; uint8_t x_26;
|
||||
x_23 = l_Lean_Parser_Command_mixfix___elambda__1___closed__2;
|
||||
x_24 = l_Lean_Parser_ParserState_mkNode(x_22, x_23, x_18);
|
||||
x_25 = lean_ctor_get(x_24, 4);
|
||||
lean_inc(x_25);
|
||||
x_26 = l___private_Init_Data_Option_Basic_0__beqOption____x40_Init_Data_Option_Basic___hyg_631____at_Lean_Parser_ParserState_hasError___spec__1(x_25, x_15);
|
||||
lean_dec(x_25);
|
||||
if (x_26 == 0)
|
||||
lean_object* x_21; lean_object* x_22; lean_object* x_23; uint8_t x_24;
|
||||
x_21 = l_Lean_Parser_Command_mixfix___elambda__1___closed__2;
|
||||
x_22 = l_Lean_Parser_ParserState_mkNode(x_20, x_21, x_16);
|
||||
x_23 = lean_ctor_get(x_22, 4);
|
||||
lean_inc(x_23);
|
||||
x_24 = l___private_Init_Data_Option_Basic_0__beqOption____x40_Init_Data_Option_Basic___hyg_631____at_Lean_Parser_ParserState_hasError___spec__1(x_23, x_13);
|
||||
lean_dec(x_23);
|
||||
if (x_24 == 0)
|
||||
{
|
||||
lean_dec(x_1);
|
||||
return x_24;
|
||||
return x_22;
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_27;
|
||||
x_27 = l_Lean_Parser_setLhsPrecFn(x_12, x_1, x_24);
|
||||
lean_object* x_25;
|
||||
x_25 = l_Lean_Parser_setLhsPrecFn(x_10, x_1, x_22);
|
||||
lean_dec(x_1);
|
||||
return x_27;
|
||||
return x_25;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
lean_object* x_50; uint8_t x_51; lean_object* x_52;
|
||||
lean_dec(x_8);
|
||||
lean_object* x_48; uint8_t x_49; lean_object* x_50;
|
||||
lean_dec(x_6);
|
||||
lean_dec(x_4);
|
||||
x_50 = l_Lean_Parser_Command_mixfix___elambda__1___closed__19;
|
||||
x_51 = 1;
|
||||
x_52 = l_Lean_Parser_orelseFnCore(x_10, x_50, x_51, x_1, x_2);
|
||||
return x_52;
|
||||
x_48 = l_Lean_Parser_Command_mixfix___elambda__1___closed__19;
|
||||
x_49 = 1;
|
||||
x_50 = l_Lean_Parser_orelseFnCore(x_8, x_48, x_49, x_1, x_2);
|
||||
return x_50;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -14301,7 +14292,7 @@ static lean_object* _init_l_Lean_Parser_Command_mixfix___closed__7() {
|
|||
_start:
|
||||
{
|
||||
lean_object* x_1; lean_object* x_2; lean_object* x_3; lean_object* x_4;
|
||||
x_1 = l_Lean_Parser_optPrecedence;
|
||||
x_1 = l_Lean_Parser_precedence;
|
||||
x_2 = lean_ctor_get(x_1, 0);
|
||||
lean_inc(x_2);
|
||||
x_3 = l_Lean_Parser_Command_mixfix___closed__6;
|
||||
|
|
@ -15031,7 +15022,7 @@ static lean_object* _init_l_Lean_Parser_Command_mixfix_formatter___closed__12()
|
|||
_start:
|
||||
{
|
||||
lean_object* x_1; lean_object* x_2; lean_object* x_3;
|
||||
x_1 = l_Lean_Parser_Syntax_cat_formatter___closed__3;
|
||||
x_1 = l_Lean_Parser_optPrecedence_formatter___closed__1;
|
||||
x_2 = l_Lean_Parser_Command_mixfix_formatter___closed__11;
|
||||
x_3 = lean_alloc_closure((void*)(l_Lean_PrettyPrinter_Formatter_andthen_formatter), 7, 2);
|
||||
lean_closure_set(x_3, 0, x_1);
|
||||
|
|
@ -15722,7 +15713,7 @@ static lean_object* _init_l_Lean_Parser_Command_mixfix_parenthesizer___closed__1
|
|||
_start:
|
||||
{
|
||||
lean_object* x_1; lean_object* x_2; lean_object* x_3;
|
||||
x_1 = l_Lean_Parser_Syntax_cat_parenthesizer___closed__3;
|
||||
x_1 = l_Lean_Parser_optPrecedence_parenthesizer___closed__1;
|
||||
x_2 = l_Lean_Parser_Command_mixfix_parenthesizer___closed__11;
|
||||
x_3 = lean_alloc_closure((void*)(l_Lean_PrettyPrinter_Parenthesizer_andthen_parenthesizer), 7, 2);
|
||||
lean_closure_set(x_3, 0, x_1);
|
||||
|
|
|
|||
793
stage0/stdlib/Lean/PrettyPrinter/Parenthesizer.c
generated
793
stage0/stdlib/Lean/PrettyPrinter/Parenthesizer.c
generated
File diff suppressed because it is too large
Load diff
9684
stage0/stdlib/Lean/Server/FileWorker/RequestHandling.c
generated
9684
stage0/stdlib/Lean/Server/FileWorker/RequestHandling.c
generated
File diff suppressed because it is too large
Load diff
1092
stage0/stdlib/Lean/Syntax.c
generated
1092
stage0/stdlib/Lean/Syntax.c
generated
File diff suppressed because it is too large
Load diff
Loading…
Add table
Reference in a new issue