Skip to content

Commit

Permalink
Modernize legacy backquotes in comments.
Browse files Browse the repository at this point in the history
Was: ``blah''
Now: `blah`
  • Loading branch information
retronym committed Feb 25, 2013
1 parent 256e468 commit 6d94b35
Show file tree
Hide file tree
Showing 19 changed files with 52 additions and 52 deletions.
6 changes: 3 additions & 3 deletions src/compiler/scala/reflect/reify/Reifier.scala
Expand Up @@ -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
Expand All @@ -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 ]>
Expand Down
14 changes: 7 additions & 7 deletions src/compiler/scala/reflect/reify/codegen/GenTrees.scala
Expand Up @@ -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")
Expand All @@ -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
Expand Down Expand Up @@ -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))
Expand All @@ -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)
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/scala/reflect/reify/codegen/GenTypes.scala
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/scala/reflect/reify/phases/Calculate.scala
Expand Up @@ -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 {
Expand Down
8 changes: 4 additions & 4 deletions src/compiler/scala/reflect/reify/phases/Metalevels.scala
Expand Up @@ -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
Expand Down Expand Up @@ -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 =>
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/scala/reflect/reify/phases/Reify.scala
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions src/compiler/scala/reflect/reify/phases/Reshape.scala
Expand Up @@ -130,16 +130,16 @@ 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,
* so naively reified symbols will become out of sync, which brings really funny compilation errors and/or crashes, e.g.:
* 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.
*
Expand All @@ -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 = {
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/scala/tools/nsc/doc/DocFactory.scala
Expand Up @@ -14,7 +14,7 @@ import scala.reflect.internal.util.BatchSourceFile
* documentation, which is as follows.
*
* * A simplified compiler instance (with only the front-end phases enabled)
* * is created, and additional ''sourceless'' comments are registered.
* * is created, and additional `sourceless` comments are registered.
* * Documentable files are compiled, thereby filling the compiler's symbol table.
* * A documentation model is extracted from the post-compilation symbol table.
* * A generator is used to transform the model into the correct final format (HTML).
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/scala/tools/nsc/typechecker/Implicits.scala
Expand Up @@ -1113,7 +1113,7 @@ trait Implicits {
case ThisType(thisSym) =>
gen.mkAttributedThis(thisSym)
case _ =>
// if ``pre'' is not a PDT, e.g. if someone wrote
// if `pre` is not a PDT, e.g. if someone wrote
// implicitly[scala.reflect.macros.Context#TypeTag[Int]]
// then we need to fail, because we don't know the prefix to use during type reification
// upd. we also need to fail silently, because this is a very common situation
Expand Down
6 changes: 3 additions & 3 deletions src/compiler/scala/tools/nsc/typechecker/Typers.scala
Expand Up @@ -181,7 +181,7 @@ trait Typers extends Adaptations with Tags {
def inferView(tree: Tree, from: Type, to: Type, reportAmbiguous: Boolean): Tree =
inferView(tree, from, to, reportAmbiguous, true)

/** Infer an implicit conversion (``view'') between two types.
/** Infer an implicit conversion (`view`) between two types.
* @param tree The tree which needs to be converted.
* @param from The source type of the conversion
* @param to The target type of the conversion
Expand Down Expand Up @@ -1964,14 +1964,14 @@ trait Typers extends Adaptations with Tags {
}

/** Remove definition annotations from modifiers (they have been saved
* into the symbol's ``annotations'' in the type completer / namer)
* into the symbol's `annotations` in the type completer / namer)
*
* However reification does need annotation definitions to proceed.
* Unfortunately, AnnotationInfo doesn't provide enough info to reify it in general case.
* The biggest problem is with the "atp: Type" field, which cannot be reified in some situations
* that involve locally defined annotations. See more about that in Reifiers.scala.
*
* That's why the original tree gets saved into ``original'' field of AnnotationInfo (happens elsewhere).
* That's why the original tree gets saved into `original` field of AnnotationInfo (happens elsewhere).
* The field doesn't get pickled/unpickled and exists only during a single compilation run.
* This simultaneously allows us to reify annotations and to preserve backward compatibility.
*/
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/scala/tools/nsc/util/DocStrings.scala
Expand Up @@ -74,7 +74,7 @@ object DocStrings {
else idx :: findAll(str, idx)(p)
}

/** Produces a string index, which is a list of ``sections'', i.e
/** Produces a string index, which is a list of `sections`, i.e
* pairs of start/end positions of all tagged sections in the string.
* Every section starts with an at sign and extends to the next at sign,
* or to the end of the comment string, but excluding the final two
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/scala/tools/reflect/package.scala
Expand Up @@ -32,7 +32,7 @@ package object reflect {

/** Creates a reporter that prints messages to the console according to the settings.
*
* ``minSeverity'' determines minimum severity of the messages to be printed.
* `minSeverity` determines minimum severity of the messages to be printed.
* 0 stands for INFO, 1 stands for WARNING and 2 stands for ERROR.
*/
// todo. untangle warningsAsErrors from Reporters. I don't feel like moving this flag here!
Expand Down
4 changes: 2 additions & 2 deletions src/library/scala/util/Either.scala
Expand Up @@ -21,7 +21,7 @@ import scala.language.implicitConversions
* [[scala.util.Right]] takes the place of [[scala.Some]]. Convention dictates
* that Left is used for failure and Right is used for success.
*
* For example, you could use ``Either[String, Int]`` to detect whether a
* For example, you could use `Either[String, Int]` to detect whether a
* received input is a String or an Int.
*
* {{{
Expand Down Expand Up @@ -205,7 +205,7 @@ final case class Right[+A, +B](b: B) extends Either[A, B] {
object Either {

/**
* Allows use of a ``merge`` method to extract values from Either instances
* Allows use of a `merge` method to extract values from Either instances
* regardless of whether they are Left or Right.
*
* {{{
Expand Down
4 changes: 2 additions & 2 deletions src/library/scala/util/parsing/input/Position.scala
Expand Up @@ -8,13 +8,13 @@

package scala.util.parsing.input

/** `Position` is the base trait for objects describing a position in a ``document''.
/** `Position` is the base trait for objects describing a position in a `document`.
*
* It provides functionality for:
* - generating a visual representation of this position (`longString`);
* - comparing two positions (`<`).
*
* To use this class for a concrete kind of ``document'', implement the `lineContents` method.
* To use this class for a concrete kind of `document`, implement the `lineContents` method.
*
* @author Martin Odersky
* @author Adriaan Moors
Expand Down
4 changes: 2 additions & 2 deletions src/reflect/scala/reflect/internal/Flags.scala
Expand Up @@ -175,8 +175,8 @@ class Flags extends ModifierFlags {
final val VBRIDGE = 1L << 42 // symbol is a varargs bridge

final val VARARGS = 1L << 43 // symbol is a Java-style varargs method
final val TRIEDCOOKING = 1L << 44 // ``Cooking'' has been tried on this symbol
// A Java method's type is ``cooked'' by transforming raw types to existentials
final val TRIEDCOOKING = 1L << 44 // `Cooking` has been tried on this symbol
// A Java method's type is `cooked` by transforming raw types to existentials

final val SYNCHRONIZED = 1L << 45 // symbol is a method which should be marked ACC_SYNCHRONIZED

Expand Down
Expand Up @@ -6,7 +6,7 @@ trait StripMarginInterpolator {
def stringContext: StringContext

/**
* A safe combination of `[[scala.collection.immutable.StringLike#stripMargin]]
* A safe combination of [[scala.collection.immutable.StringLike#stripMargin]]
* and [[scala.StringContext#raw]].
*
* The margin of each line is defined by whitespace leading up to a '|' character.
Expand Down
8 changes: 4 additions & 4 deletions src/reflect/scala/reflect/macros/Enclosures.scala
Expand Up @@ -34,8 +34,8 @@ trait Enclosures {
* Can be useful for interoperating with other macros and for imposing compiler-friendly limits on macro expansion.
*
* Is also priceless for emitting sane error messages for macros that are called by other macros on synthetic (i.e. position-less) trees.
* In that dire case navigate the ``enclosingMacros'' stack, and it will most likely contain at least one macro with a position-ful macro application.
* See ``enclosingPosition'' for a default implementation of this logic.
* In that dire case navigate the `enclosingMacros` stack, and it will most likely contain at least one macro with a position-ful macro application.
* See `enclosingPosition` for a default implementation of this logic.
*
* Unlike `openMacros`, this is a val, which means that it gets initialized when the context is created
* and always stays the same regardless of whatever happens during macro expansion.
Expand All @@ -51,9 +51,9 @@ trait Enclosures {
def enclosingImplicits: List[(Type, Tree)]

/** Tries to guess a position for the enclosing application.
* But that is simple, right? Just dereference ``pos'' of ``macroApplication''? Not really.
* But that is simple, right? Just dereference `pos` of `macroApplication`? Not really.
* If we're in a synthetic macro expansion (no positions), we must do our best to infer the position of something that triggerd this expansion.
* Surprisingly, quite often we can do this by navigation the ``enclosingMacros'' stack.
* Surprisingly, quite often we can do this by navigation the `enclosingMacros` stack.
*/
def enclosingPosition: Position

Expand Down

0 comments on commit 6d94b35

Please sign in to comment.