Internal scala compilation. Working with interactive.Global

Posted by scout on Stack Overflow See other posts from Stack Overflow or by scout
Published on 2010-05-10T04:24:34Z Indexed on 2010/05/10 4:28 UTC
Read the original article Hit count: 210

Filed under:

I am trying to retrieve the AST from scala souce file. I have simplified the code (only relevant code) to following.

trait GetAST {
     val settings = new Settings
     val global = new Global(settings, new ConsoleReporter(settings))
     def getSt = "hello" //global.typedTree(src, true)
}
object Tre extends GetAST {
    def main(args:Array[String])
    {
        println(getSt.getClass)
        println("exiting program")
    }
}

The above code compiles fine and runs fine. But the problem is the program does not exit. The prompt is not displayed after printing "exiting program". I have to use ^c to exit. Any idea what the problem might be

© Stack Overflow or respective owner

Related posts about scala