Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion generators/GenerateTestFile.lean
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,9 @@ end {pascalExercise}Generator
"
let path := s!"./Generator/Generator/{pascalExercise}Generator.lean"
IO.FS.writeFile path (stripWhiteSpace content ++ "\n")
addImport pascalExercise
match Generator.dispatch.get? pascalExercise with
| none => addImport pascalExercise
| some _ => return

def main (args : List String) : IO Unit := do
match args with
Expand Down
2 changes: 0 additions & 2 deletions generators/Generator/Generator.lean
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import Generator.PrimeFactorsGenerator
import Generator.PrimeFactorsGenerator
import Generator.AllYourBaseGenerator
import Generator.SayGenerator
import Generator.BinarySearchGenerator
Expand All @@ -23,7 +22,6 @@ abbrev extraCasesList := List String

def dispatch : Std.HashMap String (introGenerator × testCaseGenerator × endBodyGenerator) :=
Std.HashMap.ofList [
("PrimeFactors", (PrimeFactorsGenerator.genIntro, PrimeFactorsGenerator.genTestCase, PrimeFactorsGenerator.genEnd)),
("PrimeFactors", (PrimeFactorsGenerator.genIntro, PrimeFactorsGenerator.genTestCase, PrimeFactorsGenerator.genEnd)),
("AllYourBase", (AllYourBaseGenerator.genIntro, AllYourBaseGenerator.genTestCase, AllYourBaseGenerator.genEnd)),
("Say", (SayGenerator.genIntro, SayGenerator.genTestCase, SayGenerator.genEnd)),
Expand Down
Loading