Skip to content

Commit

Permalink
Merge pull request #5043 from dongjoon-hyun/fix_typos_in_spec_and_com…
Browse files Browse the repository at this point in the history
…ments

Fix some typos in `spec` documents and comments.
  • Loading branch information
retronym committed Mar 21, 2016
2 parents 0f5801e + 910a18e commit ad48e59
Show file tree
Hide file tree
Showing 28 changed files with 34 additions and 34 deletions.
2 changes: 1 addition & 1 deletion project/PartestUtil.scala
Expand Up @@ -33,7 +33,7 @@ object PartestUtil {
val srcPathOption = "--srcpath"
val grepOption = "--grep"

// HACK: if we parse `--srpath scaladoc`, we overwrite this var. The parser for test file paths
// HACK: if we parse `--srcpath scaladoc`, we overwrite this var. The parser for test file paths
// then lazily creates the examples based on the current value.
// TODO is there a cleaner way to do this with SBT's parser infrastructure?
var srcPath = "files"
Expand Down
2 changes: 1 addition & 1 deletion project/ScalaOptionParser.scala
Expand Up @@ -79,7 +79,7 @@ object ScalaOptionParser {
P <~ token(OptSpace)
}

// TODO retrieve this data programatically, ala https://github.com/scala/scala-tool-support/blob/master/bash-completion/src/main/scala/BashCompletion.scala
// TODO retrieve this data programmatically, ala https://github.com/scala/scala-tool-support/blob/master/bash-completion/src/main/scala/BashCompletion.scala
private def booleanSettingNames = List("-X", "-Xcheckinit", "-Xdev", "-Xdisable-assertions", "-Xexperimental", "-Xfatal-warnings", "-Xfull-lubs", "-Xfuture", "-Xlog-free-terms", "-Xlog-free-types", "-Xlog-implicit-conversions", "-Xlog-implicits", "-Xlog-reflective-calls",
"-Xno-forwarders", "-Xno-patmat-analysis", "-Xno-uescape", "-Xnojline", "-Xprint-pos", "-Xprint-types", "-Xprompt", "-Xresident", "-Xshow-phases", "-Xstrict-inference", "-Xverify", "-Y",
"-Ybreak-cycles", "-Ydebug", "-Ycompact-trees", "-YdisableFlatCpCaching", "-Ydoc-debug",
Expand Down
2 changes: 1 addition & 1 deletion spec/11-annotations.md
Expand Up @@ -94,7 +94,7 @@ Java platform, the following annotations have a standard meaning.

* `@deprecatedName(name: <symbollit>)`<br/>
Marks a formal parameter name as deprecated. Invocations of this entity
using named parameter syntax refering to the deprecated parameter name cause a deprecation warning.
using named parameter syntax referring to the deprecated parameter name cause a deprecation warning.

### Scala Compiler Annotations

Expand Down
4 changes: 2 additions & 2 deletions spec/15-changelog.md
Expand Up @@ -441,7 +441,7 @@ In the example, `Twice` is an extractor object with two methods:

- The `unapply` method is used to decompose an even number; it is in a sense
the reverse of `apply`. `unapply` methods return option types:
`Some(...)` for a match that suceeds, `None` for a match that fails.
`Some(...)` for a match that succeeds, `None` for a match that fails.
Pattern variables are returned as the elements of `Some`.
If there are several variables, they are grouped in a tuple.

Expand Down Expand Up @@ -532,7 +532,7 @@ In particular, one can now simulate package protected access as in Java writing

where would name the package containing `X`.

#### Relaxation of Private Acess
#### Relaxation of Private Access

[Private members of a class](05-classes-and-objects.html#private) can now be
referenced from the companion module of the class and vice versa.
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/scala/tools/nsc/backend/jvm/CoreBTypes.scala
Expand Up @@ -11,7 +11,7 @@ import scala.tools.nsc.backend.jvm.BTypes.InternalName
*
* The symbols used to initialize the ClassBTypes may change from one compiler run to the next. To
* make sure the definitions are consistent with the symbols in the current run, the
* `intializeCoreBTypes` method in BTypesFromSymbols creates a new instance of CoreBTypes in each
* `initializeCoreBTypes` method in BTypesFromSymbols creates a new instance of CoreBTypes in each
* compiler run.
*
* The class BTypesFromSymbols does not directly reference CoreBTypes, but CoreBTypesProxy. The
Expand Down
Expand Up @@ -273,7 +273,7 @@ class BackendUtils[BT <: BTypes](val btypes: BT) {
}

// we are only interested in the class references in the descriptor, so we can skip over
// primitves and the brackets of array descriptors
// primitives and the brackets of array descriptors
def visitDescriptor(desc: String): Unit = (desc.charAt(0): @switch) match {
case '(' =>
val internalNames = mutable.ListBuffer.empty[String]
Expand Down Expand Up @@ -455,7 +455,7 @@ class BackendUtils[BT <: BTypes](val btypes: BT) {
insn match {
case v: VarInsnNode =>
val longSize = if (isSize2LoadOrStore(v.getOpcode)) 1 else 0
maxLocals = math.max(maxLocals, v.`var` + longSize + 1) // + 1 becauase local numbers are 0-based
maxLocals = math.max(maxLocals, v.`var` + longSize + 1) // + 1 because local numbers are 0-based

case i: IincInsnNode =>
maxLocals = math.max(maxLocals, i.`var` + 1)
Expand Down
Expand Up @@ -441,10 +441,10 @@ trait ProdConsAnalyzerImpl {
* return a;
* }
*
* In the first frame of the method, the SoruceValue for parameter `a` gives an empty set of
* In the first frame of the method, the SourceValue for parameter `a` gives an empty set of
* producer instructions.
*
* In the frame of the `IRETURN` instruction, the SoruceValue for parameter `a` lists a single
* In the frame of the `IRETURN` instruction, the SourceValue for parameter `a` lists a single
* producer instruction: the `ISTORE 1`. This makes it look as if there was a single producer for
* `a`, where in fact it might still hold the parameter's initial value.
*/
Expand Down
Expand Up @@ -43,7 +43,7 @@ package scala.tools.nsc.backend.jvm
* - Stores a frame for each instruction
* - `merge` function takes an instruction and a frame, merges the existing frame for that instr
* (from the frames array) with the new frame passed as argument.
* if the frame changed, puts the instruction on the work queue (fixpiont).
* if the frame changed, puts the instruction on the work queue (fixpoint).
* - initial frame: initialized for first instr by calling interpreter.new[...]Value
* for each slot (locals and params), stored in frames[firstInstr] by calling `merge`
* - work queue of instructions (`queue` array, `top` index for next instruction to analyze)
Expand Down Expand Up @@ -191,7 +191,7 @@ package scala.tools.nsc.backend.jvm
* I measured nullness analysis (which tracks aliases) and a SimpleValue analysis. Nullness runs
* roughly 5x slower (because of alias tracking) at every problem size - this factor doesn't change.
*
* The numbers below are for nullness. Note that the the last column is constant, i.e., the running
* The numbers below are for nullness. Note that the last column is constant, i.e., the running
* time is proportional to #ins * #loc^2. Therefore we use this factor when limiting the maximal
* method size for running an analysis.
*
Expand Down
Expand Up @@ -156,7 +156,7 @@ class ClosureOptimizer[BT <: BTypes](val btypes: BT) {
// TODO: This is maybe over-cautious.
// We are checking if the closure body method is accessible at the closure callsite.
// If the closure allocation has access to the body method, then the callsite (in the same
// method as the alloction) should have access too.
// method as the allocation) should have access too.
val bodyAccessible: Either[OptimizerWarning, Boolean] = for {
(bodyMethodNode, declClass) <- byteCodeRepository.methodNode(lambdaBodyHandle.getOwner, lambdaBodyHandle.getName, lambdaBodyHandle.getDesc): Either[OptimizerWarning, (MethodNode, InternalName)]
isAccessible <- inliner.memberIsAccessible(bodyMethodNode.access, classBTypeFromParsedClassfile(declClass), classBTypeFromParsedClassfile(lambdaBodyHandle.getOwner), ownerClass)
Expand Down
6 changes: 3 additions & 3 deletions src/compiler/scala/tools/nsc/backend/jvm/opt/CopyProp.scala
Expand Up @@ -52,7 +52,7 @@ class CopyProp[BT <: BTypes](val btypes: BT) {
var r = init
while (it.hasNext) {
val n = it.next()
// knownUsed.lenght is the number of locals, `n` may be a stack slot
// knownUsed.length is the number of locals, `n` may be a stack slot
if (n < knownUsed.length && knownUsed(n)) return n
if (n < r) r = n
}
Expand Down Expand Up @@ -171,7 +171,7 @@ class CopyProp[BT <: BTypes](val btypes: BT) {
*
* A special case eliminates the creation of unused objects with side-effect-free constructors:
* NEW scala/Tuple1; DUP; ALOAD 0; INVOKESPECIAL scala/Tuple1.<init>; POP
* The POP has a signle producer (the DUP), it's easy to eliminate these two. A special case
* The POP has a single producer (the DUP), it's easy to eliminate these two. A special case
* is needed to eliminate the INVOKESPECIAL and NEW.
*/
def eliminatePushPop(method: MethodNode, owner: InternalName): Boolean = {
Expand Down Expand Up @@ -533,7 +533,7 @@ class CopyProp[BT <: BTypes](val btypes: BT) {
}

/**
* Try to pair `insn` with its correspondant on the stack
* Try to pair `insn` with its correspondent on the stack
* - if the stack top is a store and `insn` is a corresponding load, create a pair
* - otherwise, check the two top stack values for `null; store`. if it matches, create
* a pair and continue pairing `insn` on the remaining stack
Expand Down
Expand Up @@ -504,7 +504,7 @@ class LocalOpt[BT <: BTypes](val btypes: BT) {

case v: VarInsnNode if isLive =>
val longSize = if (isSize2LoadOrStore(v.getOpcode)) 1 else 0
maxLocals = math.max(maxLocals, v.`var` + longSize + 1) // + 1 becauase local numbers are 0-based
maxLocals = math.max(maxLocals, v.`var` + longSize + 1) // + 1 because local numbers are 0-based

case i: IincInsnNode if isLive =>
maxLocals = math.max(maxLocals, i.`var` + 1)
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/scala/tools/nsc/javac/JavaParsers.scala
Expand Up @@ -509,7 +509,7 @@ trait JavaParsers extends ast.parser.ParsersCommon with JavaScanners {
EmptyTree
}
}
// for abstract methods (of classes), the `DEFERRED` flag is alredy set.
// for abstract methods (of classes), the `DEFERRED` flag is already set.
// here we also set it for interface methods that are not static and not default.
if (!isConcreteInterfaceMethod) mods1 |= Flags.DEFERRED
List {
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/scala/tools/nsc/transform/Constructors.scala
Expand Up @@ -305,7 +305,7 @@ abstract class Constructors extends Statics with Transform with ast.TreeDSL {
val delayedHook = delayedEndpointDef(remainingConstrStats)
val delayedHookSym = delayedHook.symbol.asInstanceOf[MethodSymbol]

// transform to make the closure-class' default constructor assign the the outer instance to its param-accessor field.
// transform to make the closure-class' default constructor assign the outer instance to its param-accessor field.
val hookCallerClass = (new ConstructorTransformer(unit)) transform delayedInitClosure(delayedHookSym)
val delayedInitCall = localTyper.typedPos(impl.pos) {
gen.mkMethodCall(This(clazz), delayedInitMethod, Nil, List(New(hookCallerClass.symbol.tpe, This(clazz))))
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/scala/tools/nsc/transform/Delambdafy.scala
Expand Up @@ -8,7 +8,7 @@ import scala.collection.mutable.LinkedHashMap

/**
* This transformer is responsible for preparing lambdas for runtime, by either translating to anonymous classes
* or to a tree that will be convereted to invokedynamic by the JVM 1.8+ backend.
* or to a tree that will be converted to invokedynamic by the JVM 1.8+ backend.
*
* The main assumption it makes is that a lambda {args => body} has been turned into
* {args => liftedBody()} where lifted body is a top level method that implements the body of the lambda.
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/scala/tools/nsc/transform/TailCalls.scala
Expand Up @@ -69,7 +69,7 @@ abstract class TailCalls extends Transform {
* are optimized. Since 'this' is not a local variable, a dummy local val
* is added and used as a label parameter. The backend knows to load
* the corresponding argument in the 'this' (local at index 0). This dummy local
* is never used and should be cleand up by dead code elimination (when enabled).
* is never used and should be cleaned up by dead code elimination (when enabled).
* </p>
* <p>
* This phase has been moved before pattern matching to catch more
Expand Down
Expand Up @@ -222,7 +222,7 @@ trait Interface extends ast.TreeDSL {
object substIdentsForTrees extends Transformer {
private def typedIfOrigTyped(to: Tree, origTp: Type): Tree =
if (origTp == null || origTp == NoType) to
// important: only type when actually substing and when original tree was typed
// important: only type when actually substituting and when original tree was typed
// (don't need to use origTp as the expected type, though, and can't always do this anyway due to unknown type params stemming from polymorphic extractors)
else typer.typed(to)

Expand Down
2 changes: 1 addition & 1 deletion src/compiler/scala/tools/nsc/typechecker/Typers.scala
Expand Up @@ -3155,7 +3155,7 @@ trait Typers extends Adaptations with Tags with TypersTracking with PatternTyper
if (phase.erasedTypes) stats1
else {
// As packages are open, it doesn't make sense to check double definitions here. Furthermore,
// it is expensive if the package is large. Instead, such double defininitions are checked in `Namers.enterInScope`
// it is expensive if the package is large. Instead, such double definitions are checked in `Namers.enterInScope`
if (!context.owner.isPackageClass)
checkNoDoubleDefs
addSynthetics(stats1)
Expand Down
2 changes: 1 addition & 1 deletion src/library/scala/concurrent/impl/Promise.scala
Expand Up @@ -304,7 +304,7 @@ private[concurrent] object Promise {

/** Tries to add the callback, if already completed, it dispatches the callback to be executed.
* Used by `onComplete()` to add callbacks to a promise and by `link()` to transfer callbacks
* to the root promise when linking two promises togehter.
* to the root promise when linking two promises together.
*/
@tailrec
private def dispatchOrAddCallback(runnable: CallbackRunnable[T]): Unit = {
Expand Down
2 changes: 1 addition & 1 deletion src/reflect/scala/reflect/internal/Positions.scala
Expand Up @@ -254,7 +254,7 @@ trait Positions extends api.Positions { self: SymbolTable =>
case mdef: MemberDef =>
val annTrees = mdef.mods.annotations match {
case Nil if mdef.symbol != null =>
// After typechecking, annotations are mvoed from the modifiers
// After typechecking, annotations are moved from the modifiers
// to the annotation on the symbol of the anotatee.
mdef.symbol.annotations.map(_.original)
case anns => anns
Expand Down
2 changes: 1 addition & 1 deletion src/reflect/scala/reflect/internal/Reporting.scala
Expand Up @@ -9,7 +9,7 @@ package internal

/** Provides delegates to the reporter doing the actual work.
* All forwarding methods should be marked final,
* but some subclasses out of our reach stil override them.
* but some subclasses out of our reach still override them.
*
* Eventually, this interface should be reduced to one method: `reporter`,
* and clients should indirect themselves (reduce duplication of forwarders).
Expand Down
2 changes: 1 addition & 1 deletion src/reflect/scala/reflect/internal/util/WeakHashSet.scala
Expand Up @@ -223,7 +223,7 @@ final class WeakHashSet[A <: AnyRef](val initialCapacity: Int, val loadFactor: D

def +=(elem: A) = this + elem

// from scala.reflect.interanl.Set
// from scala.reflect.internal.Set
override def addEntry(x: A) { this += x }

// remove an element from this set and return this set
Expand Down
Expand Up @@ -78,7 +78,7 @@ trait PresentationCompilation {
abstract class PresentationCompileResult {
val compiler: scala.tools.nsc.interactive.Global
def unit: compiler.RichCompilationUnit
/** The length of synthetic code the precedes the user writtn code */
/** The length of synthetic code the precedes the user written code */
def preambleLength: Int
def cleanup(): Unit = {
compiler.askShutdown()
Expand Down
Expand Up @@ -63,7 +63,7 @@ abstract class Comment {

/** A list of other resources to see, including links to other entities or
* to external documentation. The empty list is used when no other resource
* is mentionned. */
* is mentioned. */
def see: List[Body]

/** A description of the result of the entity. Typically, this provides additional
Expand Down
2 changes: 1 addition & 1 deletion src/scaladoc/scala/tools/nsc/doc/model/Entity.scala
Expand Up @@ -455,7 +455,7 @@ trait ValueParam extends ParameterEntity {
/** The type of this value parameter. */
def resultType: TypeEntity

/** The devault value of this value parameter, if it has been defined. */
/** The default value of this value parameter, if it has been defined. */
def defaultValue: Option[TreeEntity]

/** Whether this value parameter is implicit. */
Expand Down
2 changes: 1 addition & 1 deletion src/scaladoc/scala/tools/nsc/doc/model/ModelFactory.scala
Expand Up @@ -51,7 +51,7 @@ class ModelFactory(val global: Global, val settings: doc.Settings) {
lazy val dotRunner = new DotRunner(settings)
}
_modelFinished = true
// complete the links between model entities, everthing that couldn't have been done before
// complete the links between model entities, everything that couldn't have been done before
universe.rootPackage.completeModel()

Some(universe) filter (_.rootPackage != null)
Expand Down
Expand Up @@ -163,7 +163,7 @@ trait DiagramDirectiveParser {
case Nil =>
defaultFilter

// compute the exact filters. By including the annotation, the diagram is autmatically added
// compute the exact filters. By including the annotation, the diagram is automatically added
case _ =>
tFilter -= System.currentTimeMillis
var hideDiagram0: Boolean = false
Expand Down
Expand Up @@ -63,7 +63,7 @@ trait DiagramFactory extends DiagramDirectiveParser {
case d: TemplateImpl if !classExcluded(d) => NormalNode(makeType(d.sym.tpe, tpl), Some(d))()
}.sortBy(_.tpl.get.name)(implicitly[Ordering[String]].reverse)

// outgoing implicit coversions
// outgoing implicit conversions
lazy val outgoingImplicitNodes = tpl.outgoingImplicitlyConvertedClasses.map {
case (outgoingTpl, outgoingType, conv) =>
ImplicitNode(outgoingType, Some(outgoingTpl))(implicitTooltip(from=tpl, to=tpl, conv=conv))
Expand Down
@@ -1,6 +1,6 @@
package test

/* check availability of members defined locally and in hierachy */
/* check availability of members defined locally and in hierarchy */

abstract class Base1 {

Expand Down

0 comments on commit ad48e59

Please sign in to comment.