diff options
author | Paul Phillips <paulp@improving.org> | 2012-11-13 00:14:40 -0800 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2012-11-19 11:55:06 -0800 |
commit | d5e3f85946af966111f88af90a666a709df0ba6f (patch) | |
tree | edb2d3cfae76679bc0311f3c22d01779a2f32ef3 /src/compiler/scala/tools/nsc/ast/parser/Tokens.scala | |
parent | 645c2676dd6699ac24a57dfe750386bbdb827ee8 (diff) | |
download | scala-d5e3f85946af966111f88af90a666a709df0ba6f.tar.gz scala-d5e3f85946af966111f88af90a666a709df0ba6f.tar.bz2 scala-d5e3f85946af966111f88af90a666a709df0ba6f.zip |
Revert "Commenting out unused members."
This reverts commit 951fc3a486.
Diffstat (limited to 'src/compiler/scala/tools/nsc/ast/parser/Tokens.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/ast/parser/Tokens.scala | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/src/compiler/scala/tools/nsc/ast/parser/Tokens.scala b/src/compiler/scala/tools/nsc/ast/parser/Tokens.scala index be8e1bc8b4..c3fd414426 100644 --- a/src/compiler/scala/tools/nsc/ast/parser/Tokens.scala +++ b/src/compiler/scala/tools/nsc/ast/parser/Tokens.scala @@ -6,14 +6,14 @@ package scala.tools.nsc package ast.parser -// import scala.annotation.switch +import scala.annotation.switch /** Common code between JavaTokens and Tokens. Not as much (and not as concrete) * as one might like because JavaTokens for no clear reason chose new numbers for * identical token sets. */ abstract class Tokens { - // import scala.reflect.internal.Chars._ + import scala.reflect.internal.Chars._ /** special tokens */ final val EMPTY = -3 @@ -32,16 +32,16 @@ abstract class Tokens { def LPAREN: Int def RBRACE: Int - // def isIdentifier(code: Int): Boolean + def isIdentifier(code: Int): Boolean def isLiteral(code: Int): Boolean - // def isKeyword(code: Int): Boolean - // def isSymbol(code: Int): Boolean - - // final def isSpace(at: Char) = at == ' ' || at == '\t' - // final def isNewLine(at: Char) = at == CR || at == LF || at == FF - // final def isBrace(code: Int) = code >= LPAREN && code <= RBRACE - // final def isOpenBrace(code: Int) = isBrace(code) && (code % 2 == 0) - // final def isCloseBrace(code: Int) = isBrace(code) && (code % 2 == 1) + def isKeyword(code: Int): Boolean + def isSymbol(code: Int): Boolean + + final def isSpace(at: Char) = at == ' ' || at == '\t' + final def isNewLine(at: Char) = at == CR || at == LF || at == FF + final def isBrace(code: Int) = code >= LPAREN && code <= RBRACE + final def isOpenBrace(code: Int) = isBrace(code) && (code % 2 == 0) + final def isCloseBrace(code: Int) = isBrace(code) && (code % 2 == 1) } object Tokens extends Tokens { @@ -56,16 +56,16 @@ object Tokens extends Tokens { /** identifiers */ final val IDENTIFIER = 10 final val BACKQUOTED_IDENT = 11 - // def isIdentifier(code: Int) = - // code >= IDENTIFIER && code <= BACKQUOTED_IDENT + def isIdentifier(code: Int) = + code >= IDENTIFIER && code <= BACKQUOTED_IDENT - // @switch def canBeginExpression(code: Int) = code match { - // case IDENTIFIER|BACKQUOTED_IDENT|USCORE => true - // case LBRACE|LPAREN|LBRACKET|COMMENT => true - // case IF|DO|WHILE|FOR|NEW|TRY|THROW => true - // case NULL|THIS|TRUE|FALSE => true - // case code => isLiteral(code) - // } + @switch def canBeginExpression(code: Int) = code match { + case IDENTIFIER|BACKQUOTED_IDENT|USCORE => true + case LBRACE|LPAREN|LBRACKET|COMMENT => true + case IF|DO|WHILE|FOR|NEW|TRY|THROW => true + case NULL|THIS|TRUE|FALSE => true + case code => isLiteral(code) + } /** keywords */ final val IF = 20 @@ -113,16 +113,16 @@ object Tokens extends Tokens { final val MACRO = 62 // not yet used in 2.10 final val THEN = 63 // not yet used in 2.10 - // def isKeyword(code: Int) = - // code >= IF && code <= LAZY + def isKeyword(code: Int) = + code >= IF && code <= LAZY - // @switch def isDefinition(code: Int) = code match { - // case CLASS|TRAIT|OBJECT => true - // case CASECLASS|CASEOBJECT => true - // case DEF|VAL|VAR => true - // case TYPE => true - // case _ => false - // } + @switch def isDefinition(code: Int) = code match { + case CLASS|TRAIT|OBJECT => true + case CASECLASS|CASEOBJECT => true + case DEF|VAL|VAR => true + case TYPE => true + case _ => false + } /** special symbols */ final val COMMA = 70 @@ -141,8 +141,8 @@ object Tokens extends Tokens { final val AT = 83 final val VIEWBOUND = 84 - // def isSymbol(code: Int) = - // code >= COMMA && code <= VIEWBOUND + def isSymbol(code: Int) = + code >= COMMA && code <= VIEWBOUND /** parenthesis */ final val LPAREN = 90 |