feat: elaborate double quoted named literals
This commit is contained in:
parent
0af806fb49
commit
ec1e6a68fa
1 changed files with 6 additions and 2 deletions
|
|
@ -1290,12 +1290,16 @@ def elabScientificLit : TermElab := fun stx expectedType? => do
|
|||
| some val => return mkApp (Lean.mkConst `Char.ofNat) (mkNatLit val.toNat)
|
||||
| none => throwIllFormedSyntax
|
||||
|
||||
@[builtinTermElab quotedName] def elabQuotedName : TermElab :=
|
||||
fun stx _ =>
|
||||
@[builtinTermElab quotedName] def elabQuotedName : TermElab := fun stx _ =>
|
||||
match stx[0].isNameLit? with
|
||||
| some val => pure $ toExpr val
|
||||
| none => throwIllFormedSyntax
|
||||
|
||||
@[builtinTermElab doubleQuotedName] def elabDoubleQuotedName : TermElab := fun stx _ => do
|
||||
match stx[1].isNameLit? with
|
||||
| some val => toExpr (← resolveGlobalConstNoOverload val)
|
||||
| none => throwIllFormedSyntax
|
||||
|
||||
@[builtinTermElab typeOf] def elabTypeOf : TermElab := fun stx _ => do
|
||||
inferType (← elabTerm stx[1] none)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue