chore: lake: use & check prelude (#6289)
This PR adapts Lake modules to use `prelude` and includes them in the `check-prelude` CI.
This commit is contained in:
parent
b2336fd980
commit
d9d54c1f99
130 changed files with 195 additions and 16 deletions
3
.github/workflows/check-prelude.yml
vendored
3
.github/workflows/check-prelude.yml
vendored
|
|
@ -14,6 +14,7 @@ jobs:
|
|||
sparse-checkout: |
|
||||
src/Lean
|
||||
src/Std
|
||||
src/lake/Lake
|
||||
- name: Check Prelude
|
||||
run: |
|
||||
failed_files=""
|
||||
|
|
@ -21,7 +22,7 @@ jobs:
|
|||
if ! grep -q "^prelude$" "$file"; then
|
||||
failed_files="$failed_files$file\n"
|
||||
fi
|
||||
done < <(find src/Lean src/Std -name '*.lean' -print0)
|
||||
done < <(find src/Lean src/Std src/lake/Lake -name '*.lean' -print0)
|
||||
if [ -n "$failed_files" ]; then
|
||||
echo -e "The following files should use 'prelude':\n$failed_files"
|
||||
exit 1
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ Copyright (c) 2021 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Lake.Build
|
||||
import Lake.Config
|
||||
import Lake.DSL
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ Copyright (c) 2021 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Lake.Build.Run
|
||||
import Lake.Build.Module
|
||||
import Lake.Build.Package
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ Copyright (c) 2017 Microsoft Corporation. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Gabriel Ebner, Sebastian Ullrich, Mac Malone, Siddharth Bhat
|
||||
-/
|
||||
prelude
|
||||
import Lake.Util.Proc
|
||||
import Lake.Util.NativeLib
|
||||
import Lake.Util.IO
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ Copyright (c) 2021 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Lake.Util.Log
|
||||
import Lake.Util.Exit
|
||||
import Lake.Util.Lift
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ Copyright (c) 2021 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Lake.Config.Monad
|
||||
import Lake.Build.Actions
|
||||
import Lake.Util.JsonObject
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ Copyright (c) 2022 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Lake.Build.Key
|
||||
import Lake.Util.Family
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ Copyright (c) 2022 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Lake.Build.Common
|
||||
|
||||
namespace Lake
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ Copyright (c) 2022 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Lake.Build.Job
|
||||
import Lake.Build.Data
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ Copyright (c) 2024 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Lake.Util.Error
|
||||
import Lake.Util.Cycle
|
||||
import Lake.Util.EquipT
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ Copyright (c) 2022 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Lake.Build.Module
|
||||
|
||||
/-!
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ Copyright (c) 2022 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Lake.Build.Executable
|
||||
import Lake.Build.Topological
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ Copyright (c) 2022 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Lake.Config.LeanExe
|
||||
import Lake.Config.ExternLib
|
||||
import Lake.Build.Facets
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ Copyright (c) 2022 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Lake.Util.Task
|
||||
import Lake.Build.Basic
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ Copyright (c) 2022 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Lake.Util.Name
|
||||
|
||||
namespace Lake
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ Copyright (c) 2022 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Lake.Build.Common
|
||||
import Lake.Build.Targets
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ Copyright (c) 2021 Microsoft Corporation. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Sebastian Ullrich, Mac Malone, Siddharth Bhat
|
||||
-/
|
||||
prelude
|
||||
import Lake.Util.OrdHashSet
|
||||
import Lake.Util.List
|
||||
import Lean.Elab.ParseImportsFast
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ Copyright (c) 2022 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Lake.Util.Git
|
||||
import Lake.Util.Sugar
|
||||
import Lake.Build.Common
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ Copyright (c) 2021 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone, Gabriel Ebner, Sebastian Ullrich
|
||||
-/
|
||||
prelude
|
||||
import Lake.Util.Lock
|
||||
import Lake.Build.Index
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ Copyright (c) 2022 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Lake.Build.Data
|
||||
import Lake.Util.StoreInsts
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ Copyright (c) 2023 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Lake.Config.Monad
|
||||
|
||||
/-! # Build Target Fetching
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ Copyright (c) 2022 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Lake.Util.Cycle
|
||||
import Lake.Util.Store
|
||||
import Lake.Util.EquipT
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ Copyright (c) 2021 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Lake.Util.IO
|
||||
import Lean.Data.Json
|
||||
|
||||
|
|
|
|||
|
|
@ -3,4 +3,5 @@ Copyright (c) 2021 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Lake.CLI.Main
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ Copyright (c) 2022 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Lake.Build.Run
|
||||
import Lake.Build.Targets
|
||||
import Lake.CLI.Build
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ Copyright (c) 2021 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Lake.Build.Index
|
||||
import Lake.CLI.Error
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,9 @@ Copyright (c) 2022 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Init.Data.ToString
|
||||
import Init.System.FilePath
|
||||
|
||||
namespace Lake
|
||||
open Lean (Name)
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ Copyright (c) 2017 Microsoft Corporation. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Gabriel Ebner, Sebastian Ullrich, Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Lake.Version
|
||||
|
||||
namespace Lake
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ Copyright (c) 2017 Microsoft Corporation. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Gabriel Ebner, Sebastian Ullrich, Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Lake.Util.Git
|
||||
import Lake.Util.Sugar
|
||||
import Lake.Util.Version
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ Copyright (c) 2021 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Lake.Load
|
||||
import Lake.Build.Imports
|
||||
import Lake.Util.Error
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ Copyright (c) 2022 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Lake.Load
|
||||
import Lake.Build
|
||||
import Lake.Util.MainM
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ Copyright (c) 2024 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Lake.Config.Lang
|
||||
import Lake.Config.Package
|
||||
import Lake.CLI.Translate.Toml
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ Copyright (c) 2024 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Lake.DSL
|
||||
import Lake.Config.Package
|
||||
import Lean.Parser.Module
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ Copyright (c) 2024 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Lake.Toml.Encode
|
||||
import Lake.Config.Package
|
||||
|
||||
|
|
|
|||
|
|
@ -3,4 +3,5 @@ Copyright (c) 2021 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Lake.Config.Monad
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ Copyright (c) 2021 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Lake.Config.Opaque
|
||||
import Lake.Config.InstallPath
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,11 @@ Copyright (c) 2022 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Init.System.FilePath
|
||||
|
||||
namespace Lake
|
||||
|
||||
open System (FilePath)
|
||||
|
||||
/--
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ Copyright (c) 2017 Microsoft Corporation. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Gabriel Ebner, Sebastian Ullrich, Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Init.System.FilePath
|
||||
import Lean.Data.NameMap
|
||||
|
||||
/- # Package Dependency Configuration
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ Copyright (c) 2022 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Lake.Util.Name
|
||||
import Lake.Util.NativeLib
|
||||
import Lake.Config.InstallPath
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ Copyright (c) 2022 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Lake.Config.Package
|
||||
|
||||
namespace Lake
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ Copyright (c) 2022 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Lake.Build.Job
|
||||
import Lake.Build.Data
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ Copyright (c) 2022 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone, Mario Carneiro
|
||||
-/
|
||||
prelude
|
||||
import Lake.Build.Fetch
|
||||
|
||||
namespace Lake
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ Copyright (c) 2021 Microsoft Corporation. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mario Carneiro, Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Lean.Util.Path
|
||||
import Lake.Util.Name
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,9 @@ Copyright (c) 2021 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone
|
||||
-/
|
||||
|
||||
prelude
|
||||
import Init.Control.Option
|
||||
import Lean.Compiler.FFI
|
||||
import Lake.Util.NativeLib
|
||||
import Lake.Config.Defaults
|
||||
|
|
|
|||
|
|
@ -3,6 +3,9 @@ Copyright (c) 2024 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Init.Data.ToString.Basic
|
||||
|
||||
namespace Lake
|
||||
|
||||
/-- Lake configuration language identifier. -/
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ Copyright (c) 2022 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Lean.Util.LeanOptions
|
||||
|
||||
namespace Lake
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ Copyright (c) 2022 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Lake.Config.Module
|
||||
|
||||
namespace Lake
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ Copyright (c) 2022 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Lake.Build.Facets
|
||||
import Lake.Config.LeanConfig
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ Copyright (c) 2022 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Lake.Config.Package
|
||||
|
||||
namespace Lake
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ Copyright (c) 2022 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Lake.Util.Casing
|
||||
import Lake.Build.Facets
|
||||
import Lake.Config.InstallPath
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ Copyright (c) 2022 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Lake.Build.Trace
|
||||
import Lake.Config.LeanLib
|
||||
import Lake.Util.OrdHashSet
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ Copyright (c) 2021 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Lake.Config.Context
|
||||
import Lake.Config.Workspace
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ Copyright (c) 2021 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Lake.Util.Name
|
||||
import Lake.Util.Opaque
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ Copyright (c) 2017 Microsoft Corporation. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Gabriel Ebner, Sebastian Ullrich, Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Lake.Config.Opaque
|
||||
import Lake.Config.Defaults
|
||||
import Lake.Config.LeanLibConfig
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ Copyright (c) 2021 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Lake.Util.Exit
|
||||
import Lake.Config.Context
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ Copyright (c) 2022 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Lake.Build.Fetch
|
||||
|
||||
namespace Lake
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ Copyright (c) 2021 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Lean.Util.Paths
|
||||
import Lake.Config.FacetConfig
|
||||
import Lake.Config.TargetConfig
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ Copyright (c) 2021 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Lake.Config.Defaults
|
||||
|
||||
open System
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ Copyright (c) 2021 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Lake.DSL.DeclUtil
|
||||
import Lake.DSL.Attributes
|
||||
import Lake.DSL.Extensions
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ Copyright (c) 2024 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Lake.DSL.AttributesCore
|
||||
|
||||
open Lean
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ Copyright (c) 2021 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Lake.Util.OrderedTagAttribute
|
||||
|
||||
open Lean
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ Copyright (c) 2021 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Lean.Elab.ElabRules
|
||||
import Lake.DSL.Extensions
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ Copyright (c) 2021 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Lake.DSL.Config
|
||||
import Lake.Util.Binder
|
||||
import Lake.Util.Name
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ Copyright (c) 2021 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Lean.Environment
|
||||
|
||||
open Lean
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ Copyright (c) 2022 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Lean.Elab.Eval
|
||||
import Lean.Elab.ElabRules
|
||||
import Lake.Util.FilePath
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ Copyright (c) 2021 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Lake.Config.Package
|
||||
import Lake.DSL.Attributes
|
||||
import Lake.DSL.DeclUtil
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ Copyright (c) 2021 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Lean.Parser.Command
|
||||
import Lake.Config.Dependency
|
||||
import Lake.DSL.Extensions
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ Copyright (c) 2021 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Lake.Config.Package
|
||||
import Lake.DSL.Attributes
|
||||
import Lake.DSL.DeclUtil
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ Copyright (c) 2022 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Lake.DSL.DeclUtil
|
||||
import Lake.Build.Index
|
||||
|
||||
|
|
|
|||
|
|
@ -3,4 +3,5 @@ Copyright (c) 2022 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Lake.Load.Workspace
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ Copyright (c) 2022 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Lean.Data.Name
|
||||
import Lean.Data.Options
|
||||
import Lake.Config.Defaults
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ Copyright (c) 2024 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Lake.Load.Lean.Elab
|
||||
import Lake.Load.Lean.Eval
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ Copyright (c) 2021 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Lean.Elab.Frontend
|
||||
import Lake.DSL.Extensions
|
||||
import Lake.DSL.Attributes
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ Copyright (c) 2021 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Lake.DSL.Attributes
|
||||
import Lake.Config.Workspace
|
||||
import Lean.DocString
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ Copyright (c) 2022 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone, Gabriel Ebner
|
||||
-/
|
||||
prelude
|
||||
import Lake.Util.Log
|
||||
import Lake.Util.Name
|
||||
import Lake.Util.FilePath
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ Copyright (c) 2017 Microsoft Corporation. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Gabriel Ebner, Sebastian Ullrich, Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Lake.Util.Git
|
||||
import Lake.Load.Manifest
|
||||
import Lake.Config.Dependency
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ Copyright (c) 2024 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Lake.Load.Lean
|
||||
import Lake.Load.Toml
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ Copyright (c) 2022 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone, Gabriel Ebner
|
||||
-/
|
||||
prelude
|
||||
import Lake.Config.Monad
|
||||
import Lake.Util.StoreInsts
|
||||
import Lake.Build.Topological
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ Copyright (c) 2024 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Lake.Toml.Load
|
||||
import Lake.Toml.Decode
|
||||
import Lake.Config.Package
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ Copyright (c) 2024 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Lake.Load.Resolve
|
||||
import Lake.Build.Module
|
||||
import Lake.Build.Package
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ Copyright (c) 2022 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Lake.Util.Log
|
||||
import Lake.Util.Proc
|
||||
import Lake.Util.JsonObject
|
||||
|
|
|
|||
|
|
@ -3,4 +3,5 @@ Copyright (c) 2024 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Lake.Toml.Load
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ Copyright (c) 2024 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Lake.Toml.Data.Value
|
||||
|
||||
/-!
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ Copyright (c) 2024 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Lake.Util.Date
|
||||
|
||||
/-!
|
||||
|
|
|
|||
|
|
@ -3,7 +3,9 @@ Copyright (c) 2024 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Lean.Data.NameMap
|
||||
import Init.Data.Nat.Fold
|
||||
|
||||
/-! # Red-Black Dictionary
|
||||
|
||||
|
|
@ -33,11 +35,10 @@ instance : EmptyCollection (RBDict α β cmp) := ⟨RBDict.empty⟩
|
|||
def mkEmpty (capacity : Nat) : RBDict α β cmp :=
|
||||
{items := .mkEmpty capacity, indices := {}}
|
||||
|
||||
def ofArray (items : Array (α × β)) : RBDict α β cmp := Id.run do
|
||||
let mut indices := mkRBMap α Nat cmp
|
||||
for h : i in [0:items.size] do
|
||||
indices := indices.insert items[i].1 i
|
||||
return {items, indices}
|
||||
def ofArray (items : Array (α × β)) : RBDict α β cmp :=
|
||||
let indices := items.size.fold (init := mkRBMap α Nat cmp) fun i _ indices =>
|
||||
indices.insert items[i].1 i
|
||||
{items, indices}
|
||||
|
||||
protected def beq [BEq (α × β)] (self other : RBDict α β cmp) : Bool :=
|
||||
self.items == other.items
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ Copyright (c) 2024 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Init.Data.Float
|
||||
import Lake.Toml.Data.Dict
|
||||
import Lake.Toml.Data.DateTime
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ Copyright (c) 2024 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Init.System.FilePath
|
||||
import Lake.Toml.Data
|
||||
|
||||
/-!
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ Copyright (c) 2024 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Lake.Toml.Elab.Expression
|
||||
|
||||
/-!
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ Copyright (c) 2024 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Lake.Toml.Elab.Value
|
||||
|
||||
/-!
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ Copyright (c) 2024 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Lean.CoreM
|
||||
import Lake.Toml.Data.Value
|
||||
import Lake.Toml.Grammar
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ Copyright (c) 2024 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Lake.Toml.Data
|
||||
import Lake.Util.FilePath
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ Copyright (c) 2024 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Lake.Toml.ParserUtil
|
||||
|
||||
/-!
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ Copyright (c) 2024 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Lake.Toml.Elab
|
||||
import Lake.Util.Message
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ Copyright (c) 2024 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Lean.Parser
|
||||
import Lean.PrettyPrinter.Formatter
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ Copyright (c) 2021 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Lean.Parser.Term
|
||||
import Lean.Elab.Term
|
||||
import Lean.Expr
|
||||
|
|
|
|||
|
|
@ -3,7 +3,11 @@ Copyright (c) 2022 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Init.Data.String.Basic
|
||||
|
||||
namespace Lake
|
||||
|
||||
open Lean (Name)
|
||||
|
||||
/-- Converts a snake case, kebab case, or lower camel case `String` to upper camel case. -/
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ Copyright (c) 2021 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Init.Data.Array.Basic
|
||||
|
||||
namespace Lake
|
||||
|
||||
|
|
@ -75,8 +77,18 @@ variable [Monad m] [MonadStateOf ArgList m]
|
|||
|
||||
/-- Process a multiple short options grouped together (ex. `-xyz` as `x`, `y`, `z`). -/
|
||||
@[inline] def multiShortOption (handle : Char → m PUnit) (opt : String) : m PUnit := do
|
||||
-- TODO: this code is assuming all characters are ASCII.
|
||||
for i in [1:opt.length] do handle (opt.get ⟨i⟩)
|
||||
let rec loop (p : String.Pos) := do
|
||||
if h : opt.atEnd p then
|
||||
return
|
||||
else
|
||||
handle (opt.get' p h)
|
||||
loop (opt.next' p h)
|
||||
termination_by opt.utf8ByteSize - p.byteIdx
|
||||
decreasing_by
|
||||
simp [String.atEnd] at h
|
||||
apply Nat.sub_lt_sub_left h
|
||||
simp [String.lt_next opt p]
|
||||
loop ⟨1⟩
|
||||
|
||||
/-- Splits a long option of the form `"--long foo bar"` into `--long` and `"foo bar"`. -/
|
||||
@[inline] def longOptionOrSpace (handle : String → m α) (opt : String) : m α :=
|
||||
|
|
@ -102,8 +114,9 @@ variable [Monad m] [MonadStateOf ArgList m]
|
|||
|
||||
/-- Process a short option of the form `-x`, `-x=arg`, `-x arg`, or `-long`. -/
|
||||
@[inline] def shortOption
|
||||
(shortHandle : Char → m α) (longHandle : String → m α)
|
||||
(opt : String) : m α :=
|
||||
(shortHandle : Char → m α) (longHandle : String → m α)
|
||||
(opt : String)
|
||||
: m α :=
|
||||
if opt.length == 2 then -- `-x`
|
||||
shortHandle (opt.get ⟨1⟩)
|
||||
else -- `-c(.+)`
|
||||
|
|
@ -151,7 +164,9 @@ partial def processLeadingOptions (handle : String → m PUnit) : m PUnit := do
|
|||
processLeadingOptions handle
|
||||
|
||||
/-- Process every option and collect the remaining arguments into an `Array`. -/
|
||||
partial def collectArgs (option : String → m PUnit) (args : Array String := #[]) : m (Array String) := do
|
||||
partial def collectArgs
|
||||
(option : String → m PUnit) (args : Array String := #[])
|
||||
: m (Array String) := do
|
||||
if let some arg ← takeArg? then
|
||||
let len := arg.length
|
||||
if len > 1 && arg.get 0 == '-' then -- `-(.+)`
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ Copyright (c) 2022 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Init.Data.Ord
|
||||
|
||||
namespace Lake
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,9 @@ Copyright (c) 2022 Mac Malone. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Init.Control.Except
|
||||
import Init.Data.List.Basic
|
||||
|
||||
namespace Lake
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ Copyright (c) 2022 Microsoft Corporation. All rights reserved.
|
|||
Released under Apache 2.0 license as described in the file LICENSE.
|
||||
Authors: Leonardo de Moura, Mac Malone
|
||||
-/
|
||||
prelude
|
||||
import Lean.Data.RBMap
|
||||
import Lake.Util.Compare
|
||||
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue