20 lines
467 B
Text
20 lines
467 B
Text
/-
|
|
Copyright (c) 2021 Microsoft Corporation. All rights reserved.
|
|
Released under Apache 2.0 license as described in the file LICENSE.
|
|
Authors: Leonardo de Moura
|
|
-/
|
|
namespace Lean.Elab.Term
|
|
/-
|
|
Recall that
|
|
```
|
|
def typeSpec := leading_parser " : " >> termParser
|
|
def optType : Parser := optional typeSpec
|
|
```
|
|
-/
|
|
def expandOptType (ref : Syntax) (optType : Syntax) : Syntax :=
|
|
if optType.isNone then
|
|
mkHole ref
|
|
else
|
|
optType[0][1]
|
|
|
|
end Lean.Elab.Term
|