All Downloads are FREE. Search and download functionalities are using the official Maven repository.

scala.meta.internal.metap.Main.scala Maven / Gradle / Ivy

There is a newer version: 4.12.2
Show newest version
package scala.meta.internal.metap

import scala.meta.cli._
import scala.meta.internal.semanticdb._
import scala.meta.metap._

class Main(settings: Settings, reporter: Reporter) {
  def process(): Boolean = {

    var success = true
    var first = true
    Locator(settings.paths) { (path, payload) =>
      if (first) first = false else reporter.out.println("")
      try
        if (settings.format.isProto) reporter.out.println(payload.toProtoString)
        else payload.documents.foreach { document =>
          val printer = new DocumentPrinter(settings, reporter, document)
          printer.print()
        }
      catch {
        case ex: Throwable =>
          reporter.err.println(s"error: can't decompile $path")
          ex.printStackTrace(reporter.err)
          success = false
      }
    }
    success
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy