Zulip Chat Archive
Stream: Is there code for X?
Topic: Find open statements in syntax
Michael Rothgang (Feb 17 2025 at 14:00):
Inspired by this PR review comment: I wrote a function
/-- If `stx` is syntax describing an `open` command, `extractOpenNames stx`
returns an array of the syntax corresponding to the opened names,
omitting any renamed or hidden items. -/
def extractOpenNames : Syntax → Array Syntax
| `(command|open $args*) => args
-- further cases omitted
and @Damiano Testa suspected it already exists. Neither he nor I can find it, though: if you know where it is, that would be appreciated!
Last updated: May 02 2025 at 03:31 UTC