This repository has been archived by the owner on Aug 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
/
Main.lean
64 lines (59 loc) · 2.24 KB
/
Main.lean
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import LeanInk.CLI
import LeanInk.Analysis
import LeanInk.Version
open LeanInk
open LeanInk.CLI
open LeanInk.CLI.Argument
def app : AppInfo := {
name := "LeanInk"
base := "leanInk"
version := { major := 1, minor := 0, patch := 0 }
description := "LeanInk is a code analysis tool for Lean 4 that extracts proof tactic information. It's main goal is to ease the support for Lean 4 in Alectryon."
}
def analyzeCommand : Command := {
identifiers := ["analyze", "a"]
help := "Analyzes the given input file and outputs the results in Alectryons fragment json format."
additionalUsageInfo := "<INPUT_FILE>"
arguments := [
environment {
identifiers := ["--lake"]
help := "Specify path to lakefile.lean, so dependencies can be resolved during analysis. Default: none"
},
flag {
identifiers := ["--verbose"]
help := "Enables verbose output."
},
flag {
identifiers := ["--prettify-output"]
help := "Prettifies the .leanInk output file"
},
flag {
identifiers := ["--x-enable-type-info"]
help := "Enables output of experimental type info support for Alectryon. Alectryon will show a hover popup with type information for certain tokens."
},
flag {
identifiers := ["--x-enable-docStrings"]
help := "Enables output of experimental docStrings support for Alectryon. Alectryon will show a hover popup with the docString for tactics and terms if available."
},
flag {
identifiers := ["--x-enable-semantic-token"],
help := "Enables output of experimental semantic token support for Alectryon. Alectryon uses this information to implement semantic syntax highlighting."
},
flag {
identifiers := ["--x-disable-sorry-info"],
help := "Disables alectryon bubbles on blocks containing sorry's."
},
flag {
identifiers := ["--x-disable-calc-info"],
help := "Disables alectryon bubbles on calc blocks."
}
]
run := Analysis.exec
}
def leanVersionCommand : Command := {
identifiers := ["leanVersion", "lV"],
help := "Returns the lean version supported by this leanInk instance.",
arguments := [],
run := λ _ _ => Version.printLeanVersion
}
def main : List String -> IO UInt32 := runCLI app [analyzeCommand, leanVersionCommand]