Skip to content

Instantly share code, notes, and snippets.

@Yuichiroh
Created April 2, 2015 06:06
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Yuichiroh/c0057381a596aa2f0256 to your computer and use it in GitHub Desktop.
Save Yuichiroh/c0057381a596aa2f0256 to your computer and use it in GitHub Desktop.
~
% scala -Xprint:parser
Welcome to Scala version 2.11.4 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_25).
Type in expressions to have them evaluated.
Type :help for more information.
scala> [[syntax trees at end of parser]] // <init>
package <empty> {
class $repl_$init extends scala.AnyRef {
def <init>() = {
super.<init>();
()
};
<empty>
}
}
[[syntax trees at end of parser]] // <console>
package $line1 {
object $eval extends scala.AnyRef {
def <init>() = {
super.<init>();
()
};
var value: scala.tools.nsc.interpreter.IMain = _;
def set(x: Any) = value = x.asInstanceOf[scala.tools.nsc.interpreter.IMain]
}
}
[[syntax trees at end of parser]] // <console>
package $line2 {
object $read extends scala.AnyRef {
def <init>() = {
super.<init>();
()
};
object $iw extends scala.AnyRef {
def <init>() = {
super.<init>();
()
};
object $iw extends scala.AnyRef {
def <init>() = {
super.<init>();
()
};
val $intp = $line1.$eval.value
}
}
}
}
[[syntax trees at end of parser]] // <console>
package $line2 {
object $eval extends scala.AnyRef {
def <init>() = {
super.<init>();
()
};
lazy val $result = $line2.$read.$iw.$iw.$intp;
lazy val $print: String = {
$line2.$read.$iw.$iw;
""
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment