diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2013-02-25 00:49:39 +0100 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2013-02-25 01:48:56 +0100 |
commit | 6d94b35270485a5ec64f32035537c3c4c0f02dae (patch) | |
tree | e603e0973d635354edc8d44e2c07b757817abfd0 /src/compiler/scala/reflect/reify | |
parent | 256e46824636881f067ea0d312b5cbcdffbcf233 (diff) | |
download | scala-6d94b35270485a5ec64f32035537c3c4c0f02dae.tar.gz scala-6d94b35270485a5ec64f32035537c3c4c0f02dae.tar.bz2 scala-6d94b35270485a5ec64f32035537c3c4c0f02dae.zip |
Modernize legacy backquotes in comments.
Was: ``blah''
Now: `blah`
Diffstat (limited to 'src/compiler/scala/reflect/reify')
7 files changed, 22 insertions, 22 deletions
diff --git a/src/compiler/scala/reflect/reify/Reifier.scala b/src/compiler/scala/reflect/reify/Reifier.scala index b3224b1aa6..9cf069fe98 100644 --- a/src/compiler/scala/reflect/reify/Reifier.scala +++ b/src/compiler/scala/reflect/reify/Reifier.scala @@ -6,9 +6,9 @@ import scala.reflect.macros.UnexpectedReificationException import scala.reflect.reify.utils.Utils /** Given a tree or a type, generate a tree that when executed at runtime produces the original tree or type. - * See more info in the comments to ``reify'' in scala.reflect.api.Universe. + * See more info in the comments to `reify` in scala.reflect.api.Universe. * - * @author Martin Odersky + * @author Martin Odersky * @version 2.10 */ abstract class Reifier extends States @@ -32,7 +32,7 @@ abstract class Reifier extends States override def hasReifier = true /** - * For ``reifee'' and other reification parameters, generate a tree of the form + * For `reifee` and other reification parameters, generate a tree of the form * * { * val $u: universe.type = <[ universe ]> diff --git a/src/compiler/scala/reflect/reify/codegen/GenTrees.scala b/src/compiler/scala/reflect/reify/codegen/GenTrees.scala index df2eeaa932..78bdf7e132 100644 --- a/src/compiler/scala/reflect/reify/codegen/GenTrees.scala +++ b/src/compiler/scala/reflect/reify/codegen/GenTrees.scala @@ -15,7 +15,7 @@ trait GenTrees { /** * Reify a tree. - * For internal use only, use ``reified'' instead. + * For internal use only, use `reified` instead. */ def reifyTree(tree: Tree): Tree = { assert(tree != null, "tree is null") @@ -29,12 +29,12 @@ trait GenTrees { // the idea behind the new reincarnation of reifier is a simple maxim: // - // never call ``reifyType'' to reify a tree + // never call `reifyType` to reify a tree // // this works because the stuff we are reifying was once represented with trees only // and lexical scope information can be fully captured by reifying symbols // - // to enable this idyll, we work hard in the ``Reshape'' phase + // to enable this idyll, we work hard in the `Reshape` phase // which replaces all types with equivalent trees and works around non-idempotencies of the typechecker // // why bother? because this brings method to the madness @@ -65,7 +65,7 @@ trait GenTrees { } // usually we don't reify symbols/types, because they can be re-inferred during subsequent reflective compilation - // however, reification of AnnotatedTypes is special. see ``reifyType'' to find out why. + // however, reification of AnnotatedTypes is special. see `reifyType` to find out why. if (reifyTreeSymbols && tree.hasSymbolField) { if (reifyDebug) println("reifying symbol %s for tree %s".format(tree.symbol, tree)) rtree = mirrorBuildCall(nme.setSymbol, rtree, reify(tree.symbol)) @@ -86,13 +86,13 @@ trait GenTrees { case TreeSplice(splicee) => if (reifyDebug) println("splicing " + tree) - // see ``Metalevels'' for more info about metalevel breaches + // see `Metalevels` for more info about metalevel breaches // and about how we deal with splices that contain them val isMetalevelBreach = splicee exists (sub => sub.hasSymbolField && sub.symbol != NoSymbol && sub.symbol.metalevel > 0) val isRuntimeEval = splicee exists (sub => sub.hasSymbolField && sub.symbol == ExprSplice) if (isMetalevelBreach || isRuntimeEval) { // we used to convert dynamic splices into runtime evals transparently, but we no longer do that - // why? see comments in ``Metalevels'' + // why? see comments in `Metalevels` // if (reifyDebug) println("splicing has failed: cannot splice when facing a metalevel breach") // EmptyTree CannotReifyRuntimeSplice(tree) @@ -102,7 +102,7 @@ trait GenTrees { // we intentionally don't care about the prefix (the first underscore in the `RefiedTree` pattern match) case ReifiedTree(_, _, inlinedSymtab, rtree, _, _, _) => if (reifyDebug) println("inlining the splicee") - // all free vars local to the enclosing reifee should've already been inlined by ``Metalevels'' + // all free vars local to the enclosing reifee should've already been inlined by `Metalevels` for (sym <- inlinedSymtab.syms if sym.isLocalToReifee) abort("local free var, should have already been inlined by Metalevels: " + inlinedSymtab.symDef(sym)) state.symtab ++= inlinedSymtab diff --git a/src/compiler/scala/reflect/reify/codegen/GenTypes.scala b/src/compiler/scala/reflect/reify/codegen/GenTypes.scala index d389f3571b..6c94726231 100644 --- a/src/compiler/scala/reflect/reify/codegen/GenTypes.scala +++ b/src/compiler/scala/reflect/reify/codegen/GenTypes.scala @@ -9,7 +9,7 @@ trait GenTypes { /** * Reify a type. - * For internal use only, use ``reified'' instead. + * For internal use only, use `reified` instead. */ def reifyType(tpe: Type): Tree = { assert(tpe != null, "tpe is null") diff --git a/src/compiler/scala/reflect/reify/phases/Calculate.scala b/src/compiler/scala/reflect/reify/phases/Calculate.scala index 5566fd7a77..abd179b24b 100644 --- a/src/compiler/scala/reflect/reify/phases/Calculate.scala +++ b/src/compiler/scala/reflect/reify/phases/Calculate.scala @@ -29,7 +29,7 @@ trait Calculate { * Merely traverses the reifiee and records local symbols along with their metalevels. */ val calculate = new Traverser { - // see the explanation of metalevels in ``Metalevels'' + // see the explanation of metalevels in `Metalevels` var currMetalevel = 1 override def traverse(tree: Tree): Unit = tree match { diff --git a/src/compiler/scala/reflect/reify/phases/Metalevels.scala b/src/compiler/scala/reflect/reify/phases/Metalevels.scala index cccf080dbf..18ea908cdf 100644 --- a/src/compiler/scala/reflect/reify/phases/Metalevels.scala +++ b/src/compiler/scala/reflect/reify/phases/Metalevels.scala @@ -40,15 +40,15 @@ trait Metalevels { * However, how exactly do we do that in the case of y.splice? In this very scenario we can use dataflow analysis and inline it, * but what if y were a var, and what if it were calculated randomly at runtime? * - * This question has a genuinely simple answer. Sure, we cannot resolve such splices statically (i.e. during macro expansion of ``reify''), + * This question has a genuinely simple answer. Sure, we cannot resolve such splices statically (i.e. during macro expansion of `reify`), * but now we have runtime toolboxes, so noone stops us from picking up that reified tree and evaluating it at runtime - * (in fact, this is something that ``Expr.splice'' does transparently). + * (in fact, this is something that `Expr.splice` does transparently). * * This is akin to early vs late binding dilemma. * The prior is faster, plus, the latter (implemented with reflection) might not work because of visibility issues or might be not available on all platforms. * But the latter still has its uses, so I'm allowing metalevel breaches, but introducing the -Xlog-runtime-evals to log them. * - * upd. We no longer do that. In case of a runaway ``splice'' inside a `reify`, one will get a static error. + * upd. We no longer do that. In case of a runaway `splice` inside a `reify`, one will get a static error. * Why? Unfortunately, the cute idea of transparently converting between static and dynamic splices has failed. * 1) Runtime eval that services dynamic splices requires scala-compiler.jar, which might not be on library classpath * 2) Runtime eval incurs a severe performance penalty, so it'd better to be explicit about it @@ -136,7 +136,7 @@ trait Metalevels { } else { withinSplice { super.transform(tree) } } - // todo. also inline usages of ``inlineableBindings'' in the symtab itself + // todo. also inline usages of `inlineableBindings` in the symtab itself // e.g. a free$Foo can well use free$x, if Foo is path-dependent w.r.t x // FreeRef(_, _) check won't work, because metalevels of symbol table and body are different, hence, freerefs in symbol table look different from freerefs in body case FreeRef(_, name) if inlineableBindings contains name => diff --git a/src/compiler/scala/reflect/reify/phases/Reify.scala b/src/compiler/scala/reflect/reify/phases/Reify.scala index eda4cba2bf..143424dac5 100644 --- a/src/compiler/scala/reflect/reify/phases/Reify.scala +++ b/src/compiler/scala/reflect/reify/phases/Reify.scala @@ -35,7 +35,7 @@ trait Reify extends GenSymbols /** * Reifies any supported value. - * For internal use only, use ``reified'' instead. + * For internal use only, use `reified` instead. */ def reify(reifee: Any): Tree = reifyStack.push(reifee)(reifee match { // before adding some case here, in global scope, please, consider diff --git a/src/compiler/scala/reflect/reify/phases/Reshape.scala b/src/compiler/scala/reflect/reify/phases/Reshape.scala index 4c27ba4da1..50ee379c2e 100644 --- a/src/compiler/scala/reflect/reify/phases/Reshape.scala +++ b/src/compiler/scala/reflect/reify/phases/Reshape.scala @@ -130,8 +130,8 @@ trait Reshape { * * NB: This is the trickiest part of reification! * - * In most cases, we're perfectly fine to reify a Type itself (see ``reifyType''). - * However if the type involves a symbol declared inside the quasiquote (i.e. registered in ``boundSyms''), + * In most cases, we're perfectly fine to reify a Type itself (see `reifyType`). + * However if the type involves a symbol declared inside the quasiquote (i.e. registered in `boundSyms`), * then we cannot reify it, or otherwise subsequent reflective compilation will fail. * * Why will it fail? Because reified deftrees (e.g. ClassDef(...)) will generate fresh symbols during that compilation, @@ -139,7 +139,7 @@ trait Reshape { * https://issues.scala-lang.org/browse/SI-5230 * * To deal with this unpleasant fact, we need to fall back from types to equivalent trees (after all, parser trees don't contain any types, just trees, so it should be possible). - * Luckily, these original trees get preserved for us in the ``original'' field when Trees get transformed into TypeTrees. + * Luckily, these original trees get preserved for us in the `original` field when Trees get transformed into TypeTrees. * And if an original of a type tree is empty, we can safely assume that this type is non-essential (e.g. was inferred/generated by the compiler). * In that case the type can be omitted (e.g. reified as an empty TypeTree), since it will be inferred again later on. * @@ -156,8 +156,8 @@ trait Reshape { * upd. There are also problems with CompoundTypeTrees. I had to use attachments to retain necessary information. * * upd. Recently I went ahead and started using original for all TypeTrees, regardless of whether they refer to local symbols or not. - * As a result, ``reifyType'' is never called directly by tree reification (and, wow, it seems to work great!). - * The only usage of ``reifyType'' now is for servicing typetags, however, I have some ideas how to get rid of that as well. + * As a result, `reifyType` is never called directly by tree reification (and, wow, it seems to work great!). + * The only usage of `reifyType` now is for servicing typetags, however, I have some ideas how to get rid of that as well. */ private def isDiscarded(tt: TypeTree) = tt.original == null private def toPreTyperTypeTree(tt: TypeTree): Tree = { |