Skip to content

Commit 91cca71

Browse files
committed
Style tweaks and uncomment test source
1 parent dff6902 commit 91cca71

File tree

2 files changed

+9
-16
lines changed

2 files changed

+9
-16
lines changed

compiler/src/dotty/tools/dotc/parsing/Scanners.scala

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -979,34 +979,29 @@ object Scanners {
979979
}
980980
case _ =>
981981
def fetchOther() =
982-
if (ch == '\u21D2') {
982+
if ch == '\u21D2' then
983983
nextChar(); token = ARROW
984984
report.deprecationWarning(em"The unicode arrow `⇒` is deprecated, use `=>` instead. If you still wish to display it as one character, consider using a font with programming ligatures such as Fira Code.", sourcePos(offset))
985-
}
986-
else if (ch == '\u2190') {
985+
else if ch == '\u2190' then
987986
nextChar(); token = LARROW
988987
report.deprecationWarning(em"The unicode arrow `←` is deprecated, use `<-` instead. If you still wish to display it as one character, consider using a font with programming ligatures such as Fira Code.", sourcePos(offset))
989-
}
990-
else if (isUnicodeIdentifierStart(ch)) {
988+
else if isUnicodeIdentifierStart(ch) then
991989
putChar(ch)
992990
nextChar()
993991
getIdentRest()
994-
if (ch == '"' && token == IDENTIFIER) token = INTERPOLATIONID
995-
}
996-
else if (isSpecial(ch)) {
992+
if ch == '"' && token == IDENTIFIER then token = INTERPOLATIONID
993+
else if isSpecial(ch) then
997994
putChar(ch)
998995
nextChar()
999996
getOperatorRest()
1000-
}
1001997
else if isSupplementary(ch, isUnicodeIdentifierStart) then
1002998
getIdentRest()
1003-
if (ch == '"' && token == IDENTIFIER) token = INTERPOLATIONID
999+
if ch == '"' && token == IDENTIFIER then token = INTERPOLATIONID
10041000
else if isSupplementary(ch, isSpecial) then
10051001
getOperatorRest()
1006-
else {
1002+
else
10071003
error(em"illegal character '${toUnicode(ch)}'")
10081004
nextChar()
1009-
}
10101005
fetchOther()
10111006
}
10121007
}
@@ -1167,8 +1162,8 @@ object Scanners {
11671162
if nxch == '/' || nxch == '*' then finishNamed()
11681163
else { putChar(ch); nextChar(); getOperatorRest() }
11691164
case _ =>
1170-
if (isSpecial(ch)) { putChar(ch); nextChar(); getOperatorRest() }
1171-
else if (isSupplementary(ch, isSpecial)) getOperatorRest()
1165+
if isSpecial(ch) then { putChar(ch); nextChar(); getOperatorRest() }
1166+
else if isSupplementary(ch, isSpecial) then getOperatorRest()
11721167
else finishNamed()
11731168
}
11741169

tests/pos/t1406.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,8 @@ class Strings {
2525
implicit class Interps(sc: StringContext) {
2626
def 𝓅(parts: Any*) = "done"
2727
}
28-
/*
2928
def 𝓅 = 42
3029
def interpolated = s"$𝓅"
3130
def e = "a 𝓅 b"
32-
*/
3331
def f = 𝓅"one"
3432
}

0 commit comments

Comments
 (0)