Permalink
Browse files

Removed old unused code from GenerateStandardLib.kt

  • Loading branch information...
1 parent ef391f0 commit f4a5103867bcbe4fa344a9a218cdd6151ee59a83 Evgeny Gerashchenko committed Mar 20, 2013
Showing with 0 additions and 45 deletions.
  1. +0 −45 libraries/tools/kotlin-stdlib-gen/src/generators/GenerateStandardLib.kt
@@ -9,51 +9,6 @@ private val COMMON_AUTOGENERATED_WARNING: String = """//
// See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib
//"""
-fun generateFile(outFile: File, header: String, inputFile: File, f: (String)-> String) {
- generateFile(outFile, header, arrayListOf(inputFile), f)
-}
-
-fun generateFile(outFile: File, header: String, inputFile: File, jvmFile: File, f: (String)-> String) {
- generateFile(outFile, header, arrayListOf(inputFile, jvmFile), f)
-}
-
-fun generateFile(outFile: File, header: String, inputFiles: List<File>, f: (String)-> String) {
- outFile.getParentFile()?.mkdirs()
- val writer = PrintWriter(FileWriter(outFile))
- try {
- writer.println(header)
-
- for (file in inputFiles) {
- writer.println("""
-$COMMON_AUTOGENERATED_WARNING
-// Generated from input file: $file
-//
-""")
-
- println("Parsing $file and writing $outFile")
- val reader = FileReader(file).buffered()
- try {
- // TODO ideally we'd use a filterNot() here :)
- val iter = reader.lineIterator()
- while (iter.hasNext()) {
- val line = iter.next()
-
- if (line.startsWith("package")) continue
-
- val xform = f(line)
- writer.println(xform)
- }
- } finally {
- reader.close()
- reader.close()
- }
- }
- } finally {
- writer.close()
- }
-}
-
-
/**
* Generates methods in the standard library which are mostly identical
* but just using a different input kind.

0 comments on commit f4a5103

Please sign in to comment.