Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Removed old unused code from GenerateStandardLib.kt

  • Loading branch information...
commit f4a5103867bcbe4fa344a9a218cdd6151ee59a83 1 parent ef391f0
Evgeny Gerashchenko geevee authored
45 libraries/tools/kotlin-stdlib-gen/src/generators/GenerateStandardLib.kt
@@ -9,51 +9,6 @@ private val COMMON_AUTOGENERATED_WARNING: String = """//
9 9 // See: https://github.com/JetBrains/kotlin/tree/master/libraries/stdlib
10 10 //"""
11 11
12   -fun generateFile(outFile: File, header: String, inputFile: File, f: (String)-> String) {
13   - generateFile(outFile, header, arrayListOf(inputFile), f)
14   -}
15   -
16   -fun generateFile(outFile: File, header: String, inputFile: File, jvmFile: File, f: (String)-> String) {
17   - generateFile(outFile, header, arrayListOf(inputFile, jvmFile), f)
18   -}
19   -
20   -fun generateFile(outFile: File, header: String, inputFiles: List<File>, f: (String)-> String) {
21   - outFile.getParentFile()?.mkdirs()
22   - val writer = PrintWriter(FileWriter(outFile))
23   - try {
24   - writer.println(header)
25   -
26   - for (file in inputFiles) {
27   - writer.println("""
28   -$COMMON_AUTOGENERATED_WARNING
29   -// Generated from input file: $file
30   -//
31   -""")
32   -
33   - println("Parsing $file and writing $outFile")
34   - val reader = FileReader(file).buffered()
35   - try {
36   - // TODO ideally we'd use a filterNot() here :)
37   - val iter = reader.lineIterator()
38   - while (iter.hasNext()) {
39   - val line = iter.next()
40   -
41   - if (line.startsWith("package")) continue
42   -
43   - val xform = f(line)
44   - writer.println(xform)
45   - }
46   - } finally {
47   - reader.close()
48   - reader.close()
49   - }
50   - }
51   - } finally {
52   - writer.close()
53   - }
54   -}
55   -
56   -
57 12 /**
58 13 * Generates methods in the standard library which are mostly identical
59 14 * but just using a different input kind.

0 comments on commit f4a5103

Please sign in to comment.
Something went wrong with that request. Please try again.