From d5e3f85946af966111f88af90a666a709df0ba6f Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Tue, 13 Nov 2012 00:14:40 -0800 Subject: Revert "Commenting out unused members." This reverts commit 951fc3a486. --- .../scala/tools/nsc/javac/JavaParsers.scala | 8 ++-- .../scala/tools/nsc/javac/JavaScanners.scala | 48 +++++++++++----------- .../scala/tools/nsc/javac/JavaTokens.scala | 12 +++--- 3 files changed, 34 insertions(+), 34 deletions(-) (limited to 'src/compiler/scala/tools/nsc/javac') diff --git a/src/compiler/scala/tools/nsc/javac/JavaParsers.scala b/src/compiler/scala/tools/nsc/javac/JavaParsers.scala index 63f08c42ec..2f6c13dd67 100644 --- a/src/compiler/scala/tools/nsc/javac/JavaParsers.scala +++ b/src/compiler/scala/tools/nsc/javac/JavaParsers.scala @@ -35,7 +35,7 @@ trait JavaParsers extends ast.parser.ParsersCommon with JavaScanners { abstract class JavaParser extends ParserCommon { val in: JavaScanner - // protected def posToReport: Int = in.currentPos + protected def posToReport: Int = in.currentPos def freshName(prefix : String): Name protected implicit def i2p(offset : Int) : Position private implicit def p2i(pos : Position): Int = if (pos.isDefined) pos.point else -1 @@ -94,11 +94,11 @@ trait JavaParsers extends ast.parser.ParsersCommon with JavaScanners { if (skipIt) skip() } - // def warning(msg: String) : Unit = warning(in.currentPos, msg) + def warning(msg: String) : Unit = warning(in.currentPos, msg) def errorTypeTree = TypeTree().setType(ErrorType) setPos in.currentPos - // def errorTermTree = Literal(Constant(null)) setPos in.currentPos - // def errorPatternTree = blankExpr setPos in.currentPos + def errorTermTree = Literal(Constant(null)) setPos in.currentPos + def errorPatternTree = blankExpr setPos in.currentPos // --------- tree building ----------------------------- diff --git a/src/compiler/scala/tools/nsc/javac/JavaScanners.scala b/src/compiler/scala/tools/nsc/javac/JavaScanners.scala index 95a22f847b..e230585a8b 100644 --- a/src/compiler/scala/tools/nsc/javac/JavaScanners.scala +++ b/src/compiler/scala/tools/nsc/javac/JavaScanners.scala @@ -57,14 +57,14 @@ trait JavaScanners extends ast.parser.ScannersCommon { /** ... */ abstract class AbstractJavaScanner extends AbstractJavaTokenData { - // implicit def p2g(pos: Position): ScanPosition + implicit def p2g(pos: Position): ScanPosition implicit def g2p(pos: ScanPosition): Position /** the last error position */ - // var errpos: ScanPosition - // var lastPos: ScanPosition - // def skipToken: ScanPosition + var errpos: ScanPosition + var lastPos: ScanPosition + def skipToken: ScanPosition def nextToken(): Unit def next: AbstractJavaTokenData def intVal(negated: Boolean): Long @@ -73,7 +73,7 @@ trait JavaScanners extends ast.parser.ScannersCommon { def floatVal: Double = floatVal(false) //def token2string(token : Int) : String = configuration.token2string(token) /** return recent scala doc, if any */ - // def flushDoc: DocComment + def flushDoc: DocComment def currentPos: Position } @@ -227,16 +227,16 @@ trait JavaScanners extends ast.parser.ScannersCommon { abstract class JavaScanner extends AbstractJavaScanner with JavaTokenData with Cloneable with ScannerCommon { override def intVal = super.intVal// todo: needed? override def floatVal = super.floatVal - // override var errpos: Int = NoPos + override var errpos: Int = NoPos def currentPos: Position = g2p(pos - 1) var in: JavaCharArrayReader = _ - // def dup: JavaScanner = { - // val dup = clone().asInstanceOf[JavaScanner] - // dup.in = in.dup - // dup - // } + def dup: JavaScanner = { + val dup = clone().asInstanceOf[JavaScanner] + dup.in = in.dup + dup + } /** character buffer for literals */ @@ -256,11 +256,11 @@ trait JavaScanners extends ast.parser.ScannersCommon { */ var docBuffer: StringBuilder = null - // def flushDoc: DocComment = { - // val ret = if (docBuffer != null) DocComment(docBuffer.toString, NoPosition) else null - // docBuffer = null - // ret - // } + def flushDoc: DocComment = { + val ret = if (docBuffer != null) DocComment(docBuffer.toString, NoPosition) else null + docBuffer = null + ret + } /** add the given character to the documentation buffer */ @@ -279,10 +279,10 @@ trait JavaScanners extends ast.parser.ScannersCommon { /** read next token and return last position */ - // def skipToken: Int = { - // val p = pos; nextToken - // p - 1 - // } + def skipToken: Int = { + val p = pos; nextToken + p - 1 + } def nextToken() { if (next.token == EMPTY) { @@ -868,7 +868,7 @@ trait JavaScanners extends ast.parser.ScannersCommon { def syntaxError(pos: Int, msg: String) { error(pos, msg) token = ERROR - // errpos = pos + errpos = pos } /** generate an error at the current token position @@ -879,7 +879,7 @@ trait JavaScanners extends ast.parser.ScannersCommon { def incompleteInputError(msg: String) { incompleteInputError(pos, msg) token = EOF - // errpos = pos + errpos = pos } override def toString() = token match { @@ -918,11 +918,11 @@ trait JavaScanners extends ast.parser.ScannersCommon { class JavaUnitScanner(unit: CompilationUnit) extends JavaScanner { in = new JavaCharArrayReader(unit.source.content, !settings.nouescape.value, syntaxError) init - // def warning(pos: Int, msg: String) = unit.warning(pos, msg) + def warning(pos: Int, msg: String) = unit.warning(pos, msg) def error (pos: Int, msg: String) = unit. error(pos, msg) def incompleteInputError(pos: Int, msg: String) = unit.incompleteInputError(pos, msg) def deprecationWarning(pos: Int, msg: String) = unit.deprecationWarning(pos, msg) - // implicit def p2g(pos: Position): Int = if (pos.isDefined) pos.point else -1 + implicit def p2g(pos: Position): Int = if (pos.isDefined) pos.point else -1 implicit def g2p(pos: Int): Position = new OffsetPosition(unit.source, pos) } } diff --git a/src/compiler/scala/tools/nsc/javac/JavaTokens.scala b/src/compiler/scala/tools/nsc/javac/JavaTokens.scala index 90f73ec44a..a562de291d 100644 --- a/src/compiler/scala/tools/nsc/javac/JavaTokens.scala +++ b/src/compiler/scala/tools/nsc/javac/JavaTokens.scala @@ -13,8 +13,8 @@ object JavaTokens extends ast.parser.Tokens { /** identifiers */ final val IDENTIFIER = 10 - // def isIdentifier(code : Int) = - // code == IDENTIFIER + def isIdentifier(code : Int) = + code == IDENTIFIER /** keywords */ final val ABSTRACT = 20 @@ -68,8 +68,8 @@ object JavaTokens extends ast.parser.Tokens { final val VOLATILE = 68 final val WHILE = 69 - // def isKeyword(code : Int) = - // code >= ABSTRACT && code <= WHILE + def isKeyword(code : Int) = + code >= ABSTRACT && code <= WHILE /** special symbols */ final val COMMA = 70 @@ -115,8 +115,8 @@ object JavaTokens extends ast.parser.Tokens { final val GTGTEQ = 113 final val GTGTGTEQ = 114 - // def isSymbol(code : Int) = - // code >= COMMA && code <= GTGTGTEQ + def isSymbol(code : Int) = + code >= COMMA && code <= GTGTGTEQ /** parenthesis */ final val LPAREN = 115 -- cgit v1.2.3