It allow us to process `open .. in ..` while parsing. This is useful for activating a scoped parser while parsing. TODO: `openOnly` and `openHiding`, these two cases are rarely used with `open .. in ..` closes #529
24 lines
422 B
Text
24 lines
422 B
Text
import Lean
|
|
|
|
namespace Foo
|
|
def f (x y : Nat) := x + y + x
|
|
scoped infix:65 " ++ " => f
|
|
end Foo
|
|
|
|
open Foo in
|
|
def f1 (x : Nat) := x ++ x
|
|
|
|
#print f1
|
|
|
|
def f2 (x : Nat) := open Foo in x ++ x
|
|
|
|
#print f2
|
|
|
|
open Foo in
|
|
#print f1
|
|
|
|
open Lean.Parser.Command in
|
|
def syntaxMatcher : Unit :=
|
|
match Lean.Syntax.missing with
|
|
| `(declId|$id:ident$[.{$ls,*}]?) => () -- unknown parser declId
|
|
| _ => ()
|