Skip to content

Instantly share code, notes, and snippets.

@xeno-by
Last active December 21, 2015 07:08
Show Gist options
  • Save xeno-by/6268853 to your computer and use it in GitHub Desktop.
Save xeno-by/6268853 to your computer and use it in GitHub Desktop.
14:57 ~/Projects/Master/sandbox (master)$ parse 'new { val x: Int = 2 } with C'
[[syntax trees at end of parser]]// Scala source: tmpyZGJXb
package <empty> {
class wrapper extends scala.AnyRef {
def <init>() = {
super.<init>();
()
};
{
final class $anon extends C {
val x = _;
def <init>() = {
val x: Int = 2;
super.<init>();
()
}
};
new $anon()
}
}
}
PackageDef(Ident(TermName("<empty>"))#1099603912, List(ClassDef(Modifiers(), TypeName("wrapper"), List(), Template(List(Select(Ident(scala)#649272183, TypeName("AnyRef"))#953169274), emptyValDef, List(DefDef(Modifiers(), nme.CONSTRUCTOR, List(), List(List()), TypeTree()#1835465145, Block(List(pendingSuperCall), Literal(Constant(()))#60102860)#831453930)#570110481, Block(List(
ClassDef(
Modifiers(FINAL),
TypeName("$anon"),
List(),
Template(
List(Ident(TypeName("C"))#79191063),
emptyValDef,
List(
ValDef(
Modifiers(IMPLCLASS/PRESUPER),
TermName("x"),
TypeTree().setOriginal(Ident(TypeName("Int"))#1671818348),
EmptyTree)#574937488,
DefDef(
Modifiers(),
nme.CONSTRUCTOR,
List(),
List(List()),
TypeTree()#1445432963,
Block(List(
ValDef(
Modifiers(IMPLCLASS/PRESUPER),
TermName("x"),
Ident(TypeName("Int"))#1671818348,
Literal(Constant(2))#1056794277)#1851652849,
pendingSuperCall
), Literal(Constant(()))#1543904466)#357453361)#1206877668))#1009920161)#17400039),
Apply(Select(New(Ident(TypeName("$anon"))#384679481)#1382259697, nme.CONSTRUCTOR)#160634233, List())#392609752)#1522338280))#819301602)#336880250))#1179468258
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment