Zulip Chat Archive

Stream: lean4

Topic: reformat script


Patrick Massot (Nov 28 2022 at 14:33):

Is there any way to play with the tools that sit in script/reformat.lean? Building lean doesn't seem to create an executable for that file.

Sebastian Ullrich (Nov 28 2022 at 14:33):

I think you can just use lean --run

Patrick Massot (Nov 28 2022 at 14:38):

I guess I would need to run that from a project whose lean-tool-chain correspond to the version of the lean4 repo where this script is sitting?

Patrick Massot (Nov 28 2022 at 14:41):

It doesn't seem to work :sad:

Patrick Massot (Nov 28 2022 at 14:41):

Is this script tested by CI and meant to work or could it be outdated?

Sebastian Ullrich (Nov 28 2022 at 14:47):

Its syntax is definitely outdated, and it might not work with --run after all. Also, I don't think you will be impressed by its current output.

Kyle Miller (Nov 28 2022 at 14:47):

@Patrick Massot I got it up to date (at least as far as getting it to run):

reformat.lean

Patrick Massot (Nov 28 2022 at 14:47):

Thanks Kyle!

Patrick Massot (Nov 28 2022 at 14:48):

My goal isn't to be impressed by its output, I only want to understand how it works because we try to understand how InfoTree are usable.

Sebastian Ullrich (Nov 28 2022 at 14:49):

It only uses the info tree superficially though to extract the syntax tree and environment of each command. The language server is the main user of the info tree.

Kyle Miller (Nov 28 2022 at 14:49):

This is only extracting the syntax from each command's infotree and then pretty printing it (edit: what Sebastian said)

Patrick Massot (Nov 28 2022 at 14:50):

That file seemed easier to read than the language server...


Last updated: Dec 20 2023 at 11:08 UTC