diff options
author | Den Shabalin <den.shabalin@gmail.com> | 2013-12-06 18:01:05 +0100 |
---|---|---|
committer | Den Shabalin <den.shabalin@gmail.com> | 2013-12-12 15:49:16 +0100 |
commit | 760df9843a910d6c3618e490c752eb03fb6924bd (patch) | |
tree | 0ae30fa878ea53812dcd58f1acbab342e562d698 /src/reflect | |
parent | b345b42cac64aa97e3bbcc6f14ef8f08214ab56f (diff) | |
download | scala-760df9843a910d6c3618e490c752eb03fb6924bd.tar.gz scala-760df9843a910d6c3618e490c752eb03fb6924bd.tar.bz2 scala-760df9843a910d6c3618e490c752eb03fb6924bd.zip |
SI-8030 force symbols on presentation compiler initialization
This commit forces a number of built-in symbols in presentation
compiler to prevent them from being entered during parsing.
The property “parsing doesn’t enter new symbols” is tested on
a rich source file that contains significant number of variations
of Scala syntax.
Diffstat (limited to 'src/reflect')
-rw-r--r-- | src/reflect/scala/reflect/internal/TreeGen.scala | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/reflect/scala/reflect/internal/TreeGen.scala b/src/reflect/scala/reflect/internal/TreeGen.scala index a0bd64f850..6269004298 100644 --- a/src/reflect/scala/reflect/internal/TreeGen.scala +++ b/src/reflect/scala/reflect/internal/TreeGen.scala @@ -16,8 +16,7 @@ abstract class TreeGen extends macros.TreeBuilder { def rootScalaDot(name: Name) = Select(rootId(nme.scala_) setSymbol ScalaPackage, name) def scalaDot(name: Name) = Select(Ident(nme.scala_) setSymbol ScalaPackage, name) def scalaAnnotationDot(name: Name) = Select(scalaDot(nme.annotation), name) - def scalaAnyRefConstrRaw = scalaDot(tpnme.AnyRef) - def scalaAnyRefConstr = scalaAnyRefConstrRaw setSymbol AnyRefClass // used in ide + def scalaAnyRefConstr = scalaDot(tpnme.AnyRef) // used in ide def scalaFunctionConstr(argtpes: List[Tree], restpe: Tree, abstractFun: Boolean = false): Tree = { val cls = if (abstractFun) @@ -393,7 +392,7 @@ abstract class TreeGen extends macros.TreeBuilder { def mkParents(ownerMods: Modifiers, parents: List[Tree], parentPos: Position = NoPosition) = if (ownerMods.isCase) parents ::: List(scalaDot(tpnme.Product), scalaDot(tpnme.Serializable)) - else if (parents.isEmpty) atPos(parentPos)(scalaAnyRefConstrRaw) :: Nil + else if (parents.isEmpty) atPos(parentPos)(scalaAnyRefConstr) :: Nil else parents def mkClassDef(mods: Modifiers, name: TypeName, tparams: List[TypeDef], templ: Template): ClassDef = { |