diff --git a/compiler/src/dotty/tools/dotc/core/NameOps.scala b/compiler/src/dotty/tools/dotc/core/NameOps.scala index 9d88b8289648..a7490274b0c2 100644 --- a/compiler/src/dotty/tools/dotc/core/NameOps.scala +++ b/compiler/src/dotty/tools/dotc/core/NameOps.scala @@ -4,7 +4,7 @@ package core import java.security.MessageDigest import scala.io.Codec import Names._, StdNames._, Contexts._, Symbols._, Flags._, NameKinds._, Types._ -import scala.tasty.util.Chars +import scala.internal.Chars import Chars.isOperatorPart import Definitions._ diff --git a/compiler/src/dotty/tools/dotc/core/Names.scala b/compiler/src/dotty/tools/dotc/core/Names.scala index cb987d7ebf16..481a5821dd69 100644 --- a/compiler/src/dotty/tools/dotc/core/Names.scala +++ b/compiler/src/dotty/tools/dotc/core/Names.scala @@ -7,7 +7,7 @@ import util.NameTransformer import printing.{Showable, Texts, Printer} import Texts.Text import StdNames.str -import scala.tasty.util.Chars.isIdentifierStart +import scala.internal.Chars.isIdentifierStart import collection.immutable import config.Config import java.util.HashMap diff --git a/compiler/src/dotty/tools/dotc/parsing/CharArrayReader.scala b/compiler/src/dotty/tools/dotc/parsing/CharArrayReader.scala index ca784d6de87f..14d7a53c0f0f 100644 --- a/compiler/src/dotty/tools/dotc/parsing/CharArrayReader.scala +++ b/compiler/src/dotty/tools/dotc/parsing/CharArrayReader.scala @@ -2,7 +2,7 @@ package dotty.tools package dotc package parsing -import scala.tasty.util.Chars._ +import scala.internal.Chars._ abstract class CharArrayReader { self => diff --git a/compiler/src/dotty/tools/dotc/parsing/JavaScanners.scala b/compiler/src/dotty/tools/dotc/parsing/JavaScanners.scala index 0452b9f6e672..81c8ff9b0d6f 100644 --- a/compiler/src/dotty/tools/dotc/parsing/JavaScanners.scala +++ b/compiler/src/dotty/tools/dotc/parsing/JavaScanners.scala @@ -8,7 +8,7 @@ import Scanners._ import util.SourceFile import JavaTokens._ import scala.annotation.{ switch, tailrec } -import scala.tasty.util.Chars._ +import scala.internal.Chars._ object JavaScanners { diff --git a/compiler/src/dotty/tools/dotc/parsing/Parsers.scala b/compiler/src/dotty/tools/dotc/parsing/Parsers.scala index 10f7d70d3a65..43bc7d50058b 100644 --- a/compiler/src/dotty/tools/dotc/parsing/Parsers.scala +++ b/compiler/src/dotty/tools/dotc/parsing/Parsers.scala @@ -22,7 +22,7 @@ import Constants._ import Symbols.defn import ScriptParsers._ import Decorators._ -import scala.tasty.util.Chars.isIdentifierStart +import scala.internal.Chars.isIdentifierStart import scala.annotation.{tailrec, switch} import rewrites.Rewrites.patch diff --git a/compiler/src/dotty/tools/dotc/parsing/Scanners.scala b/compiler/src/dotty/tools/dotc/parsing/Scanners.scala index af0fb9c46190..66dcad5099fc 100644 --- a/compiler/src/dotty/tools/dotc/parsing/Scanners.scala +++ b/compiler/src/dotty/tools/dotc/parsing/Scanners.scala @@ -6,7 +6,7 @@ import core.Names._, core.Contexts._, core.Decorators._, util.Spans._ import core.StdNames._, core.Comments._ import util.SourceFile import java.lang.Character.isDigit -import scala.tasty.util.Chars._ +import scala.internal.Chars._ import util.NameTransformer.avoidIllegalChars import util.Spans.Span import Tokens._ diff --git a/compiler/src/dotty/tools/dotc/parsing/package.scala b/compiler/src/dotty/tools/dotc/parsing/package.scala index 4871d1b893c1..e039e1bf67fb 100644 --- a/compiler/src/dotty/tools/dotc/parsing/package.scala +++ b/compiler/src/dotty/tools/dotc/parsing/package.scala @@ -1,6 +1,6 @@ package dotty.tools.dotc -import scala.tasty.util.Chars._ +import scala.internal.Chars._ import core.Names.Name import core.StdNames.nme import core.NameOps._ diff --git a/compiler/src/dotty/tools/dotc/parsing/xml/MarkupParserCommon.scala b/compiler/src/dotty/tools/dotc/parsing/xml/MarkupParserCommon.scala index a7a22d1cee34..d51bbfe6f7ca 100644 --- a/compiler/src/dotty/tools/dotc/parsing/xml/MarkupParserCommon.scala +++ b/compiler/src/dotty/tools/dotc/parsing/xml/MarkupParserCommon.scala @@ -10,7 +10,7 @@ package parsing package xml import Utility._ -import scala.tasty.util.Chars.SU +import scala.internal.Chars.SU diff --git a/compiler/src/dotty/tools/dotc/parsing/xml/MarkupParsers.scala b/compiler/src/dotty/tools/dotc/parsing/xml/MarkupParsers.scala index a56df8e14906..9279d0b72416 100644 --- a/compiler/src/dotty/tools/dotc/parsing/xml/MarkupParsers.scala +++ b/compiler/src/dotty/tools/dotc/parsing/xml/MarkupParsers.scala @@ -6,7 +6,7 @@ package xml import scala.collection.mutable import mutable.{ Buffer, ArrayBuffer, ListBuffer } import scala.util.control.ControlThrowable -import scala.tasty.util.Chars.SU +import scala.internal.Chars.SU import Parsers._ import util.Spans._ import core._ diff --git a/compiler/src/dotty/tools/dotc/parsing/xml/Utility.scala b/compiler/src/dotty/tools/dotc/parsing/xml/Utility.scala index ad2a5fe54758..5533badbd5c7 100644 --- a/compiler/src/dotty/tools/dotc/parsing/xml/Utility.scala +++ b/compiler/src/dotty/tools/dotc/parsing/xml/Utility.scala @@ -12,7 +12,7 @@ import scala.collection.mutable * @author Burak Emir */ object Utility { - import scala.tasty.util.Chars.SU + import scala.internal.Chars.SU private val unescMap = Map( "lt" -> '<', diff --git a/compiler/src/dotty/tools/dotc/printing/RefinedPrinter.scala b/compiler/src/dotty/tools/dotc/printing/RefinedPrinter.scala index 4b842119e6a9..d7ec980d15ef 100644 --- a/compiler/src/dotty/tools/dotc/printing/RefinedPrinter.scala +++ b/compiler/src/dotty/tools/dotc/printing/RefinedPrinter.scala @@ -20,7 +20,7 @@ import typer.ProtoTypes._ import Trees._ import TypeApplications._ import Decorators._ -import scala.tasty.util.Chars.isOperatorPart +import scala.internal.Chars.isOperatorPart import transform.TypeUtils._ import language.implicitConversions diff --git a/compiler/src/dotty/tools/dotc/reporting/MessageRendering.scala b/compiler/src/dotty/tools/dotc/reporting/MessageRendering.scala index 1b28cbc8996a..9cb9b6057ebc 100644 --- a/compiler/src/dotty/tools/dotc/reporting/MessageRendering.scala +++ b/compiler/src/dotty/tools/dotc/reporting/MessageRendering.scala @@ -11,7 +11,7 @@ import printing.SyntaxHighlighting import diagnostic.{ErrorMessageID, Message, MessageContainer} import diagnostic.messages._ import util.SourcePosition -import scala.tasty.util.Chars.{ LF, CR, FF, SU } +import scala.internal.Chars.{ LF, CR, FF, SU } import scala.annotation.switch import scala.collection.mutable diff --git a/compiler/src/dotty/tools/dotc/transform/TreeChecker.scala b/compiler/src/dotty/tools/dotc/transform/TreeChecker.scala index 09d592bcfbc5..2333221b50b2 100644 --- a/compiler/src/dotty/tools/dotc/transform/TreeChecker.scala +++ b/compiler/src/dotty/tools/dotc/transform/TreeChecker.scala @@ -18,7 +18,7 @@ import typer.ErrorReporting._ import reporting.ThrowingReporter import ast.Trees._ import ast.{tpd, untpd} -import scala.tasty.util.Chars._ +import scala.internal.Chars._ import collection.mutable import ProtoTypes._ diff --git a/compiler/src/dotty/tools/dotc/typer/Checking.scala b/compiler/src/dotty/tools/dotc/typer/Checking.scala index d68e771292de..57279309e719 100644 --- a/compiler/src/dotty/tools/dotc/typer/Checking.scala +++ b/compiler/src/dotty/tools/dotc/typer/Checking.scala @@ -37,7 +37,7 @@ import transform.patmat.SpaceEngine.isIrrefutableUnapply import collection.mutable import reporting.diagnostic.Message import reporting.diagnostic.messages._ -import scala.tasty.util.Chars.isOperatorPart +import scala.internal.Chars.isOperatorPart object Checking { import tpd._ diff --git a/compiler/src/dotty/tools/dotc/util/CommentParsing.scala b/compiler/src/dotty/tools/dotc/util/CommentParsing.scala index 61c42ced3d92..1c02a473b0b6 100644 --- a/compiler/src/dotty/tools/dotc/util/CommentParsing.scala +++ b/compiler/src/dotty/tools/dotc/util/CommentParsing.scala @@ -15,7 +15,7 @@ import scala.collection.mutable * handled by dottydoc. */ object CommentParsing { - import scala.tasty.util.Chars._ + import scala.internal.Chars._ /** Returns index of string `str` following `start` skipping longest * sequence of whitespace characters characters (but no newlines) diff --git a/compiler/src/dotty/tools/dotc/util/SourceFile.scala b/compiler/src/dotty/tools/dotc/util/SourceFile.scala index c765999cc133..fe87ca9b9043 100644 --- a/compiler/src/dotty/tools/dotc/util/SourceFile.scala +++ b/compiler/src/dotty/tools/dotc/util/SourceFile.scala @@ -6,7 +6,7 @@ import scala.collection.mutable.ArrayBuffer import dotty.tools.io._ import java.util.regex.Pattern import java.io.IOException -import scala.tasty.util.Chars._ +import scala.internal.Chars._ import Spans._ import scala.io.Codec import core.Names.TermName diff --git a/library/src/scala/tasty/util/Chars.scala b/library/src/scala/tasty/util/Chars.scala index 795eddea4b1a..e61d1fc65980 100644 --- a/library/src/scala/tasty/util/Chars.scala +++ b/library/src/scala/tasty/util/Chars.scala @@ -12,14 +12,19 @@ import java.lang.Character.UPPERCASE_LETTER @deprecated("Use scala.internal.Chars", "0.17") object Chars { + @deprecated("Use scala.internal.Chars", "0.18") final val LF = '\u000A' + @deprecated("Use scala.internal.Chars", "0.18") final val FF = '\u000C' + @deprecated("Use scala.internal.Chars", "0.18") final val CR = '\u000D' + @deprecated("Use scala.internal.Chars", "0.18") final val SU = '\u001A' /** Convert a character digit to an Int according to given base, * -1 if no success */ + @deprecated("Use scala.internal.Chars", "0.18") def digit2int(ch: Char, base: Int): Int = { val num = ( if (ch <= '9') ch - '0' @@ -33,6 +38,7 @@ object Chars { private[this] val char2uescapeArray = Array[Char]('\\', 'u', 0, 0, 0, 0) /** Convert a character to a backslash-u escape */ + @deprecated("Use scala.internal.Chars", "0.18") def char2uescape(c: Char): String = { @forceInline def hexChar(ch: Int): Char = (( if (ch < 10) '0' else 'A' - 10 ) + ch).toChar @@ -46,36 +52,44 @@ object Chars { } /** Is character a line break? */ + @deprecated("Use scala.internal.Chars", "0.18") def isLineBreakChar(c: Char): Boolean = (c: @switch) match { case LF|FF|CR|SU => true case _ => false } /** Is character a whitespace character (but not a new line)? */ + @deprecated("Use scala.internal.Chars", "0.18") def isWhitespace(c: Char): Boolean = c == ' ' || c == '\t' || c == CR /** Can character form part of a doc comment variable $xxx? */ + @deprecated("Use scala.internal.Chars", "0.18") def isVarPart(c: Char): Boolean = '0' <= c && c <= '9' || 'A' <= c && c <= 'Z' || 'a' <= c && c <= 'z' /** Can character start an alphanumeric Scala identifier? */ + @deprecated("Use scala.internal.Chars", "0.18") def isIdentifierStart(c: Char): Boolean = (c == '_') || (c == '$') || JCharacter.isUnicodeIdentifierStart(c) /** Can character form part of an alphanumeric Scala identifier? */ + @deprecated("Use scala.internal.Chars", "0.18") def isIdentifierPart(c: Char): Boolean = (c == '$') || JCharacter.isUnicodeIdentifierPart(c) /** Is character a math or other symbol in Unicode? */ + @deprecated("Use scala.internal.Chars", "0.18") def isSpecial(c: Char): Boolean = { val chtp = JCharacter.getType(c) chtp == JCharacter.MATH_SYMBOL.toInt || chtp == JCharacter.OTHER_SYMBOL.toInt } + @deprecated("Use scala.internal.Chars", "0.18") def isValidJVMChar(c: Char): Boolean = !(c == '.' || c == ';' || c =='[' || c == '/') + @deprecated("Use scala.internal.Chars", "0.18") def isValidJVMMethodChar(c: Char): Boolean = !(c == '.' || c == ';' || c =='[' || c == '/' || c == '<' || c == '>') @@ -84,9 +98,11 @@ object Chars { import JCharacter._ Set[Byte](LOWERCASE_LETTER, UPPERCASE_LETTER, OTHER_LETTER, TITLECASE_LETTER, LETTER_NUMBER) } + @deprecated("Use scala.internal.Chars", "0.18") def isScalaLetter(ch: Char): Boolean = letterGroups(JCharacter.getType(ch).toByte) || otherLetters(ch) /** Can character form part of a Scala operator name? */ + @deprecated("Use scala.internal.Chars", "0.18") def isOperatorPart(c : Char) : Boolean = (c: @switch) match { case '~' | '!' | '@' | '#' | '%' | '^' | '*' | '+' | '-' | '<' |