diff options
author | liu fengyun <liu@fengy.me> | 2016-12-08 21:15:34 +0100 |
---|---|---|
committer | liu fengyun <liu@fengy.me> | 2016-12-08 22:11:38 +0100 |
commit | d14de3d7b5955d353ba3108b91ad4eadc6697908 (patch) | |
tree | 44bb717e7e45095d959840fdc055b8d584a685b4 /compiler/src/dotty/tools/dotc/parsing | |
parent | ac160ea20dc3a18cad33484286cb3e37e9fe1171 (diff) | |
download | dotty-d14de3d7b5955d353ba3108b91ad4eadc6697908.tar.gz dotty-d14de3d7b5955d353ba3108b91ad4eadc6697908.tar.bz2 dotty-d14de3d7b5955d353ba3108b91ad4eadc6697908.zip |
fix #1779: support $_ and $_id in interpolated string
Diffstat (limited to 'compiler/src/dotty/tools/dotc/parsing')
-rw-r--r-- | compiler/src/dotty/tools/dotc/parsing/Parsers.scala | 4 | ||||
-rw-r--r-- | compiler/src/dotty/tools/dotc/parsing/Scanners.scala | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/compiler/src/dotty/tools/dotc/parsing/Parsers.scala b/compiler/src/dotty/tools/dotc/parsing/Parsers.scala index 51dafc928..1f5ad397d 100644 --- a/compiler/src/dotty/tools/dotc/parsing/Parsers.scala +++ b/compiler/src/dotty/tools/dotc/parsing/Parsers.scala @@ -625,6 +625,10 @@ object Parsers { atPos(in.offset) { if (in.token == IDENTIFIER) termIdent() + else if (in.token == USCORE) { + in.nextToken() + Ident(nme.WILDCARD) + } else if (in.token == THIS) { in.nextToken() This(EmptyTypeIdent) diff --git a/compiler/src/dotty/tools/dotc/parsing/Scanners.scala b/compiler/src/dotty/tools/dotc/parsing/Scanners.scala index 60003d098..101be167e 100644 --- a/compiler/src/dotty/tools/dotc/parsing/Scanners.scala +++ b/compiler/src/dotty/tools/dotc/parsing/Scanners.scala @@ -758,7 +758,7 @@ object Scanners { finishStringPart() nextRawChar() next.token = LBRACE - } else if (Character.isUnicodeIdentifierStart(ch)) { + } else if (Character.isUnicodeIdentifierStart(ch) || ch == '_') { finishStringPart() do { putChar(ch) |