mirror of https://github.com/sbt/sbt.git
Merge pull request #3802 from cunei/wip-templateStats-2
Revert "Alt scala parser sync workaround"
This commit is contained in:
commit
609329b19e
|
|
@ -116,9 +116,7 @@ private[sbt] object SbtParser {
|
||||||
scalacGlobalInitReporter = Some(new ConsoleReporter(settings))
|
scalacGlobalInitReporter = Some(new ConsoleReporter(settings))
|
||||||
|
|
||||||
// Mix Positions, otherwise global ignores -Yrangepos
|
// Mix Positions, otherwise global ignores -Yrangepos
|
||||||
val global = new Global(settings, globalReporter) with Positions {
|
val global = new Global(settings, globalReporter) with Positions
|
||||||
override protected def synchronizeNames = true // https://github.com/scala/bug/issues/10605
|
|
||||||
}
|
|
||||||
val run = new global.Run
|
val run = new global.Run
|
||||||
// Add required dummy unit for initialization...
|
// Add required dummy unit for initialization...
|
||||||
val initFile = new BatchSourceFile("<wrapper-init>", "")
|
val initFile = new BatchSourceFile("<wrapper-init>", "")
|
||||||
|
|
@ -151,7 +149,9 @@ private[sbt] object SbtParser {
|
||||||
val wrapperFile = new BatchSourceFile(reporterId, code)
|
val wrapperFile = new BatchSourceFile(reporterId, code)
|
||||||
val unit = new CompilationUnit(wrapperFile)
|
val unit = new CompilationUnit(wrapperFile)
|
||||||
val parser = new syntaxAnalyzer.UnitParser(unit)
|
val parser = new syntaxAnalyzer.UnitParser(unit)
|
||||||
val parsedTrees = parser.templateStats()
|
val parsedTrees = SbtParser.synchronized { // see https://github.com/scala/bug/issues/10605
|
||||||
|
parser.templateStats()
|
||||||
|
}
|
||||||
parser.accept(scala.tools.nsc.ast.parser.Tokens.EOF)
|
parser.accept(scala.tools.nsc.ast.parser.Tokens.EOF)
|
||||||
globalReporter.throwParserErrorsIfAny(reporter, filePath)
|
globalReporter.throwParserErrorsIfAny(reporter, filePath)
|
||||||
parsedTrees -> reporterId
|
parsedTrees -> reporterId
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue