diff options
author | Eugene Vigdorchik <eugene.vigdorchik@gmail.com> | 2013-03-20 12:37:52 +0400 |
---|---|---|
committer | Eugene Vigdorchik <eugene.vigdorchik@gmail.com> | 2013-03-21 19:00:14 +0400 |
commit | 2ba065f0ae434944566ca8fe76232af32ab8e21a (patch) | |
tree | 4b1170b9a93c2228b3786a7c4175d342b6e3e980 /src/compiler/scala/tools/nsc/ast/parser | |
parent | 7adab908d661f1b238a96972e96ed11ea497bcdc (diff) | |
download | scala-2ba065f0ae434944566ca8fe76232af32ab8e21a.tar.gz scala-2ba065f0ae434944566ca8fe76232af32ab8e21a.tar.bz2 scala-2ba065f0ae434944566ca8fe76232af32ab8e21a.zip |
Doc -> C-style comments for local symbols to avoid "discarding
unmoored doc comment" warning when building distribution for
scala itself.
Diffstat (limited to 'src/compiler/scala/tools/nsc/ast/parser')
4 files changed, 38 insertions, 41 deletions
diff --git a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala index 9218ad3330..0396a871de 100644 --- a/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala +++ b/src/compiler/scala/tools/nsc/ast/parser/Parsers.scala @@ -321,38 +321,38 @@ self => accept(EOF) def mainModuleName = newTermName(settings.script.value) - /** If there is only a single object template in the file and it has a - * suitable main method, we will use it rather than building another object - * around it. Since objects are loaded lazily the whole script would have - * been a no-op, so we're not taking much liberty. + /* If there is only a single object template in the file and it has a + * suitable main method, we will use it rather than building another object + * around it. Since objects are loaded lazily the whole script would have + * been a no-op, so we're not taking much liberty. */ def searchForMain(): Option[Tree] = { - /** Have to be fairly liberal about what constitutes a main method since - * nothing has been typed yet - for instance we can't assume the parameter - * type will look exactly like "Array[String]" as it could have been renamed - * via import, etc. + /* Have to be fairly liberal about what constitutes a main method since + * nothing has been typed yet - for instance we can't assume the parameter + * type will look exactly like "Array[String]" as it could have been renamed + * via import, etc. */ def isMainMethod(t: Tree) = t match { case DefDef(_, nme.main, Nil, List(_), _, _) => true case _ => false } - /** For now we require there only be one top level object. */ + /* For now we require there only be one top level object. */ var seenModule = false val newStmts = stmts collect { case t @ Import(_, _) => t case md @ ModuleDef(mods, name, template) if !seenModule && (md exists isMainMethod) => seenModule = true - /** This slightly hacky situation arises because we have no way to communicate - * back to the scriptrunner what the name of the program is. Even if we were - * willing to take the sketchy route of settings.script.value = progName, that - * does not work when using fsc. And to find out in advance would impose a - * whole additional parse. So instead, if the actual object's name differs from - * what the script is expecting, we transform it to match. + /* This slightly hacky situation arises because we have no way to communicate + * back to the scriptrunner what the name of the program is. Even if we were + * willing to take the sketchy route of settings.script.value = progName, that + * does not work when using fsc. And to find out in advance would impose a + * whole additional parse. So instead, if the actual object's name differs from + * what the script is expecting, we transform it to match. */ if (name == mainModuleName) md else treeCopy.ModuleDef(md, mods, mainModuleName, template) case _ => - /** If we see anything but the above, fail. */ + /* If we see anything but the above, fail. */ return None } Some(makePackaging(0, emptyPkg, newStmts)) @@ -2265,8 +2265,8 @@ self => accept(DOT) result } - /** Walks down import `foo.bar.baz.{ ... }` until it ends at a - * an underscore, a left brace, or an undotted identifier. + /* Walks down import `foo.bar.baz.{ ... }` until it ends at a + * an underscore, a left brace, or an undotted identifier. */ def loop(expr: Tree): Tree = { expr setPos expr.pos.makeTransparent diff --git a/src/compiler/scala/tools/nsc/ast/parser/Scanners.scala b/src/compiler/scala/tools/nsc/ast/parser/Scanners.scala index 6ad1c50075..b485e862fd 100644 --- a/src/compiler/scala/tools/nsc/ast/parser/Scanners.scala +++ b/src/compiler/scala/tools/nsc/ast/parser/Scanners.scala @@ -303,11 +303,11 @@ trait Scanners extends ScannersCommon { next.token = EMPTY } - /** Insert NEWLINE or NEWLINES if - * - we are after a newline - * - we are within a { ... } or on toplevel (wrt sepRegions) - * - the current token can start a statement and the one before can end it - * insert NEWLINES if we are past a blank line, NEWLINE otherwise + /* Insert NEWLINE or NEWLINES if + * - we are after a newline + * - we are within a { ... } or on toplevel (wrt sepRegions) + * - the current token can start a statement and the one before can end it + * insert NEWLINES if we are past a blank line, NEWLINE otherwise */ if (!applyBracePatch() && afterLineEnd() && inLastOfStat(lastToken) && inFirstOfStat(token) && (sepRegions.isEmpty || sepRegions.head == RBRACE)) { @@ -440,7 +440,7 @@ trait Scanners extends ScannersCommon { nextChar() base = 16 } else { - /** + /* * What should leading 0 be in the future? It is potentially dangerous * to let it be base-10 because of history. Should it be an error? Is * there a realistic situation where one would need it? @@ -959,7 +959,7 @@ trait Scanners extends ScannersCommon { } token = INTLIT - /** When we know for certain it's a number after using a touch of lookahead */ + /* When we know for certain it's a number after using a touch of lookahead */ def restOfNumber() = { putChar(ch) nextChar() @@ -987,8 +987,8 @@ trait Scanners extends ScannersCommon { val lookahead = lookaheadReader val c = lookahead.getc() - /** As of scala 2.11, it isn't a number unless c here is a digit, so - * settings.future.value excludes the rest of the logic. + /* As of scala 2.11, it isn't a number unless c here is a digit, so + * settings.future.value excludes the rest of the logic. */ if (settings.future.value && !isDigit(c)) return setStrVal() @@ -998,16 +998,16 @@ trait Scanners extends ScannersCommon { case '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' => true - /** Backquoted idents like 22.`foo`. */ + /* Backquoted idents like 22.`foo`. */ case '`' => return setStrVal() /** Note the early return */ - /** These letters may be part of a literal, or a method invocation on an Int. + /* These letters may be part of a literal, or a method invocation on an Int. */ case 'd' | 'D' | 'f' | 'F' => !isIdentifierPart(lookahead.getc()) - /** A little more special handling for e.g. 5e7 */ + /* A little more special handling for e.g. 5e7 */ case 'e' | 'E' => val ch = lookahead.getc() !isIdentifierPart(ch) || (isDigit(ch) || ch == '+' || ch == '-') diff --git a/src/compiler/scala/tools/nsc/ast/parser/SymbolicXMLBuilder.scala b/src/compiler/scala/tools/nsc/ast/parser/SymbolicXMLBuilder.scala index cdcfd0b834..f326212d5b 100755 --- a/src/compiler/scala/tools/nsc/ast/parser/SymbolicXMLBuilder.scala +++ b/src/compiler/scala/tools/nsc/ast/parser/SymbolicXMLBuilder.scala @@ -196,7 +196,7 @@ abstract class SymbolicXMLBuilder(p: Parsers#Parser, preserveWS: Boolean) { uri1 } - /** Extract all the namespaces from the attribute map. */ + /* Extract all the namespaces from the attribute map. */ val namespaces: List[Tree] = for (z <- attrMap.keys.toList ; if z startsWith xmlns) yield { val ns = splitPrefix(z) match { diff --git a/src/compiler/scala/tools/nsc/ast/parser/TreeBuilder.scala b/src/compiler/scala/tools/nsc/ast/parser/TreeBuilder.scala index d70b1f4d9c..897c6dfdb0 100644 --- a/src/compiler/scala/tools/nsc/ast/parser/TreeBuilder.scala +++ b/src/compiler/scala/tools/nsc/ast/parser/TreeBuilder.scala @@ -353,9 +353,9 @@ abstract class TreeBuilder { */ private def makeFor(mapName: TermName, flatMapName: TermName, enums: List[Enumerator], body: Tree): Tree = { - /** make a closure pat => body. - * The closure is assigned a transparent position with the point at pos.point and - * the limits given by pat and body. + /* make a closure pat => body. + * The closure is assigned a transparent position with the point at pos.point and + * the limits given by pat and body. */ def makeClosure(pos: Position, pat: Tree, body: Tree): Tree = { def splitpos = wrappingPos(List(pat, body)).withPoint(pos.point).makeTransparent @@ -371,26 +371,23 @@ abstract class TreeBuilder { } } - /** Make an application qual.meth(pat => body) positioned at `pos`. + /* Make an application qual.meth(pat => body) positioned at `pos`. */ def makeCombination(pos: Position, meth: TermName, qual: Tree, pat: Tree, body: Tree): Tree = Apply(Select(qual, meth) setPos qual.pos, List(makeClosure(pos, pat, body))) setPos pos - /** If `pat` is not yet a `Bind` wrap it in one with a fresh name - */ + /* If `pat` is not yet a `Bind` wrap it in one with a fresh name */ def makeBind(pat: Tree): Tree = pat match { case Bind(_, _) => pat case _ => Bind(freshName(), pat) setPos pat.pos } - /** A reference to the name bound in Bind `pat`. - */ + /* A reference to the name bound in Bind `pat`. */ def makeValue(pat: Tree): Tree = pat match { case Bind(name, _) => Ident(name) setPos pat.pos.focus } - /** The position of the closure that starts with generator at position `genpos`. - */ + /* The position of the closure that starts with generator at position `genpos`. */ def closurePos(genpos: Position) = { val end = body.pos match { case NoPosition => genpos.point |