Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Bring insane up to date with M5

  • Loading branch information...
commit b0b25ebf8f52c2cdf1e7eda785fe35778d92a8b0 1 parent 8545416
@colder authored
View
6 build.sbt
@@ -4,9 +4,9 @@ scalacOptions += "-feature"
scalacOptions += "-unchecked"
-scalaVersion := "2.10.0-M3"
+scalaVersion := "2.10.0-M5"
-scalaHome := Some(file("/home/ekneuss/scala/scala-git/"))
+// scalaHome := Some(file("/home/ekneuss/scala/scala-git/"))
// libraryDependencies += "org.squeryl" %% "squeryl" % "0.9.4"
@@ -14,6 +14,6 @@ libraryDependencies += "com.h2database" % "h2" % "1.2.127"
libraryDependencies += "mysql" % "mysql-connector-java" % "5.1.15"
-libraryDependencies += "org.scala-lang" % "scala-compiler" % "2.10.0-M3"
+libraryDependencies += "org.scala-lang" % "scala-compiler" % "2.10.0-M5"
(scalaSource in Compile) <<= sourceDirectory apply { bd => bd / "insane" }
View
10 src/insane/AST/CodeExtraction.scala
@@ -34,15 +34,15 @@ trait CodeExtraction extends Extractors with Contracts {
try {
annot.atp.safeToString match {
case "insane.annotations.AbstractsClass" =>
- Some(definitions.getClassIfDefined(name))
+ Some(rootMirror.getClassIfDefined(name))
case "insane.annotations.AbstractsModuleClass" =>
- Some(definitions.getModule(newTypeName(name)).moduleClass)
+ Some(rootMirror.getModule(newTypeName(name)).moduleClass)
case _ =>
reporter.error("Could not understand annotation: "+annot, Some(symbol.pos))
None
}
} catch {
- case e =>
+ case e: Throwable =>
reporter.error("Unable to find class symbol from name "+name+": "+e.getMessage, Some(symbol.pos))
None
}
@@ -66,9 +66,9 @@ trait CodeExtraction extends Extractors with Contracts {
val (className, methStr) = methFullName.splitAt(methFullName.lastIndexOf('.'))
val cl = if (annot.atp.safeToString == "insane.annotations.AbstractsMethod") {
- definitions.getClassIfDefined(className)
+ rootMirror.getClassIfDefined(className)
} else {
- definitions.getModule(newTypeName(className)).moduleClass
+ rootMirror.getModule(newTypeName(className)).moduleClass
}
val methName = methStr.tail
View
18 src/insane/AnalysisComponent.scala
@@ -12,7 +12,6 @@ import checks._
import scala.tools.nsc.{Global, Phase}
import scala.tools.nsc.plugins.PluginComponent
-import scala.tools.util.SignalManager
import scala.util.control.Exception.ignoring
abstract class AnalysisComponent(pluginInstance: InsanePlugin, val reporter: Reporter, val settings: Settings)
@@ -61,20 +60,7 @@ abstract class AnalysisComponent(pluginInstance: InsanePlugin, val reporter: Rep
}
}
- def onExit() = {
- reporter.msg("Bailing out...")
- reporter.close()
- sys.exit(1)
- }
-
- def onForcedExit() = {
- reporter.msg("Aarrgh!")
- sys.exit(1)
- }
-
override def run() {
- SignalManager("INT") = onExit()
-
pluginInstance.compilerProgressBar.setPostfix("Done.")
pluginInstance.compilerProgressBar.end();
@@ -88,10 +74,6 @@ abstract class AnalysisComponent(pluginInstance: InsanePlugin, val reporter: Rep
runSubPhases()
reporter.msg("Finished ("+(System.currentTimeMillis-tStart)+"ms)")
- ignoring(classOf[Exception]) {
- SignalManager("INT") = onForcedExit()
- }
-
reporter.close()
sys.exit(0)
View
7 src/insane/CFG/CFGGeneration.scala
@@ -730,6 +730,13 @@ trait CFGGeneration extends CFGTreesDef { self: AnalysisComponent =>
case ARRAY(elem) =>
reporter.error("Unnexpected kind in kindToLit: "+kind)
new CFG.Null
+ case BOXED(elem) =>
+ reporter.error("Unnexpected kind in kindToLit: "+kind)
+ new CFG.Null
+ case ConcatClass =>
+ reporter.error("Unnexpected kind in kindToLit: "+kind)
+ new CFG.Null
+
}
View
21 src/insane/CFG/CFGTreesDef.scala
@@ -145,24 +145,31 @@ trait CFGTreesDef extends ASTBindings { self: AnalysisComponent =>
sealed abstract class LiteralValue extends SimpleValue {
override def tpe: Type = this match {
- case _: CFG.StringLit | _: CFG.AnyStringLit =>
+ case _: CFG.StringLit | _: CFG.AnyStringLit =>
definitions.StringClass.tpe
- case _: CFG.BooleanLit | _: CFG.AnyBooleanLit =>
+ case _: CFG.BooleanLit | _: CFG.AnyBooleanLit =>
definitions.BooleanClass.tpe
- case _: CFG.LongLit | _: CFG.AnyLongLit =>
+ case _: CFG.LongLit | _: CFG.AnyLongLit =>
definitions.LongClass.tpe
- case _: CFG.IntLit | _: CFG.AnyIntLit =>
+ case _: CFG.IntLit | _: CFG.AnyIntLit =>
definitions.IntClass.tpe
- case _: CFG.CharLit | _: CFG.AnyCharLit =>
+ case _: CFG.CharLit | _: CFG.AnyCharLit =>
definitions.CharClass.tpe
case _: CFG.ByteLit | _: CFG.AnyByteLit =>
definitions.ByteClass.tpe
case _: CFG.FloatLit | _: CFG.AnyFloatLit =>
definitions.FloatClass.tpe
- case _: CFG.DoubleLit | _: CFG.AnyDoubleLit =>
+ case _: CFG.DoubleLit | _: CFG.AnyDoubleLit =>
definitions.DoubleClass.tpe
- case _: CFG.ShortLit | _: CFG.AnyShortLit =>
+ case _: CFG.ShortLit | _: CFG.AnyShortLit =>
definitions.ShortClass.tpe
+ case _: CFG.EnumLit =>
+ //TODO
+ definitions.UnitClass.tpe
+ case _: CFG.Unit =>
+ definitions.UnitClass.tpe
+ case cl: CFG.ClassLit =>
+ cl.tpe
}
}
View
4 src/insane/alias/PointToAnalysis.scala
@@ -85,7 +85,7 @@ trait PointToAnalysis extends PointToGraphsDefs with PointToEnvs with PointToLat
case AllScalaStubs() =>
Some(buildPureEffect(sym))
- case _ if definitions.isScalaValueType(sym.owner.tpe) =>
+ case _ if definitions.isPrimitiveValueType(sym.owner.tpe) =>
Some(buildPureEffect(sym))
case ArrayUpdate() =>
@@ -320,7 +320,7 @@ trait PointToAnalysis extends PointToGraphsDefs with PointToEnvs with PointToLat
Some(oldCFG)
} catch {
- case e =>
+ case e: Throwable =>
reporter.decIndent()
throw e
}
View
14 src/insane/storage/Serialization.scala
@@ -117,16 +117,16 @@ trait SerializationHelpers {
read(3) match {
case "cl:" =>
// Class Symbol
- definitions.getClassIfDefined(explicitFullName(readUntil(':')))
+ rootMirror.getClassIfDefined(explicitFullName(readUntil(':')))
case "mc:" =>
// ModuleClass Symbol
- definitions.getModule(explicitFullName(readUntil(':'))).moduleClass
+ rootMirror.getModule(explicitFullName(readUntil(':'))).moduleClass
case t =>
reporter.error("Unnexpected class symbol type: "+t)
NoSymbol
}
} catch {
- case e =>
+ case e: Throwable =>
reporter.error("Unable to unserialize classsymbol: "+e.getMessage)
NoSymbol
}
@@ -141,10 +141,10 @@ trait SerializationHelpers {
read(3) match {
case "cl:" =>
// Class Symbol
- definitions.getClassIfDefined(explicitFullName(readUntil(':')))
+ rootMirror.getClassIfDefined(explicitFullName(readUntil(':')))
case "mc:" =>
// ModuleClass Symbol
- definitions.getModule(explicitFullName(readUntil(':'))).moduleClass
+ rootMirror.getModule(explicitFullName(readUntil(':'))).moduleClass
case "te:" =>
// Term Symbol
val cl = readClassSymbol
@@ -164,7 +164,7 @@ trait SerializationHelpers {
NoSymbol
}
} catch {
- case e =>
+ case e: Throwable =>
reporter.error("Unable to unserialize symbol: "+e.getMessage)
NoSymbol
}
@@ -191,7 +191,7 @@ trait SerializationHelpers {
sys.error("Unnexpected kind of symbol here!")
}
} catch {
- case e =>
+ case e: Throwable =>
write("er:"+s.name+":")
sys.error("Error while writing symbol: "+e.getMessage)
}
View
2  src/insane/utils/Functions.scala
@@ -472,7 +472,7 @@ trait Functions {
}
def safeFullName(sym: Symbol) = {
- try { sym.fullName } catch { case _ => "("+sym.name+")<name-error>" }
+ try { sym.fullName } catch { case _: Throwable => "("+sym.name+")<name-error>" }
}
}
View
4 src/insane/utils/Output.scala
@@ -29,7 +29,7 @@ object OutputHandlers {
print("\033[2J\033[1;1H");
println("Insane connected!")
} catch {
- case e =>
+ case e: Throwable =>
}
}
@@ -55,7 +55,7 @@ object OutputHandlers {
val fw = new FileWriter(path, append)
out = new PrintWriter(fw)
} catch {
- case e =>
+ case e: Throwable =>
}
}
View
2  src/insane/utils/Reporters.scala
@@ -2,7 +2,7 @@ package insane
package utils
import scala.tools.nsc.Global
-import tools.nsc.util._
+import scala.reflect.internal.util.{Position, NoPosition, FakePos}
object Reporters {
Please sign in to comment.
Something went wrong with that request. Please try again.